[apparmor] [utils] [patch] Fix stack trace in aa-mergeprof

Kshitij Gupta kgupta8592 at gmail.com
Thu Sep 4 18:16:39 UTC 2014


Hello,

An incorrect dictionary of netrules was being in the for condition
resulting in the following trace:

  File "/home/kshitij/workspace/apparmor-workspace/patch1/apparmor/utils/apparmor/cleanprofile.py",
line 147, in delete_net_duplicates
    for sock_type in netrules_other['rule'][fam].keys():
RuntimeError: dictionary changed size during iteration


The following patch:
- the correct dictionary was being used

=== modified file 'utils/apparmor/cleanprofile.py'
--- utils/apparmor/cleanprofile.py    2014-02-12 23:54:00 +0000
+++ utils/apparmor/cleanprofile.py    2014-09-04 17:40:27 +0000
@@ -144,7 +144,7 @@
                         netrules_other['rule'].pop(fam)
                         deleted += 1
             else:
-                for sock_type in netrules_other['rule'][fam].keys():
+                for sock_type in copy_netrules_other['rule'][fam].keys():
                     if netrules['rule'].get(fam, False):
                         if netrules['rule'][fam].get(sock_type, False):
                             if not same_profile:


Regards,

Kshitij Gupta



More information about the AppArmor mailing list