Skip to content

Commit 433e3aa

Browse files
WOnder93pcmoore
authored andcommitted
selinux: drop unnecessary smp_load_acquire() call
In commit 66f8e2f ("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 <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 4b85039 commit 433e3aa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

security/selinux/ss/sidtab.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,7 @@ int sidtab_context_to_sid(struct sidtab *s, struct context *context,
276276
if (*sid)
277277
goto out_unlock;
278278

279-
/* read entries only after reading count */
280-
count = smp_load_acquire(&s->count);
279+
count = s->count;
281280
convert = s->convert;
282281

283282
/* bail out if we already reached max entries */

0 commit comments

Comments
 (0)