linux/mm/kasan
Marco Elver 452c03fdbe kasan: add support for kasan.fault=panic_on_write
KASAN's boot time kernel parameter 'kasan.fault=' currently supports
'report' and 'panic', which results in either only reporting bugs or also
panicking on reports.

However, some users may wish to have more control over when KASAN reports
result in a kernel panic: in particular, KASAN reported invalid _writes_
are of special interest, because they have greater potential to corrupt
random kernel memory or be more easily exploited.

To panic on invalid writes only, introduce 'kasan.fault=panic_on_write',
which allows users to choose to continue running on invalid reads, but
panic only on invalid writes.

Link: https://lkml.kernel.org/r/20230614095158.1133673-1-elver@google.com
Signed-off-by: Marco Elver <elver@google.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Cc: Aleksandr Nogikh <nogikh@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Taras Madan <tarasmadan@google.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-06-19 16:19:33 -07:00
..
common.c kasan: use internal prototypes matching gcc-13 builtins 2023-06-09 16:25:19 -07:00
generic.c kasan: use internal prototypes matching gcc-13 builtins 2023-06-09 16:25:19 -07:00
hw_tags.c kasan: hw_tags: avoid invalid virt_to_page() 2023-05-02 17:23:27 -07:00
init.c mm: ptep_get() conversion 2023-06-19 16:19:25 -07:00
kasan_test_module.c kasan: migrate workqueue_uaf test to kunit 2022-11-08 17:37:14 -08:00
kasan_test.c printk: export console trace point for kcsan/kasan/kfence/kmsan 2023-04-18 16:30:11 -07:00
kasan.h kasan: use internal prototypes matching gcc-13 builtins 2023-06-09 16:25:19 -07:00
Makefile kasan: test: fix test for new meminstrinsic instrumentation 2023-03-02 21:54:22 -08:00
quarantine.c kasan: fix lockdep report invalid wait context 2023-04-21 14:51:59 -07:00
report_generic.c kasan: use internal prototypes matching gcc-13 builtins 2023-06-09 16:25:19 -07: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: infer allocation size by scanning metadata 2023-02-09 16:51:40 -08:00
report.c kasan: add support for kasan.fault=panic_on_write 2023-06-19 16:19:33 -07:00
shadow.c mm: ptep_get() conversion 2023-06-19 16:19:25 -07:00
sw_tags.c kasan: use internal prototypes matching gcc-13 builtins 2023-06-09 16:25:19 -07:00
tags.c kasan: dynamically allocate stack ring entries 2022-10-03 14:03:02 -07:00