diff options
author | John Johansen <john.johansen@canonical.com> | 2022-09-05 20:47:36 -0700 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2022-10-03 14:49:04 -0700 |
commit | 1ad22fcc4d0d2fb2e0f35aed555a86d016d5e590 (patch) | |
tree | 5cf7b9f785d46441d3c184a3097659eb7c2574ac /security/apparmor/lsm.c | |
parent | 217af7e2f4deb629aaa49622685ccfee923898ca (diff) | |
download | lwn-1ad22fcc4d0d2fb2e0f35aed555a86d016d5e590.tar.gz lwn-1ad22fcc4d0d2fb2e0f35aed555a86d016d5e590.zip |
apparmor: rework profile->rules to be a list
Convert profile->rules to a list as the next step towards supporting
multiple rulesets in a profile. For this step only support a single
list entry item. The logic for iterating the list will come as a
separate step.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/lsm.c')
-rw-r--r-- | security/apparmor/lsm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 62f2ca32b959..a22e53e44123 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -163,12 +163,15 @@ static int apparmor_capget(struct task_struct *target, kernel_cap_t *effective, struct label_it i; label_for_each_confined(i, label, profile) { + struct aa_ruleset *rules; if (COMPLAIN_MODE(profile)) continue; + rules = list_first_entry(&profile->rules, + typeof(*rules), list); *effective = cap_intersect(*effective, - profile->rules.caps.allow); + rules->caps.allow); *permitted = cap_intersect(*permitted, - profile->rules.caps.allow); + rules->caps.allow); } } rcu_read_unlock(); |