← Back to team overview

touch-packages team mailing list archive

[Bug 1528139] Re: aa-logprof crash again

 

Thanks, I was able to reproduce the crash with your profiles and a hand-
tuned log line even with the latest bzr trunk:

# python3 aa-logprof -d lp1528139/apparmor.d/ -f <(echo '[ 2590.544373] audit: type=1400 audit(1450688542.244:3848): apparmor="ALLOWED" operation="open" profile="/usr/lib/NetworkManager/nm-dhcp-client.action" name="/crash/me" pid=7983 comm="foo" requested_mask="r" denied_mask="r" fsuid=0 ouid=0')
-> (A)llow
-> (V)iew Changes
-> enjoy the crash

The problem is that the /usr/lib/NetworkManager/nm-dhcp-client.action
profile is stored in apparmor.d/sbin.dhclient (which contains multiple
profiles). If I move it to a separate file, aa-logprof doesn't crash.

Now I "just" need to find out what is wrong - but that's easier with a reproducer available :-)
(Maybe the perfect answer is a total rewrite of serialize_profile_from_old_profile() which has more than one known bug, but that isn't something that will happen soon.)

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apparmor in Ubuntu.
https://bugs.launchpad.net/bugs/1528139

Title:
  aa-logprof crash again

Status in apparmor package in Ubuntu:
  New

Bug description:
  = Changed Local Profiles =

  The following local profiles were changed. Would you like to save
  them?

   [1 - /sbin/dhclient]
    2 - /usr/sbin/nmbd 
    3 - /usr/bin/snx 
    4 - /usr/sbin/dnsmasq 
    5 - /{usr/,}bin/ping 
    6 - /usr/sbin/smbd 
    7 - /usr/lib/telepathy/mission-control-5 
  (S)ave Changes / Save Selec(t)ed Profile / [(V)iew Changes] / View Changes b/w (C)lean profiles / Abo(r)t
  Traceback (most recent call last):
    File "/usr/sbin/aa-logprof", line 50, in <module>
      apparmor.do_logprof_pass(logmark)
    File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 2197, in do_logprof_pass
      save_profiles()
    File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 2277, in save_profiles
      newprofile = serialize_profile_from_old_profile(aa[which], which, '')
    File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 3961, in serialize_profile_from_old_profile
      if write_prof_data[hat]['network'].is_covered(network_obj, True, True):
  AttributeError: 'collections.defaultdict' object has no attribute 'is_covered'

  
  An unexpected error occoured!

  For details, see /tmp/apparmor-bugreport-v7wx9fu9.txt
  Please consider reporting a bug at https://bugs.launchpad.net/apparmor/
  and attach this file.

  When I pressed V button aa-logprof exits with error.

  ProblemType: Bug
  DistroRelease: Ubuntu 15.10
  Package: apparmor 2.10-0ubuntu6
  ProcVersionSignature: Ubuntu 4.2.0-21.25-generic 4.2.6
  Uname: Linux 4.2.0-21-generic x86_64
  ApportVersion: 2.19.1-0ubuntu5
  Architecture: amd64
  Date: Mon Dec 21 09:54:51 2015
  InstallationDate: Installed on 2014-04-19 (611 days ago)
  InstallationMedia: Ubuntu-Server 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
  ProcKernelCmdline: BOOT_IMAGE=/vmlinuz-4.2.0-21-generic root=/dev/mapper/ubuntu-root ro splash elevator=cfq nomdmonddf nomdmonisw crashkernel=384M-:128M
  SourcePackage: apparmor
  Syslog:
   
  UpgradeStatus: Upgraded to wily on 2015-11-14 (36 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1528139/+subscriptions


References