Skip to content

Commit 7ccb84f

Browse files
kkdwivediAlexei Starovoitov
authored andcommitted
mm: kasan: Declare kasan_unpoison_task_stack_below in kasan.h
We require access to this kasan helper in BPF code in the next patch where we have to unpoison the task stack when we unwind and reset the stack frame from bpf_throw, and it never really unpoisons the poisoned stack slots on entry when compiler instrumentation is generated by CONFIG_KASAN_STACK and inline instrumentation is supported. Also, remove the declaration from mm/kasan/kasan.h as we put it in the header file kasan.h. Cc: Andrey Ryabinin <[email protected]> Cc: Alexander Potapenko <[email protected]> Cc: Andrey Konovalov <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Vincenzo Frascino <[email protected]> Suggested-by: Andrey Konovalov <[email protected]> Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]> Reviewed-by: Andrey Konovalov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent a923819 commit 7ccb84f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

include/linux/kasan.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,10 @@ static inline bool kasan_check_byte(const void *address)
283283

284284
#if defined(CONFIG_KASAN) && defined(CONFIG_KASAN_STACK)
285285
void kasan_unpoison_task_stack(struct task_struct *task);
286+
asmlinkage void kasan_unpoison_task_stack_below(const void *watermark);
286287
#else
287288
static inline void kasan_unpoison_task_stack(struct task_struct *task) {}
289+
static inline void kasan_unpoison_task_stack_below(const void *watermark) {}
288290
#endif
289291

290292
#ifdef CONFIG_KASAN_GENERIC

mm/kasan/kasan.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,6 @@ void kasan_restore_multi_shot(bool enabled);
558558
* code. Declared here to avoid warnings about missing declarations.
559559
*/
560560

561-
asmlinkage void kasan_unpoison_task_stack_below(const void *watermark);
562561
void __asan_register_globals(void *globals, ssize_t size);
563562
void __asan_unregister_globals(void *globals, ssize_t size);
564563
void __asan_handle_no_return(void);

0 commit comments

Comments
 (0)