kernel_optimize_test/security/selinux/ss
Ondrej Mosnacek 116f21bb96 selinux: avoid atomic_t usage in sidtab
As noted in Documentation/atomic_t.txt, if we don't need the RMW atomic
operations, we should only use READ_ONCE()/WRITE_ONCE() +
smp_rmb()/smp_wmb() where necessary (or the combined variants
smp_load_acquire()/smp_store_release()).

This patch converts the sidtab code to use regular u32 for the counter
and reverse lookup cache and use the appropriate operations instead of
atomic_get()/atomic_set(). Note that when reading/updating the reverse
lookup cache we don't need memory barriers as it doesn't need to be
consistent or accurate. We can now also replace some atomic ops with
regular loads (when under spinlock) and stores (for conversion target
fields that are always accessed under the master table's spinlock).

We can now also bump SIDTAB_MAX to U32_MAX as we can use the full u32
range again.

Suggested-by: Jann Horn <jannh@google.com>
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Reviewed-by: Jann Horn <jannh@google.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
2019-08-27 13:26:13 -04:00
..
avtab.c selinux: convert to kvmalloc 2019-03-12 10:04:02 -07:00
avtab.h selinux: convert to kvmalloc 2019-03-12 10:04:02 -07:00
conditional.c selinux: convert to kvmalloc 2019-03-12 10:04:02 -07:00
conditional.h
constraint.h
context.h
ebitmap.c selinux: provide __le variables explicitly 2019-05-21 15:49:21 -04:00
ebitmap.h
hashtab.c
hashtab.h
mls_types.h
mls.c selinux/stable-4.21 PR 20181224 2018-12-27 12:01:58 -08:00
mls.h selinux: overhaul sidtab to fix bug and improve performance 2018-12-05 16:12:32 -05:00
policydb.c selinux: policydb - rename type_val_to_struct_array 2019-08-05 16:21:06 -04:00
policydb.h selinux: policydb - rename type_val_to_struct_array 2019-08-05 16:21:06 -04:00
services.c selinux: policydb - rename type_val_to_struct_array 2019-08-05 16:21:06 -04:00
services.h selinux: use separate table for initial SID lookup 2018-12-05 15:36:12 -05:00
sidtab.c selinux: avoid atomic_t usage in sidtab 2019-08-27 13:26:13 -04:00
sidtab.h selinux: avoid atomic_t usage in sidtab 2019-08-27 13:26:13 -04:00
status.c
symtab.c
symtab.h