]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
apparmor: split xxx_in_ns into its two separate semantic use cases
authorJohn Johansen <john.johansen@canonical.com>
Thu, 25 Dec 2025 09:21:23 +0000 (01:21 -0800)
committerJohn Johansen <john.johansen@canonical.com>
Thu, 29 Jan 2026 09:27:55 +0000 (01:27 -0800)
commit796c146fa6c8289afc9e18004c21bfe05c75a487
treea8f69e3b815d23fc02d58ff735d05d7720f8562f
parenta4c9efa4dbad6dacad6e8b274e30e814c8353097
apparmor: split xxx_in_ns into its two separate semantic use cases

This patch doesn't change current functionality, it switches the two
uses of the in_ns fns and macros into the two semantically different
cases they are used for.

xxx_in_scope for checking mediation interaction between profiles
xxx_in_view to determine which profiles are visible.The scope will
always be a subset of the view as profiles that can not see each
other can not interact.

The split can not be completely done for label_match because it has to
distinct uses matching permission against label in scope, and checking
if a transition to a profile is allowed. The transition to a profile
can include profiles that are in view but not in scope, so retain this
distinction as a parameter.

While at the moment the two uses are very similar, in the future there
will be additional differences. So make sure the semantics differences
are present in the code.

Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/af_unix.c
security/apparmor/apparmorfs.c
security/apparmor/domain.c
security/apparmor/include/lib.h
security/apparmor/label.c