LEFT | RIGHT |
1 #ifndef __MM_KASAN_KASAN_H | 1 #ifndef __MM_KASAN_KASAN_H |
2 #define __MM_KASAN_KASAN_H | 2 #define __MM_KASAN_KASAN_H |
3 | 3 |
4 #include <linux/kasan.h> | 4 #include <linux/kasan.h> |
5 #include <linux/stackdepot.h> | 5 #include <linux/stackdepot.h> |
6 | 6 |
7 #define KASAN_SHADOW_SCALE_SIZE (1UL << KASAN_SHADOW_SCALE_SHIFT) | 7 #define KASAN_SHADOW_SCALE_SIZE (1UL << KASAN_SHADOW_SCALE_SHIFT) |
8 #define KASAN_SHADOW_MASK (KASAN_SHADOW_SCALE_SIZE - 1) | 8 #define KASAN_SHADOW_MASK (KASAN_SHADOW_SCALE_SIZE - 1) |
9 | 9 |
10 #define KASAN_FREE_PAGE 0xFF /* page was freed */ | 10 #define KASAN_FREE_PAGE 0xFF /* page was freed */ |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 static inline bool kasan_pshadow_inited(void) { return true; } | 102 static inline bool kasan_pshadow_inited(void) { return true; } |
103 | 103 |
104 #else | 104 #else |
105 static inline void arch_kasan_map_shadow(unsigned long s, unsigned long e) { } | 105 static inline void arch_kasan_map_shadow(unsigned long s, unsigned long e) { } |
106 static inline bool arch_kasan_recheck_prepare(unsigned long addr, | 106 static inline bool arch_kasan_recheck_prepare(unsigned long addr, |
107 size_t size) { return false; } | 107 size_t size) { return false; } |
108 static inline bool kasan_pshadow_inited(void) { return false; } | 108 static inline bool kasan_pshadow_inited(void) { return false; } |
109 #endif | 109 #endif |
110 | 110 |
| 111 void __kasan_report(unsigned long addr, size_t size, |
| 112 bool is_write, unsigned long ip); |
111 void kasan_report(unsigned long addr, size_t size, | 113 void kasan_report(unsigned long addr, size_t size, |
112 bool is_write, unsigned long ip); | 114 bool is_write, unsigned long ip); |
113 void kasan_report_double_free(struct kmem_cache *cache, void *object, | 115 void kasan_report_double_free(struct kmem_cache *cache, void *object, |
114 void *ip); | 116 void *ip); |
115 | 117 |
116 #if defined(CONFIG_SLAB) || defined(CONFIG_SLUB) | 118 #if defined(CONFIG_SLAB) || defined(CONFIG_SLUB) |
117 void quarantine_put(struct kasan_free_meta *info, struct kmem_cache *cache); | 119 void quarantine_put(struct kasan_free_meta *info, struct kmem_cache *cache); |
118 void quarantine_reduce(void); | 120 void quarantine_reduce(void); |
119 void quarantine_remove_cache(struct kmem_cache *cache); | 121 void quarantine_remove_cache(struct kmem_cache *cache); |
120 #else | 122 #else |
121 static inline void quarantine_put(struct kasan_free_meta *info, | 123 static inline void quarantine_put(struct kasan_free_meta *info, |
122 struct kmem_cache *cache) { } | 124 struct kmem_cache *cache) { } |
123 static inline void quarantine_reduce(void) { } | 125 static inline void quarantine_reduce(void) { } |
124 static inline void quarantine_remove_cache(struct kmem_cache *cache) { } | 126 static inline void quarantine_remove_cache(struct kmem_cache *cache) { } |
125 #endif | 127 #endif |
126 | 128 |
127 #endif | 129 #endif |
LEFT | RIGHT |