linux-stable/security/apparmor
John Johansen cbb13e12a5 apparmor: Fix regression in compat permissions for getattr
This fixes a regression in mediation of getattr when old policy built
under an older ABI is loaded and mapped to internal permissions.

The regression does not occur for all getattr permission requests,
only appearing if state zero is the final state in the permission
lookup.  This is because despite the first state (index 0) being
guaranteed to not have permissions in both newer and older permission
formats, it may have to carry permissions that were not mediated as
part of an older policy. These backward compat permissions are
mapped here to avoid special casing the mediation code paths.

Since the mapping code already takes into account backwards compat
permission from older formats it can be applied to state 0 to fix
the regression.

Fixes: 408d53e923 ("apparmor: compute file permissions on profile load")
Reported-by: Philip Meulengracht <the_meulengracht@hotmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2023-02-15 11:24:38 -08:00
..
include + Features 2022-12-14 13:42:09 -08:00
.gitignore
Kconfig + Features 2022-12-14 13:42:09 -08:00
Makefile + Features 2022-12-14 13:42:09 -08:00
apparmorfs.c apparmor: Fix decompression of rawdata for read back to userspace 2022-10-03 14:49:04 -07:00
audit.c AppArmor: Fix kernel-doc 2022-10-25 00:15:18 -07:00
capability.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
crypto.c
domain.c + Features 2022-12-14 13:42:09 -08:00
file.c + Features 2022-12-14 13:42:09 -08:00
ipc.c AppArmor: Fix kernel-doc 2022-10-25 00:15:18 -07:00
label.c apparmor: remove useless static inline functions 2022-10-24 22:35:11 -07:00
lib.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
lsm.c + Features 2022-12-14 13:42:09 -08:00
match.c apparmor: Add __init annotation to aa_{setup/teardown}_dfa_engine() 2022-11-01 21:17:26 -07:00
mount.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
net.c apparmor: rework profile->rules to be a list 2022-10-03 14:49:04 -07:00
nulldfa.in
path.c security: apparmor: delete repeated words in comments 2021-02-07 04:15:46 -08:00
policy.c apparmor: fix a memleak in free_ruleset() 2022-10-25 00:15:19 -07:00
policy_compat.c apparmor: Fix regression in compat permissions for getattr 2023-02-15 11:24:38 -08:00
policy_ns.c apparmor: Fix memleak in alloc_ns() 2022-11-01 05:32:13 -07:00
policy_unpack.c + Features 2022-12-14 13:42:09 -08:00
policy_unpack_test.c + Features 2022-12-14 13:42:09 -08:00
procattr.c apparmor: fix obsoleted comments for aa_getprocattr() and audit_resource() 2022-10-24 22:35:23 -07:00
resource.c apparmor: Fix spelling of function name in comment block 2022-10-25 00:15:19 -07:00
secid.c apparmor: disable showing the mode as part of a secid to secctx 2022-07-13 17:18:29 -07:00
stacksplitdfa.in
task.c apparmor: Simplify obtain the newest label on a cred 2022-10-03 14:49:04 -07:00