https://github.com/torvalds/linux
Revision 70effdc3756c924f4a2b6af1ec4e2e92e18e1b45 authored by Andrey Konovalov on 26 February 2022, 03:10:59 UTC, committed by Linus Torvalds on 26 February 2022, 17:51:17 UTC
With HW_TAGS KASAN and kasan.stacktrace=off, the cache created in the
kmem_cache_double_destroy() test might get merged with an existing one.
Thus, the first kmem_cache_destroy() call won't actually destroy it but
will only decrease the refcount.  This causes the test to fail.

Provide an empty constructor for the created cache to prevent the cache
from getting merged.

Link: https://lkml.kernel.org/r/b597bd434c49591d8af00ee3993a42c609dc9a59.1644346040.git.andreyknvl@google.com
Fixes: f98f966cd750 ("kasan: test: add test case for double-kmem_cache_destroy()")
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent db110a9
History
Tip revision: 70effdc3756c924f4a2b6af1ec4e2e92e18e1b45 authored by Andrey Konovalov on 26 February 2022, 03:10:59 UTC
kasan: test: prevent cache merging in kmem_cache_double_destroy
Tip revision: 70effdc
File Mode Size
.gitignore -rw-r--r-- 99 bytes
Kconfig -rw-r--r-- 4.8 KB
Makefile -rw-r--r-- 3.2 KB
blacklist.c -rw-r--r-- 5.7 KB
blacklist.h -rw-r--r-- 135 bytes
blacklist_hashes.c -rw-r--r-- 166 bytes
blacklist_nohashes.c -rw-r--r-- 122 bytes
common.c -rw-r--r-- 1.2 KB
common.h -rw-r--r-- 216 bytes
default_x509.genkey -rw-r--r-- 407 bytes
extract-cert.c -rw-r--r-- 3.5 KB
revocation_certificates.S -rw-r--r-- 495 bytes
system_certificates.S -rw-r--r-- 1.1 KB
system_keyring.c -rw-r--r-- 8.5 KB

back to top