]> www.infradead.org Git - users/jedix/linux-maple.git/commit
kasan: remove atomic accesses to stack ring entries
authorAndrey Konovalov <andreyknvl@google.com>
Mon, 20 Nov 2023 17:47:16 +0000 (18:47 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 20 Nov 2023 21:16:40 +0000 (13:16 -0800)
commitd84ad3d0fcaac96403d5b70c1c93971dcda44df7
tree7eff0eb77458825ec2230aed4c065033c72c0b1b
parent3294e8cca84702d02e0bf31cc23d4b8462a4e352
kasan: remove atomic accesses to stack ring entries

Remove the atomic accesses to entry fields in save_stack_info and
kasan_complete_mode_report_info for tag-based KASAN modes.

These atomics are not required, as the read/write lock prevents the
entries from being read (in kasan_complete_mode_report_info) while being
written (in save_stack_info) and the try_cmpxchg prevents the same entry
from being rewritten (in save_stack_info) in the unlikely case of wrapping
during writing.

Link: https://lkml.kernel.org/r/29f59126d9845c5257b6c29cd7ad113b16f19f47.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/report_tags.c
mm/kasan/tags.c