linux/mm/kasan
Jared Kangas e30a0361b8 kasan: make report_lock a raw spinlock
If PREEMPT_RT is enabled, report_lock is a sleeping spinlock and must not
be locked when IRQs are disabled.  However, KASAN reports may be triggered
in such contexts.  For example:

        char *s = kzalloc(1, GFP_KERNEL);
        kfree(s);
        local_irq_disable();
        char c = *s;  /* KASAN report here leads to spin_lock() */
        local_irq_enable();

Make report_spinlock a raw spinlock to prevent rescheduling when
PREEMPT_RT is enabled.

Link: https://lkml.kernel.org/r/20241119210234.1602529-1-jkangas@redhat.com
Fixes: 342a93247e ("locking/spinlock: Provide RT variant header: <linux/spinlock_rt.h>")
Signed-off-by: Jared Kangas <jkangas@redhat.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-12-05 19:54:43 -08:00
..
common.c slub: Introduce CONFIG_SLUB_RCU_DEBUG 2024-08-27 14:12:51 +02:00
generic.c mm/kasan: Don't store metadata inside kmalloc object when slub_debug_orig_size is on 2024-10-29 10:43:23 +01:00
hw_tags.c kasan: use EXPORT_SYMBOL_IF_KUNIT to export symbols 2024-11-11 13:09:43 -08:00
init.c mm: define general function pXd_init() 2024-11-11 17:22:27 -08:00
kasan_test_c.c kasan: add kunit tests for kmalloc_track_caller, kmalloc_node_track_caller 2024-11-11 17:22:25 -08:00
kasan_test_rust.rs rust: treewide: switch to the kernel Vec type 2024-10-15 23:10:32 +02:00
kasan.h kasan: delete CONFIG_KASAN_MODULE_TEST 2024-11-11 00:26:44 -08:00
Makefile kasan: migrate copy_user_test to kunit 2024-11-11 00:26:44 -08:00
quarantine.c kasan: revert eviction of stack traces in generic mode 2024-02-23 17:27:12 -08:00
report_generic.c kasan: stop leaking stack trace handles 2024-01-05 10:17:45 -08:00
report_hw_tags.c kasan: use internal prototypes matching gcc-13 builtins 2023-06-09 16:25:19 -07:00
report_sw_tags.c kasan: use internal prototypes matching gcc-13 builtins 2023-06-09 16:25:19 -07:00
report_tags.c kasan: simplify kasan_complete_mode_report_info for tag-based modes 2023-12-29 11:58:47 -08:00
report.c kasan: make report_lock a raw spinlock 2024-12-05 19:54:43 -08:00
shadow.c mm/vmalloc: combine all TLB flush operations of KASAN shadow virtual address into one operation 2024-11-05 16:56:21 -08:00
sw_tags.c kasan: use internal prototypes matching gcc-13 builtins 2023-06-09 16:25:19 -07:00
tags.c kasan: simplify saving extra info into tracks 2023-12-29 11:58:46 -08:00