linux/security/apparmor
John Johansen 1bed0c40af apparmor: ensure that undecidable profile attachments fail
commit 844b8292b6 upstream.

Profiles that have an undecidable overlap in their attachments are
being incorrectly handled. Instead of failing to attach the first one
encountered is being used.

eg.
  profile A /** { .. }
  profile B /*foo { .. }

have an unresolvable longest left attachment, they both have an exact
match on / and then have an overlapping expression that has no clear
winner.

Currently the winner will be the profile that is loaded first which
can result in non-deterministic behavior. Instead in this situation
the exec should fail.

Fixes: 898127c34e ("AppArmor: functions for domain transitions")
Signed-off-by: John Johansen <john.johansen@canonical.com>
[bwh: Backported to 3.16:
 - Add 'info' parameter to x_to_profile(), done upstream in commit
   93c98a484c "apparmor: move exec domain mediation to using labels"
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-02-13 18:42:27 +00:00
..
include nick kvfree() from apparmor 2014-05-06 14:02:53 -04:00
.gitignore AppArmor: remove af_names.h from .gitignore 2012-09-01 08:35:34 -07:00
apparmorfs.c apparmor: fix bad lock balance when introspecting policy 2013-10-16 11:54:01 +11:00
audit.c apparmor: remove parent task info from audit logging 2013-10-29 21:34:04 -07:00
capability.c apparmor: fix capability to not use the current task, during reporting 2013-10-29 21:33:37 -07:00
context.c apparmor: change how profile replacement update is done 2013-08-14 11:42:06 -07:00
crypto.c apparmor: Use shash crypto API interface for profile hashes 2013-09-30 09:53:59 +10:00
domain.c apparmor: ensure that undecidable profile attachments fail 2018-02-13 18:42:27 +00:00
file.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
ipc.c apparmor: fix capability to not use the current task, during reporting 2013-10-29 21:33:37 -07:00
Kconfig apparmor: add the ability to report a sha1 hash of loaded policy 2013-08-14 11:42:08 -07:00
lib.c nick kvfree() from apparmor 2014-05-06 14:02:53 -04:00
lsm.c security: replace strict_strto*() with kstrto*() 2014-02-06 19:11:04 +11:00
Makefile apparmor: add the ability to report a sha1 hash of loaded policy 2013-08-14 11:42:08 -07:00
match.c apparmor: reserve and mask off the top 8 bits of the base field 2013-04-28 00:37:32 -07:00
path.c apparmor: fix error code to failure message mapping for name lookup 2013-04-28 00:35:40 -07:00
policy.c apparmor: fix memleak of the profile hash 2013-10-16 11:53:59 +11:00
policy_unpack.c apparmor: add the ability to report a sha1 hash of loaded policy 2013-08-14 11:42:08 -07:00
procattr.c apparmor: add interface files for profiles and namespaces 2013-08-14 11:42:07 -07:00
resource.c apparmor: relax the restrictions on setting rlimits 2013-04-28 00:36:46 -07:00
sid.c AppArmor: core policy routines 2010-08-02 15:38:37 +10:00