diff options
author | Andrey Ryabinin <ryabinin.a.a@gmail.com> | 2015-08-11 05:18:15 +0300 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-14 13:49:37 +0900 |
commit | d4ab6b3a608d74edc053b531f527101ff6291653 (patch) | |
tree | 607686cadf9ea01ea59573a8b9eb7447434531ee /include | |
parent | e7663bbd7fa92fad65f858643e17bd3ac3f7b853 (diff) |
x86/kasan, mm: introduce generic kasan_populate_zero_shadow()
Introduce generic kasan_populate_zero_shadow(shadow_start, shadow_end).
This function maps kasan_zero_page to the [shadow_start, shadow_end]
addresses.
This replaces x86_64 specific populate_zero_shadow() and will
be used for ARM64 in follow on patches.
Signed-off-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/kasan.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/kasan.h b/include/linux/kasan.h index 6fb1c7d4292c..4b9f85c963d0 100644 --- a/include/linux/kasan.h +++ b/include/linux/kasan.h @@ -12,8 +12,17 @@ struct vm_struct; #define KASAN_SHADOW_SCALE_SHIFT 3 #include <asm/kasan.h> +#include <asm/pgtable.h> #include <linux/sched.h> +extern unsigned char kasan_zero_page[PAGE_SIZE]; +extern pte_t kasan_zero_pte[PTRS_PER_PTE]; +extern pmd_t kasan_zero_pmd[PTRS_PER_PMD]; +extern pud_t kasan_zero_pud[PTRS_PER_PUD]; + +void kasan_populate_zero_shadow(const void *shadow_start, + const void *shadow_end); + static inline void *kasan_mem_to_shadow(const void *addr) { return (void *)((unsigned long)addr >> KASAN_SHADOW_SCALE_SHIFT) |