aboutsummaryrefslogtreecommitdiff
path: root/security/apparmor/policy_compat.c
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2023-07-23 02:30:33 -0700
committerJohn Johansen <john.johansen@canonical.com>2025-01-18 06:47:12 -0800
commit2e12c5f060176ede209673e4f63ea5d0e3c5814c (patch)
tree1ba485036de4844ba0d4ff93230b41c605c20677 /security/apparmor/policy_compat.c
parentde4754c801f4ceefc6ce0d13480c506e0a91b449 (diff)
apparmor: add additional flags to extended permission.
This is a step towards merging the file and policy state machines. With the switch to extended permissions the state machine's ACCEPT2 table became unused freeing it up to store state specific flags. The first flags to be stored are FLAG_OWNER and FLAG other which paves the way towards merging the file and policydb perms into a single permission table. Currently Lookups based on the objects ownership conditional will still need separate fns, this will be address in a following patch. Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/policy_compat.c')
-rw-r--r--security/apparmor/policy_compat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/security/apparmor/policy_compat.c b/security/apparmor/policy_compat.c
index 423227670e68..cfc2207e5a12 100644
--- a/security/apparmor/policy_compat.c
+++ b/security/apparmor/policy_compat.c
@@ -286,10 +286,10 @@ static void remap_dfa_accept(struct aa_dfa *dfa, unsigned int factor)
AA_BUG(!dfa);
- for (state = 0; state < state_count; state++)
+ for (state = 0; state < state_count; state++) {
ACCEPT_TABLE(dfa)[state] = state * factor;
- kvfree(dfa->tables[YYTD_ID_ACCEPT2]);
- dfa->tables[YYTD_ID_ACCEPT2] = NULL;
+ ACCEPT_TABLE2(dfa)[state] = factor > 1 ? ACCEPT_FLAG_OWNER : 0;
+ }
}
/* TODO: merge different dfa mappings into single map_policy fn */