kfence: move saving stack trace of allocations into __kfence_alloc()
authorMarco Elver <elver@google.com>
Fri, 5 Nov 2021 20:45:31 +0000 (13:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:59:00 +0000 (20:59 +0200)
commit44b44b64b4da9edbbfff52872a5b0c10acda54aa
tree19f81047f0db12a490072a2b0a9615f67d740a81
parent72d2d94a981d79703ee9e9073360464174db2ad7
kfence: move saving stack trace of allocations into __kfence_alloc()

[ Upstream commit a9ab52bbcb52df49ec4b30e6741e120588989455 ]

Move the saving of the stack trace of allocations into __kfence_alloc(),
so that the stack entries array can be used outside of
kfence_guarded_alloc() and we avoid potentially unwinding the stack
multiple times.

Link: https://lkml.kernel.org/r/20210923104803.2620285-3-elver@google.com
Signed-off-by: Marco Elver <elver@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Alexander Potapenko <glider@google.com>
Cc: Aleksandr Nogikh <nogikh@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Taras Madan <tarasmadan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
mm/kfence/core.c