mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
kasan, arm64: only use kasan_depth for software modes
This is a preparatory commit for the upcoming addition of a new hardware tag-based (MTE-based) KASAN mode. Hardware tag-based KASAN won't use kasan_depth. Only define and use it when one of the software KASAN modes are enabled. No functional changes for software modes. Link: https://lkml.kernel.org/r/e16f15aeda90bc7fb4dfc2e243a14b74cc5c8219.1606161801.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Alexander Potapenko <glider@google.com> Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com> Cc: Branislav Rankov <Branislav.Rankov@arm.com> Cc: Dmitry Vyukov <dvyukov@google.com> Cc: Evgenii Stepanov <eugenis@google.com> Cc: Kevin Brodsky <kevin.brodsky@arm.com> Cc: Marco Elver <elver@google.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
afe6ef80dc
commit
d73b49365e
@@ -52,6 +52,12 @@ static inline void *kasan_mem_to_shadow(const void *addr)
|
||||
int kasan_add_zero_shadow(void *start, unsigned long size);
|
||||
void kasan_remove_zero_shadow(void *start, unsigned long size);
|
||||
|
||||
/* Enable reporting bugs after kasan_disable_current() */
|
||||
extern void kasan_enable_current(void);
|
||||
|
||||
/* Disable reporting bugs for current task */
|
||||
extern void kasan_disable_current(void);
|
||||
|
||||
#else /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */
|
||||
|
||||
static inline int kasan_add_zero_shadow(void *start, unsigned long size)
|
||||
@@ -62,16 +68,13 @@ static inline void kasan_remove_zero_shadow(void *start,
|
||||
unsigned long size)
|
||||
{}
|
||||
|
||||
static inline void kasan_enable_current(void) {}
|
||||
static inline void kasan_disable_current(void) {}
|
||||
|
||||
#endif /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */
|
||||
|
||||
#ifdef CONFIG_KASAN
|
||||
|
||||
/* Enable reporting bugs after kasan_disable_current() */
|
||||
extern void kasan_enable_current(void);
|
||||
|
||||
/* Disable reporting bugs for current task */
|
||||
extern void kasan_disable_current(void);
|
||||
|
||||
void kasan_unpoison_range(const void *address, size_t size);
|
||||
|
||||
void kasan_unpoison_task_stack(struct task_struct *task);
|
||||
@@ -122,9 +125,6 @@ static inline void kasan_unpoison_range(const void *address, size_t size) {}
|
||||
|
||||
static inline void kasan_unpoison_task_stack(struct task_struct *task) {}
|
||||
|
||||
static inline void kasan_enable_current(void) {}
|
||||
static inline void kasan_disable_current(void) {}
|
||||
|
||||
static inline void kasan_alloc_pages(struct page *page, unsigned int order) {}
|
||||
static inline void kasan_free_pages(struct page *page, unsigned int order) {}
|
||||
|
||||
|
Reference in New Issue
Block a user