]> 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)
commit1f6ca5720a2f6f12ca9201abafc4da16207546bd
tree9c0993f64ff7eeaf3144a5063a4fb562c36c2f48
parent7432a992977f6393a30737f73a11d866dcf34596
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