]> git.baikalelectronics.ru Git - kernel.git/commit
apparmor: ensure that undecidable profile attachments fail
authorJohn Johansen <john.johansen@canonical.com>
Sat, 18 Nov 2017 01:42:42 +0000 (17:42 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Tue, 21 Nov 2017 10:17:14 +0000 (02:17 -0800)
commitb20e898f49feac6ef7e54c38439a59590715e267
tree9c0993f64ff7eeaf3144a5063a4fb562c36c2f48
parent78c7acf0511d04f13f5112c4ecb30e00d2aa65a2
apparmor: ensure that undecidable profile attachments fail

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: 95c652c046bf ("AppArmor: functions for domain transitions")
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/domain.c