selinux: access policycaps with READ_ONCE/WRITE_ONCE
Use READ_ONCE/WRITE_ONCE for all accesses to the selinux_state.policycaps booleans to prevent compiler mischief. Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:

committed by
Paul Moore

parent
66ccd2560a
commit
e8ba53d002
@@ -2123,7 +2123,8 @@ static void security_load_policycaps(struct selinux_state *state,
|
||||
p = &policy->policydb;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(state->policycap); i++)
|
||||
state->policycap[i] = ebitmap_get_bit(&p->policycaps, i);
|
||||
WRITE_ONCE(state->policycap[i],
|
||||
ebitmap_get_bit(&p->policycaps, i));
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(selinux_policycap_names); i++)
|
||||
pr_info("SELinux: policy capability %s=%d\n",
|
||||
|
Reference in New Issue
Block a user