kernel_optimize_test/security/selinux/ss
Ondrej Mosnacek b42e5e3a84 selinux: fix bad cleanup on error in hashtab_duplicate()
commit 6254bd3db316c9ccb3b05caa8b438be63245466f upstream.

The code attempts to free the 'new' pointer using kmem_cache_free(),
which is wrong because this function isn't responsible of freeing it.
Instead, the function should free new->htable and clear the contents of
*new (to prevent double-free).

Cc: stable@vger.kernel.org
Fixes: c7c556f1e8 ("selinux: refactor changing booleans")
Reported-by: Wander Lairson Costa <wander@redhat.com>
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-25 09:17:55 +02:00
..
avtab.c selinux: fix cond_list corruption when changing booleans 2021-04-14 08:41:57 +02:00
avtab.h selinux: fix cond_list corruption when changing booleans 2021-04-14 08:41:57 +02:00
conditional.c selinux: fix double free of cond_list on error paths 2022-02-08 18:30:34 +01:00
conditional.h selinux: refactor changing booleans 2020-08-17 21:00:33 -04:00
constraint.h
context.c
context.h
ebitmap.c
ebitmap.h
hashtab.c selinux: fix bad cleanup on error in hashtab_duplicate() 2022-05-25 09:17:55 +02:00
hashtab.h selinux: refactor changing booleans 2020-08-17 21:00:33 -04:00
mls_types.h
mls.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
mls.h
policydb.c selinux: correct the return value when loads initial sids 2021-08-12 13:22:16 +02:00
policydb.h selinux: prepare for inlining of hashtab functions 2020-07-09 19:05:36 -04:00
services.c selinux: fix race condition when computing ocontext SIDs 2021-11-18 14:03:44 +01:00
services.h selinux: convert policy read-write lock to RCU 2020-08-25 08:34:47 -04:00
sidtab.c selinux: fix race between old and new sidtab 2021-04-14 08:41:57 +02:00
sidtab.h selinux: fix race between old and new sidtab 2021-04-14 08:41:57 +02:00
symtab.c selinux: prepare for inlining of hashtab functions 2020-07-09 19:05:36 -04:00
symtab.h selinux: specialize symtab insert and search functions 2020-07-08 20:21:43 -04:00