Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selinux: drop unnecessary smp_load_acquire() call

In commit 66f8e2f03c02 ("selinux: sidtab reverse lookup hash table") the
corresponding load is moved under the spin lock, so there is no race
possible and we can read the count directly. The smp_store_release() is
still needed to avoid racing with the lock-free readers.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>

authored by

Ondrej Mosnacek and committed by
Paul Moore
433e3aa3 4b850396

+1 -2
+1 -2
security/selinux/ss/sidtab.c
··· 276 276 if (*sid) 277 277 goto out_unlock; 278 278 279 - /* read entries only after reading count */ 280 - count = smp_load_acquire(&s->count); 279 + count = s->count; 281 280 convert = s->convert; 282 281 283 282 /* bail out if we already reached max entries */