[apparmor] [patch] Fix crash in serialize_profile_from_old_profiles()

Steve Beattie steve at nxnw.org
Thu Apr 16 00:09:35 UTC 2015


On Thu, Apr 09, 2015 at 12:04:13AM +0200, Christian Boltz wrote:
> Hello,
> 
> Assume you have a profile like
> 
>     /bin/foo {
>       /etc/ r,
>       network,
>       /usr/ r,
>     }
> 
> (important: there must be be a non-path rule between the two path blocks)
> 
> Then run aa-logprof and add another path event. When choosing (V)iew changes,
> it will crash with a misleading
> 
>   File ".../utils/apparmor/aamode.py", line 205, in split_mode
>       other = mode - user
>       TypeError: unsupported operand type(s) for -: 'collections.defaultdict' and 'set'
> 
> The reason for this is our beloved hasher, which is playing funny games
> another time.
> 
> The patch wraps the hasher usage with a check for the parent element to
> avoid auto-creation of empty childs, which then lead to the above crash.
> 
> 
> BTW: This is another issue uncovered by the LibreOffice profile ;-)
> 
> I propose this patch for trunk and 2.9
> 
> 
> [ 36-fix-crash-in-serialize_profile_from_old_profiles.diff ]

Acked-by: Steve Beattie <steve at nxnw.org> for trunk and 2.9. Thanks.

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150415/265f2d01/attachment.pgp>


More information about the AppArmor mailing list