apparmor: modify audit rule support to support profile stacks
authorJohn Johansen <john.johansen@canonical.com>
Thu, 3 May 2018 07:39:58 +0000 (00:39 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Thu, 7 Jun 2018 08:50:48 +0000 (01:50 -0700)
commit2ab47dae54d567bbb1ad3e96e5b2601cc13f4d2b
tree74701da99807b936cf7fb7474fcd38dacf140ef8
parente79c26d04043b15de64f082d4da52e9fff7ca607
apparmor: modify audit rule support to support profile stacks

Allows for audit rules, where a rule could specify a profile stack
A//&B, while extending the current semantic so if the label specified
in the audit rule is a subset of the secid it is considered a match.

Eg. if the secid resolves to the label stack A//&B//&C

Then an audit rule specifying a label of

  A - would match
  B - would match
  C - would match
  D - would not
  A//&B - would match as a subset
  A//&C - would match as a subset
  B//&C - would match as a subset
  A//&B//&C - would match

  A//&D - would not match, because while A does match, D is also
  specified and does not

Note: audit rules are currently assumed to be coming from the root
namespace.

Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/audit.c