File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ SYM_FUNC_START(_cpu_resume)
133133 * /
134134 bl cpu_do_resume
135135
136- #ifdef CONFIG_KASAN
136+ #if defined( CONFIG_KASAN) && CONFIG_KASAN_STACK
137137 mov x0 , sp
138138 bl kasan_unpoison_task_stack_below
139139#endif
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ SYM_FUNC_START(do_suspend_lowlevel)
112112 movq pt_regs_r14(%rax ), %r14
113113 movq pt_regs_r15(%rax ), %r15
114114
115- #ifdef CONFIG_KASAN
115+ #if defined( CONFIG_KASAN) && CONFIG_KASAN_STACK
116116 /*
117117 * The suspend path may have poisoned some areas deeper in the stack,
118118 * which we now need to unpoison.
Original file line number Diff line number Diff line change @@ -77,8 +77,6 @@ static inline void kasan_disable_current(void) {}
7777
7878void kasan_unpoison_range (const void * address , size_t size );
7979
80- void kasan_unpoison_task_stack (struct task_struct * task );
81-
8280void kasan_alloc_pages (struct page * page , unsigned int order );
8381void kasan_free_pages (struct page * page , unsigned int order );
8482
@@ -123,8 +121,6 @@ void kasan_restore_multi_shot(bool enabled);
123121
124122static inline void kasan_unpoison_range (const void * address , size_t size ) {}
125123
126- static inline void kasan_unpoison_task_stack (struct task_struct * task ) {}
127-
128124static inline void kasan_alloc_pages (struct page * page , unsigned int order ) {}
129125static inline void kasan_free_pages (struct page * page , unsigned int order ) {}
130126
@@ -176,6 +172,12 @@ static inline size_t kasan_metadata_size(struct kmem_cache *cache) { return 0; }
176172
177173#endif /* CONFIG_KASAN */
178174
175+ #if defined(CONFIG_KASAN ) && CONFIG_KASAN_STACK
176+ void kasan_unpoison_task_stack (struct task_struct * task );
177+ #else
178+ static inline void kasan_unpoison_task_stack (struct task_struct * task ) {}
179+ #endif
180+
179181#ifdef CONFIG_KASAN_GENERIC
180182
181183void kasan_cache_shrink (struct kmem_cache * cache );
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ void kasan_unpoison_range(const void *address, size_t size)
6363 unpoison_range (address , size );
6464}
6565
66+ #if CONFIG_KASAN_STACK
6667static void __kasan_unpoison_stack (struct task_struct * task , const void * sp )
6768{
6869 void * base = task_stack_page (task );
@@ -89,6 +90,7 @@ asmlinkage void kasan_unpoison_task_stack_below(const void *watermark)
8990
9091 unpoison_range (base , watermark - base );
9192}
93+ #endif /* CONFIG_KASAN_STACK */
9294
9395void kasan_alloc_pages (struct page * page , unsigned int order )
9496{
You can’t perform that action at this time.
0 commit comments