aa-autodep crashes when called with multiple parameters if profile already exists in active _and_ extra directory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
AppArmor |
New
|
Low
|
Unassigned |
Bug Description
After fixing bug 1378095, aa-autodep can still crash in rare cases
aa-autodep crashes if
- you call it with multiple parameters AND
- a profile (for example for sshd) exists in both /etc/apparmor.d/ AND the extra-profiles directory AND
- that profile contains hats
Reproducer:
- copy the sshd profile from the "inactive" dir to /etc/apparmor.d/
(important: the profile has to contain hats!)
- run aa-autodep with multiple parameters:
aa-autodep /bin/true /bin/false
This crash is caused by read_inactive_
Proof-of-concept patch- fixes the problem, but I'm not sure if I want it as final solution:
=== modified file 'utils/
--- utils/apparmor/
+++ utils/apparmor/
@@ -2593,7 +2593,15 @@
else:
+inactive_
+
def read_inactive_
+ global inactive_
+ if inactive_
+ print("
+ return
+ inactive_
+
if not os.path.
return None
try: