mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
UPSTREAM: kasan: remove __kasan_unpoison_stack
[ Upstream commit 77f57c9830 ]
There's no need for __kasan_unpoison_stack() helper, as it's only
currently used in a single place. Removing it also removes unneeded
arithmetic.
No functional changes.
Link: https://lkml.kernel.org/r/93e78948704a42ea92f6248ff8a725613d721161.1606162397.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Marco Elver <elver@google.com>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Branislav Rankov <Branislav.Rankov@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Bug: 172318110
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Change-Id: I2e9435e4517ad3c6600f18a2da7c29f00b889706
This commit is contained in:
committed by
Alistair Delva
parent
f3a6301925
commit
9655455b9e
@@ -64,18 +64,12 @@ void kasan_unpoison_range(const void *address, size_t size)
|
||||
}
|
||||
|
||||
#if CONFIG_KASAN_STACK
|
||||
static void __kasan_unpoison_stack(struct task_struct *task, const void *sp)
|
||||
{
|
||||
void *base = task_stack_page(task);
|
||||
size_t size = sp - base;
|
||||
|
||||
unpoison_range(base, size);
|
||||
}
|
||||
|
||||
/* Unpoison the entire stack for a task. */
|
||||
void kasan_unpoison_task_stack(struct task_struct *task)
|
||||
{
|
||||
__kasan_unpoison_stack(task, task_stack_page(task) + THREAD_SIZE);
|
||||
void *base = task_stack_page(task);
|
||||
|
||||
unpoison_range(base, THREAD_SIZE);
|
||||
}
|
||||
|
||||
/* Unpoison the stack for the current task beyond a watermark sp value. */
|
||||
|
||||
Reference in New Issue
Block a user