Message ID | 7f8dfeeb13b54f9518f78d9c8550a3769d144fc3.1550596242.git.christophe.leroy@c-s.fr (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | KASAN for powerpc/32 | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | warning | next/apply_patch Patch failed to apply |
snowpatch_ozlabs/apply_patch | fail | Failed to apply to any branch |
diff --git a/include/linux/kasan.h b/include/linux/kasan.h index b40ea104dd36..b91c40af9f31 100644 --- a/include/linux/kasan.h +++ b/include/linux/kasan.h @@ -14,6 +14,10 @@ struct task_struct; #include <asm/kasan.h> #include <asm/pgtable.h> +#ifndef kasan_arch_is_ready +static inline bool kasan_arch_is_ready(void) { return true; } +#endif + extern unsigned char kasan_early_shadow_page[PAGE_SIZE]; extern pte_t kasan_early_shadow_pte[PTRS_PER_PTE]; extern pmd_t kasan_early_shadow_pmd[PTRS_PER_PMD]; diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c index ccb6207276e3..696c2f5b902b 100644 --- a/mm/kasan/generic.c +++ b/mm/kasan/generic.c @@ -170,6 +170,9 @@ static __always_inline void check_memory_region_inline(unsigned long addr, size_t size, bool write, unsigned long ret_ip) { + if (!kasan_arch_is_ready()) + return; + if (unlikely(size == 0)) return;