UPSTREAM: kasan: only define metadata offsets for Generic mode

Hide the definitions of alloc_meta_offset and free_meta_offset under an
ifdef CONFIG_KASAN_GENERIC check, as these fields are now only used when
the Generic mode is enabled.

Link: https://lkml.kernel.org/r/d4bafa0534facafd1a23c465a94261e64f366493.1662411799.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Marco Elver <elver@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Peter Collingbourne <pcc@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Bug: 254721825
(cherry picked from commit 26f21f3ac7)
Change-Id: Id8146e8f74b545c42f3cdffcf4a2dbaa0b11eaa4
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
This commit is contained in:
Andrey Konovalov
2022-09-05 23:05:31 +02:00
parent 38fb2e4190
commit 9c83df526f

View File

@@ -91,8 +91,10 @@ static inline bool kasan_has_integrated_init(void)
#ifdef CONFIG_KASAN
struct kasan_cache {
#ifdef CONFIG_KASAN_GENERIC
int alloc_meta_offset;
int free_meta_offset;
#endif
bool is_kmalloc;
};