linux-stable/mm/kasan
Yeoreum Yun 2616a517f9 kunit: kasan_test: disable fortify string checker on kasan_strings() test
commit 7a19afee6f upstream.

Similar to commit 09c6304e38 ("kasan: test: fix compatibility with
FORTIFY_SOURCE") the kernel is panicing in kasan_string().

This is due to the `src` and `ptr` not being hidden from the optimizer
which would disable the runtime fortify string checker.

Call trace:
  __fortify_panic+0x10/0x20 (P)
  kasan_strings+0x980/0x9b0
  kunit_try_run_case+0x68/0x190
  kunit_generic_run_threadfn_adapter+0x34/0x68
  kthread+0x1c4/0x228
  ret_from_fork+0x10/0x20
 Code: d503233f a9bf7bfd 910003fd 9424b243 (d4210000)
 ---[ end trace 0000000000000000 ]---
 note: kunit_try_catch[128] exited with irqs disabled
 note: kunit_try_catch[128] exited with preempt_count 1
     # kasan_strings: try faulted: last
** replaying previous printk message **
     # kasan_strings: try faulted: last line seen mm/kasan/kasan_test_c.c:1600
     # kasan_strings: internal error occurred preventing test case from running: -4

Link: https://lkml.kernel.org/r/20250801120236.2962642-1-yeoreum.yun@arm.com
Fixes: 73228c7ecc ("KASAN: port KASAN Tests to KUnit")
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitriy 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-09 19:02:30 +02:00
..
common.c
generic.c
hw_tags.c
init.c mm: introduce and use {pgd,p4d}_populate_kernel() 2025-09-09 19:02:30 +02:00
kasan_test_c.c kunit: kasan_test: disable fortify string checker on kasan_strings() test 2025-09-09 19:02:30 +02:00
kasan_test_rust.rs
kasan.h
Makefile kbuild: Switch from -Wvla to -Wvla-larger-than=1 2025-05-08 09:42:06 -07:00
quarantine.c
report_generic.c
report_hw_tags.c
report_sw_tags.c
report_tags.c
report.c kasan: use vmalloc_dump_obj() for vmalloc error reports 2025-07-19 19:26:17 -07:00
shadow.c kasan: avoid sleepable page allocation from atomic context 2025-05-20 22:49:40 -07:00
sw_tags.c
tags.c