aa-logprof crash if (I)nherit'ing non-existing binary
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
AppArmor |
Fix Released
|
Low
|
Christian Boltz | ||
2.10 |
Fix Released
|
Undecided
|
Christian Boltz | ||
2.9 |
Fix Released
|
Undecided
|
Christian Boltz |
Bug Description
Imagine someone sent you his audit.log and asked you to update a profile for him...
Here's a hand-modified short audit.log:
# cat audit-log-
type=AVC msg=audit(
# aa-logprof -f audit-log-
Reading log entries from audit-log-
Aktualisiere AppArmor-Profile in /etc/apparmor.d.
Profil: /sbin/klogd
Ausführen: /does/not/exist
Schweregrad: unbekannt
(I)nherit / (C)hild / (P)rofile / (N)amed / (U)nconfined / (X) ix On / (D)eny / Abo(r)t / (F)inish
... choose (I)nherit ...
Traceback (most recent call last):
File "aa-logprof", line 52, in <module>
apparmor.
File "/home/
handle_
File "/home/
hashbang = head(exec_target)
File "/home/
raise AppArmorExcepti
apparmor.
Changed in apparmor: | |
importance: | Undecided → Low |
status: | New → Triaged |
Changed in apparmor: | |
status: | Fix Committed → Fix Released |
I can no longer reproduce this crash for inherit (probably since r3261, which introduced get_interpreter _and_abstractio n()), so the original bug is fixed in 2.10.1.
However, I found some new crashes using this log line:
- aa-logprof crashes when using (C)hild
- aa-logprof crashes when using (I)nherit and then (V)iev differences
- aa-logprof crashes when using (P)rofile and then (V)iev differences (also, no profile is created, and there's no message saying that)
This might be related to the profile name - the log has "/sbin/klogd", but the profile is named "klogd" and has a path attachment.
(C)hild profile:
Traceback (most recent call last): do_logprof_ pass(logmark) cb/apparmor/ HEAD-clean/ utils/apparmor/ aa.py", line 2208, in do_logprof_pass children( '', '', root) cb/apparmor/ HEAD-clean/ utils/apparmor/ aa.py", line 1515, in handle_children file_name] ['profiles' ][profile] [hat] = True defaultdict'
File "aa-logprof", line 50, in <module>
apparmor.
File "/home/
handle_
File "/home/
filelist[
TypeError: unhashable type: 'collections.
(V)iew changes:
Traceback (most recent call last): do_logprof_ pass(logmark) cb/apparmor/ HEAD-clean/ utils/apparmor/ aa.py", line 2225, in do_logprof_pass cb/apparmor/ HEAD-clean/ utils/apparmor/ aa.py", line 2305, in save_profiles profile_ from_old_ profile( aa[which] , which, '') cb/apparmor/ HEAD-clean/ utils/apparmor/ aa.py", line 3778, in serialize_ profile_ from_old_ profile data[hat] ['capability' ].is_covered( cap, True, True): defaultdict' object has no attribute 'is_covered'
File "aa-logprof", line 50, in <module>
apparmor.
File "/home/
save_profiles()
File "/home/
newprofile = serialize_
File "/home/
if write_prof_
AttributeError: 'collections.