mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 15:29:16 +00:00
Changes for v5.15
mark 'smack_enabled' global variable as __initdata Fix wrong semantics in smk_access_entry() -----BEGIN PGP SIGNATURE----- iQJLBAABCAA1FiEEC+9tH1YyUwIQzUIeOKUVfIxDyBEFAmEtEKgXHGNhc2V5QHNj aGF1Zmxlci1jYS5jb20ACgkQOKUVfIxDyBH6bg//TC2UkIMF6Rr0VyTpmfKk1I16 cIzdkRGWtGS98bj9dbn8tH6Uzrj7DYfi81klUjmDS3cghOke+Jpc2iEruOGSm5gz gZ9dJAVTBXFSuuGbKFiI49heHlUXnvGlM4SqcJMDXrT6KOvGIj3G7B30QRhgzKGa hQtqTzFem5dFSiE7y98W6vISBfehYMDm3dWNGgThXzhqMXcN7AiB4iSh+0kzm40P crrFLqXDfIur0nHWVwV+g2Ib/9NI9wFINbjhhxC6QOyX8vFM6/jwN6lG+AyVU56h upNk00uGym0ccVBL/Q781+eqYQYOTdkM1+GsfOidJrlRThbqPZXmz2d9aYo6THmo J5z5l5D2Vw7NXbqEN8mPVed/KTt2Dpwpfz5SFDNvQr0xy1cPbLOYWMg0Be1epxpQ /SNgBeUHJEVCKTepwQNjrAyJElKsob0DKuv2I8dwETkrJc9Wt/BDXBtnHJImzN38 W0NuepSHU1bBlWoWawfj6KyNfttCC51ElvhxnYk9EoVTTYU8o+agN5Ih7CepA4JO J8GymEkwBzC30UVhV1oHsVHMeAByb5kLYZ9xhT5dV++qU0l1rwg/kHkJOh/XE4DH eCvrST6bDYbURfOEW9FD7WnDsjDrJp+QnogvdH3tA2S17wAj8pOh78VZRIwez2Qz sfw/kKxSHkTYa7KKjlE= =ruN3 -----END PGP SIGNATURE----- Merge tag 'Smack-for-5.15' of git://github.com/cschaufler/smack-next Pull smack updates from Casey Schaufler: "There is a variable used only during start-up that's now marked __initdata and a change where the code was working by sheer luck that is now done properly. Both have been in next for several weeks and pass the Smack testsuite" * tag 'Smack-for-5.15' of git://github.com/cschaufler/smack-next: smack: mark 'smack_enabled' global variable as __initdata Smack: Fix wrong semantics in smk_access_entry()
This commit is contained in:
commit
9b2eacd8f0
@ -302,7 +302,7 @@ int smack_populate_secattr(struct smack_known *skp);
|
||||
/*
|
||||
* Shared data.
|
||||
*/
|
||||
extern int smack_enabled;
|
||||
extern int smack_enabled __initdata;
|
||||
extern int smack_cipso_direct;
|
||||
extern int smack_cipso_mapped;
|
||||
extern struct smack_known *smack_net_ambient;
|
||||
|
@ -81,23 +81,22 @@ int log_policy = SMACK_AUDIT_DENIED;
|
||||
int smk_access_entry(char *subject_label, char *object_label,
|
||||
struct list_head *rule_list)
|
||||
{
|
||||
int may = -ENOENT;
|
||||
struct smack_rule *srp;
|
||||
|
||||
list_for_each_entry_rcu(srp, rule_list, list) {
|
||||
if (srp->smk_object->smk_known == object_label &&
|
||||
srp->smk_subject->smk_known == subject_label) {
|
||||
may = srp->smk_access;
|
||||
break;
|
||||
int may = srp->smk_access;
|
||||
/*
|
||||
* MAY_WRITE implies MAY_LOCK.
|
||||
*/
|
||||
if ((may & MAY_WRITE) == MAY_WRITE)
|
||||
may |= MAY_LOCK;
|
||||
return may;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* MAY_WRITE implies MAY_LOCK.
|
||||
*/
|
||||
if ((may & MAY_WRITE) == MAY_WRITE)
|
||||
may |= MAY_LOCK;
|
||||
return may;
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,7 +54,7 @@
|
||||
static DEFINE_MUTEX(smack_ipv6_lock);
|
||||
static LIST_HEAD(smk_ipv6_port_list);
|
||||
struct kmem_cache *smack_rule_cache;
|
||||
int smack_enabled;
|
||||
int smack_enabled __initdata;
|
||||
|
||||
#define A(s) {"smack"#s, sizeof("smack"#s) - 1, Opt_##s}
|
||||
static struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user