apparmor backtraces for goldfish kernel

Bug #1253707 reported by John Johansen
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux-goldfish (Ubuntu)
Fix Released
Undecided
John Johansen
Saucy
Won't Fix
Undecided
John Johansen
Trusty
Fix Released
Undecided
John Johansen

Bug Description

The goldfish kernel when apparmor is enable fills the logs with backtraces similar (there are several slightly different traces) to the following:

WARNING: at /build/buildd/linux-goldfish-3.4.0/security/apparmor/label.c:226 __aa_label_remove+0x54/0xd8()
AppArmor WARN __aa_label_remove: (((((void)(&(&ls->lock)->raw_lock), 1)))):
Modules linked in:
[<c0012864>] (unwind_backtrace+0x0/0x11c) from [<c001e774>] (warn_slowpath_common+0x4c/0x64)
[<c001e774>] (warn_slowpath_common+0x4c/0x64) from [<c001e80c>] (warn_slowpath_fmt+0x2c/0x3c)
[<c001e80c>] (warn_slowpath_fmt+0x2c/0x3c) from [<c01f6b84>] (__aa_label_remove+0x54/0xd8)
[<c01f6b84>] (__aa_label_remove+0x54/0xd8) from [<c01f75d4>] (aa_label_remove+0x28/0x5c)
[<c01f75d4>] (aa_label_remove+0x28/0x5c) from [<c01f7640>] (aa_label_kref+0x38/0x4c)
[<c01f7640>] (aa_label_kref+0x38/0x4c) from [<c01f888c>] (aa_label_parse+0x1d0/0x20c)
[<c01f888c>] (aa_label_parse+0x1d0/0x20c) from [<c01ecc48>] (query_label.constprop.4+0x210/0x334)
[<c01ecc48>] (query_label.constprop.4+0x210/0x334) from [<c01ecdf8>] (aa_write_access+0x8c/0xbc)
[<c01ecdf8>] (aa_write_access+0x8c/0xbc) from [<c00d2414>] (vfs_write+0xb0/0x128)
[<c00d2414>] (vfs_write+0xb0/0x128) from [<c00d2654>] (sys_write+0x3c/0x68)
[<c00d2654>] (sys_write+0x3c/0x68) from [<c000dc40>] (ret_fast_syscall+0x0/0x30)

Revision history for this message
John Johansen (jjohansen) wrote :

This bug occurs because apparmor is using the kernel macro
  can_write_lock()

in its AA_DEBUG asserts, however can_write_lock() does not work on non-smp kernels as the lock variable that is being tested is never updated, as the lock operations are removed.

Changed in linux-goldfish (Ubuntu):
assignee: nobody → John Johansen (jjohansen)
status: New → Confirmed
Changed in linux-goldfish (Ubuntu Saucy):
status: New → Confirmed
assignee: nobody → John Johansen (jjohansen)
Revision history for this message
John Johansen (jjohansen) wrote :

The following patch is needed

index 788ec21..39eae14 100644
--- a/security/apparmor/label.c
+++ b/security/apparmor/label.c
@@ -19,6 +19,10 @@
 #include "include/policy.h"
 #include "include/sid.h"

+#if !defined(CONFIG_SMP)
+#undef write_can_lock
+#define write_can_lock(X) 0
+#endif

 /*
  * the aa_label represents the set of profiles confining an object

Revision history for this message
John Johansen (jjohansen) wrote :

The goldfish kernel for saucy is not used nor supported so marking won't fix for saucy.

Changed in linux-goldfish (Ubuntu Saucy):
status: Confirmed → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-goldfish - 3.4.0-1.10

---------------
linux-goldfish (3.4.0-1.10) trusty; urgency=low

  [ Andy Whitcroft ]

  * [Config] switch build-depends to libiberty-dev

  [ Dimitri John Ledkov ]

  * [Config] enable CONFIG_INPUT_UINPUT
    - LP: #1260023

  [ John Johansen ]

  * SAUCE: (no-up) apparmor: fix backtrace on non-smp, kernels.
    - LP: #1253707
 -- Andy Whitcroft <email address hidden> Wed, 11 Dec 2013 18:04:04 +0000

Changed in linux-goldfish (Ubuntu Trusty):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.