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)
133
133
* /
134
134
bl cpu_do_resume
135
135
136
- #ifdef CONFIG_KASAN
136
+ #if defined( CONFIG_KASAN) && CONFIG_KASAN_STACK
137
137
mov x0 , sp
138
138
bl kasan_unpoison_task_stack_below
139
139
#endif
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ SYM_FUNC_START(do_suspend_lowlevel)
112
112
movq pt_regs_r14(%rax ), %r14
113
113
movq pt_regs_r15(%rax ), %r15
114
114
115
- #ifdef CONFIG_KASAN
115
+ #if defined( CONFIG_KASAN) && CONFIG_KASAN_STACK
116
116
/*
117
117
* The suspend path may have poisoned some areas deeper in the stack,
118
118
* 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) {}
77
77
78
78
void kasan_unpoison_range (const void * address , size_t size );
79
79
80
- void kasan_unpoison_task_stack (struct task_struct * task );
81
-
82
80
void kasan_alloc_pages (struct page * page , unsigned int order );
83
81
void kasan_free_pages (struct page * page , unsigned int order );
84
82
@@ -123,8 +121,6 @@ void kasan_restore_multi_shot(bool enabled);
123
121
124
122
static inline void kasan_unpoison_range (const void * address , size_t size ) {}
125
123
126
- static inline void kasan_unpoison_task_stack (struct task_struct * task ) {}
127
-
128
124
static inline void kasan_alloc_pages (struct page * page , unsigned int order ) {}
129
125
static inline void kasan_free_pages (struct page * page , unsigned int order ) {}
130
126
@@ -176,6 +172,12 @@ static inline size_t kasan_metadata_size(struct kmem_cache *cache) { return 0; }
176
172
177
173
#endif /* CONFIG_KASAN */
178
174
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
+
179
181
#ifdef CONFIG_KASAN_GENERIC
180
182
181
183
void 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)
63
63
unpoison_range (address , size );
64
64
}
65
65
66
+ #if CONFIG_KASAN_STACK
66
67
static void __kasan_unpoison_stack (struct task_struct * task , const void * sp )
67
68
{
68
69
void * base = task_stack_page (task );
@@ -89,6 +90,7 @@ asmlinkage void kasan_unpoison_task_stack_below(const void *watermark)
89
90
90
91
unpoison_range (base , watermark - base );
91
92
}
93
+ #endif /* CONFIG_KASAN_STACK */
92
94
93
95
void kasan_alloc_pages (struct page * page , unsigned int order )
94
96
{
You can’t perform that action at this time.
0 commit comments