apparmor fd_inheritance regression test causes kernel to crash on touch kernel backports
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | krillin |
Undecided
|
Unassigned | ||
| | vegetahd |
Undecided
|
Unassigned | ||
| | apparmor (Ubuntu) |
Medium
|
John Johansen | ||
| | linux-flo (Ubuntu) |
Medium
|
John Johansen | ||
| | linux-goldfish (Ubuntu) |
Medium
|
John Johansen | ||
| | linux-mako (Ubuntu) |
Medium
|
John Johansen | ||
| | linux-manta (Ubuntu) |
Medium
|
John Johansen | ||
Bug Description
On krillin with vivid-proposed, running the fd_inheritance test from the apparmor regression tests causes the kernel to crash and spontaneously reboot the device:
phablet@
phablet@
ok: fd inheritance; unconfined -> unconfined
ok: fd inheritance; confined -> unconfined
ok: fd inheritance; confined (bad perm) -> unconfined
ok: fd inheritance; confined (no perm) -> unconfined
ok: fd inheritance; unconfined -> confined
ok: fd inheritance; unconfined -> confined (no perm)
ok: fd inheritance; confined -> confined
ok: fd inheritance; confined (bad perm) -> confined
ok: fd inheritance; confined (no perm) -> confined
ok: fd inheritance; confined -> confined (bad perm)
[device reboots here]
This is what syslog sees before it falls over, though nothing after the logger invocation makes it to the disk:
Feb 20 03:51:47 ubuntu-phablet phablet: running fd_inheritance tests now
Feb 20 03:52:05 ubuntu-phablet kernel: [ 489.942611]
Feb 20 03:52:06 ubuntu-phablet kernel: [ 490.272023]
Feb 20 03:52:06 ubuntu-phablet kernel: [ 490.305028]
Feb 20 03:52:06 ubuntu-phablet kernel: [ 490.573275]
Feb 20 03:52:06 ubuntu-phablet kernel: [ 490.606454]
Feb 20 03:52:06 ubuntu-phablet kernel: [ 490.886149]
Feb 20 03:52:06 ubuntu-phablet kernel: [ 490.916538]
Feb 20 03:52:07 ubuntu-phablet kernel: [ 491.226336]
Feb 20 03:52:07 ubuntu-phablet kernel: [ 491.734888]
Feb 20 03:52:07 ubuntu-phablet kernel: [ 491.786710]
Feb 20 03:52:07 ubuntu-phablet kernel: [ 491.787186]
Feb 20 03:52:08 ubuntu-phablet kernel: [ 492.354445]
Feb 20 03:52:08 ubuntu-phablet kernel: [ 492.354874]
Feb 20 03:52:08 ubuntu-phablet kernel: [ 492.398480]
Feb 20 03:52:08 ubuntu-phablet kernel: [ 492.889451]
Feb 20 03:52:08 ubuntu-phablet kernel: [ 492.889889]
Feb 20 03:52:08 ubuntu-phablet kernel: [ 492.933754]
Feb 20 03:52:09 ubuntu-phablet kernel: [ 493.453991]
Feb 20 03:52:09 ubuntu-phablet kernel: [ 493.454422]
Feb 20 03:52:09 ubuntu-phablet kernel: [ 493.498903]
Feb 20 03:52:09 ubuntu-phablet kernel: [ 493.500082]
Feb 20 03:52:09 ubuntu-phablet kernel: [ 494.025605]
Feb 20 03:52:09 ubuntu-phablet kernel: [ 494.026398]
Note that because krillin is based on a 3.4 kernel, dmesg -w does not work to see anything emitted by the kernel before the spontaneous reboot.
ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: apparmor 2.8.98-0ubuntu4
ProcVersionSign
Uname: Linux 3.4.67 armv7l
ApportVersion: 2.16.1-0ubuntu2
Architecture: armhf
Date: Fri Feb 20 06:31:26 2015
InstallationDate: Installed on 2015-02-18 (1 days ago)
InstallationMedia: Ubuntu Vivid Vervet (development branch) - armhf (20150218-191234)
KernLog:
ProcKernelCmdline: console=
PstreeP: Error: [Errno 2] No such file or directory: '/usr/bin/pstree'
SourcePackage: apparmor
UpgradeStatus: No upgrade log present (probably fresh install)
| Steve Beattie (sbeattie) wrote : | #1 |
| Steve Beattie (sbeattie) wrote : | #2 |
| Steve Beattie (sbeattie) wrote : | #3 |
And the unix_fd_server test as well:
phablet@
[sudo] password for phablet:
ok: fd passing; unconfined -> unconfined
ok: fd passing; confined -> unconfined
ok: fd passing; confined (bad perm) -> unconfined
ok: fd passing; confined (no perm) -> unconfined
ok: fd passing; unconfined -> confined
ok: fd passing; unconfined -> confined (no perm)
ok: fd passing; confined -> confined
ok: fd passing; confined (bad perm) -> confined
ok: fd passing; confined (no perm) -> confined
ok: fd passing; confined -> confined (bad perm)
| Steve Beattie (sbeattie) wrote : | #4 |
... and the unix_socket_unamed test:
phablet@
[sudo] password for phablet:
ok: AF_UNIX unnamed socket (stream); unconfined server
ok: AF_UNIX unnamed socket (stream); confined server (implicit perms)
ok: AF_UNIX unnamed socket (stream); confined server (explicit perms)
ok: AF_UNIX unnamed socket (stream); confined server (type)
ok: AF_UNIX unnamed socket (stream); confined server (addr)
ok: AF_UNIX unnamed socket (stream); confined server (peer label w/ implicit perms)
ok: AF_UNIX unnamed socket (stream); confined server (peer label w/ explicit perms)
ok: AF_UNIX unnamed socket (stream); confined server (type, addr)
ok: AF_UNIX unnamed socket (stream); confined server (type, addr, peer label)
ok: AF_UNIX unnamed socket (stream); confined server (no unix rule)
ok: AF_UNIX unnamed socket (stream); confined server (missing perm: create)
ok: AF_UNIX unnamed socket (stream); confined server (missing perm: getopt)
ok: AF_UNIX unnamed socket (stream); confined server (missing perm: setopt)
ok: AF_UNIX unnamed socket (stream); confined server (missing perm: shutdown)
ok: AF_UNIX unnamed socket (stream); confined server (missing perm: read)
ok: AF_UNIX unnamed socket (stream); confined server (missing perm: write)
ok: AF_UNIX unnamed socket (stream); confined server (bad type)
ok: AF_UNIX unnamed socket (stream); confined server (bad addr)
ok: AF_UNIX unnamed socket (stream); confined server (bad peer label)
ok: AF_UNIX unnamed socket (stream); unconfined client
ok: AF_UNIX unnamed socket (stream); confined client (implicit perms)
ok: AF_UNIX unnamed socket (stream); confined client (explicit perms)
ok: AF_UNIX unnamed socket (stream); confined client (type)
ok: AF_UNIX unnamed socket (stream); confined client (peer label w/ implicit perms)
ok: AF_UNIX unnamed socket (stream); confined client (peer label w/ explicit perms)
ok: AF_UNIX unnamed socket (stream); confined client (peer addr)
ok: AF_UNIX unnamed socket (stream); confined client (peer label, peer addr)
ok: AF_UNIX unnamed socket (stream); confined client (type, peer label, peer addr)
ok: AF_UNIX unnamed socket (stream); confined client (no unix rule)
ok: AF_UNIX unnamed socket (stream); confined client (missing perm: getopt)
ok: AF_UNIX unnamed socket (stream); confined client (missing perm: setopt)
ok: AF_UNIX unnamed socket (stream); confined client (missing perm: getattr)
| Steve Beattie (sbeattie) wrote : | #5 |
While it's not surprising, I've confirmed that this issues affects ubuntu-rtm/14.09 on krillin as well.
| John Johansen (jjohansen) wrote : | #6 |
This only affects backport kernel based on the 3.5 or earlier kernels.
| Jamie Strandboge (jdstrand) wrote : | #7 |
Bug is in the various kernels. apparmor task is to track getting the patch into the backports tree.
| Changed in linux-flo (Ubuntu): | |
| status: | New → In Progress |
| importance: | Undecided → Medium |
| assignee: | nobody → John Johansen (jjohansen) |
| Changed in linux-goldfish (Ubuntu): | |
| status: | New → In Progress |
| importance: | Undecided → Medium |
| assignee: | nobody → John Johansen (jjohansen) |
| Changed in linux-mako (Ubuntu): | |
| status: | New → In Progress |
| importance: | Undecided → Medium |
| assignee: | nobody → John Johansen (jjohansen) |
| tags: | added: aa-kernel |
| Changed in linux-manta (Ubuntu): | |
| status: | New → In Progress |
| importance: | Undecided → Medium |
| assignee: | nobody → John Johansen (jjohansen) |
| Changed in apparmor (Ubuntu): | |
| status: | New → Triaged |
| assignee: | nobody → John Johansen (jjohansen) |
| summary: |
- [krillin] apparmor fd_inheritance regression test causes kernel to crash + apparmor fd_inheritance regression test causes kernel to crash on touch + kernel backports |
| Jamie Strandboge (jdstrand) wrote : | #8 |
Updated the summary since it said it was for krillin and the krillin task is being tracked in bug #1427825.
| Changed in apparmor (Ubuntu): | |
| importance: | Undecided → Medium |


Looks like the socketpair tests cause a similar issue:
phablet@ ubuntu- phablet: ~/src/apparmor- 2.9.1/tests/ regression/ apparmor$ sudo sh -c 'VERBOSE=1 bash socketpair.sh'
[sudo] password for phablet:
ok: SOCKETPAIR (unconfined)
ok: SOCKETPAIR (unconfined bad con)
ok: SOCKETPAIR (unconfined bad mode)
ok: SOCKETPAIR (confined)
ok: SOCKETPAIR (confined bad con)
ok: SOCKETPAIR (confined bad mode)
ok: SOCKETPAIR (complain)
ok: SOCKETPAIR (complain bad mode)
ok: SOCKETPAIR (complain)
ok: SOCKETPAIR (confined exec transition)
ok: SOCKETPAIR (confined exec transition, crosscheck rejection)
ok: SOCKETPAIR (confined exec no transition)
ok: SOCKETPAIR (confined exec transition from complain)
ok: SOCKETPAIR (confined exec transition to complain)
[phone spontaneously reboots here]