]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kasan: use stack_depot_put for tag-based modes
authorAndrey Konovalov <andreyknvl@google.com>
Mon, 20 Nov 2023 17:47:18 +0000 (18:47 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 20 Nov 2023 21:16:41 +0000 (13:16 -0800)
commit882f84db7515237e78561faa6d3b3e7404f0db51
tree4b3a97e8182e5f825757a8a0765c0059ea369423
parente9e7ccbfe837ebc9a9fd4e8e2a25ef27d3e78e88
kasan: use stack_depot_put for tag-based modes

Make tag-based KASAN modes evict stack traces from the stack depot once
they are evicted from the stack ring.

Internally, pass STACK_DEPOT_FLAG_GET to stack_depot_save_flags (via
kasan_save_stack) to increment the refcount when saving a new entry to
stack ring and call stack_depot_put when removing an entry from stack
ring.

Link: https://lkml.kernel.org/r/b4773e5c1b0b9df6826ec0b65c1923feadfa78e5.1700502145.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Evgenii Stepanov <eugenis@google.com>
Cc: Marco Elver <elver@google.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kasan/tags.c