UBUNTU: AppArmor: Fix masking of capabilities in complain mode
authorJohn Johansen <john.johansen@canonical.com>
Thu, 7 Apr 2011 17:41:58 +0000 (10:41 -0700)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Fri, 8 Apr 2011 16:28:29 +0000 (09:28 -0700)
commitd645fc0739b765eb0271cc9260b7d0623e06c750
tree8abbb989a87510bca54cc8a0c0c408db4cb918ec
parentcc35428245c69f379cb7d6d32721e3929a9d5461
UBUNTU: AppArmor: Fix masking of capabilities in complain mode

BugLink: http://bugs.launchpad.net/bugs/748656

AppArmor is masking the capabilities returned by capget against the
capabilities mask in the profile.  This is wrong, in complain mode the
profile has effectively all capabilities, as the profile restrictions are
not being enforced, merely tested against to determine is an access is
known by the profile.

This can result in the wrong behavior of security conscience applications
like sshd which examine their capability set, and change their behavior
accordingly.  In this case because of the masked capability set being
returned sshd fails due to DAC checks, even when the profile is complain
mode.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
security/apparmor/lsm.c