]> git.baikalelectronics.ru Git - kernel.git/commit
apparmor: improve overlapping domain attachment resolution
authorJohn Johansen <john.johansen@canonical.com>
Sun, 19 Nov 2017 03:43:13 +0000 (19:43 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Fri, 9 Feb 2018 19:30:02 +0000 (11:30 -0800)
commitcf67dd401c7f7f3ad612166d123d43d3742be7f6
treec9907b4423f352fbbb878fd4bc598a5b0ad032e9
parent4fe63b72ef9e0e8c8e8e3aecd1f8a2b8ff094319
apparmor: improve overlapping domain attachment resolution

Overlapping domain attachments using the current longest left exact
match fail in some simple cases, and with the fix to ensure consistent
behavior by failing unresolvable attachments it becomes important to
do a better job.

eg. under the current match the following are unresolvable where
the alternation is clearly a better match under the most specific
left match rule.
  /**
  /{bin/,}usr/

Use a counting match that detects when a loop in the state machine is
enter, and return the match count to provide a better specific left
match resolution.

Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/apparmorfs.c
security/apparmor/domain.c
security/apparmor/include/match.h
security/apparmor/match.c