Hay
Date
June 5, 2025, 7:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   28.774571] ==================================================================
[   28.774700] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   28.774819] Read of size 1 at addr fff00000c770c050 by task kunit_try_catch/259
[   28.774949] 
[   28.775028] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT 
[   28.775866] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.776034] Hardware name: linux,dummy-virt (DT)
[   28.776107] Call trace:
[   28.776141]  show_stack+0x20/0x38 (C)
[   28.776218]  dump_stack_lvl+0x8c/0xd0
[   28.776358]  print_report+0x118/0x608
[   28.776695]  kasan_report+0xdc/0x128
[   28.776821]  __asan_report_load1_noabort+0x20/0x30
[   28.776971]  strcmp+0xc0/0xc8
[   28.777124]  kasan_strings+0x340/0xb00
[   28.777504]  kunit_try_run_case+0x170/0x3f0
[   28.777646]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   28.778154]  kthread+0x328/0x630
[   28.778295]  ret_from_fork+0x10/0x20
[   28.779178] 
[   28.779268] Allocated by task 259:
[   28.779594]  kasan_save_stack+0x3c/0x68
[   28.779927]  kasan_save_track+0x20/0x40
[   28.780068]  kasan_save_alloc_info+0x40/0x58
[   28.780187]  __kasan_kmalloc+0xd4/0xd8
[   28.780785]  __kmalloc_cache_noprof+0x16c/0x3c0
[   28.780896]  kasan_strings+0xc8/0xb00
[   28.780959]  kunit_try_run_case+0x170/0x3f0
[   28.781011]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   28.781111]  kthread+0x328/0x630
[   28.781221]  ret_from_fork+0x10/0x20
[   28.781355] 
[   28.781468] Freed by task 259:
[   28.781645]  kasan_save_stack+0x3c/0x68
[   28.781752]  kasan_save_track+0x20/0x40
[   28.781855]  kasan_save_free_info+0x4c/0x78
[   28.782278]  __kasan_slab_free+0x6c/0x98
[   28.782463]  kfree+0x214/0x3c8
[   28.782581]  kasan_strings+0x24c/0xb00
[   28.782765]  kunit_try_run_case+0x170/0x3f0
[   28.782885]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   28.783005]  kthread+0x328/0x630
[   28.783117]  ret_from_fork+0x10/0x20
[   28.783217] 
[   28.783272] The buggy address belongs to the object at fff00000c770c040
[   28.783272]  which belongs to the cache kmalloc-32 of size 32
[   28.783461] The buggy address is located 16 bytes inside of
[   28.783461]  freed 32-byte region [fff00000c770c040, fff00000c770c060)
[   28.783652] 
[   28.783705] The buggy address belongs to the physical page:
[   28.783790] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10770c
[   28.783950] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   28.784278] page_type: f5(slab)
[   28.785115] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   28.785255] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   28.787544] page dumped because: kasan: bad access detected
[   28.790505] 
[   28.790567] Memory state around the buggy address:
[   28.790649]  fff00000c770bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.790762]  fff00000c770bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.790886] >fff00000c770c000: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   28.790989]                                                  ^
[   28.791085]  fff00000c770c080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   28.791196]  fff00000c770c100: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   28.791297] ==================================================================


[   13.318882] ==================================================================
[   13.319941] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   13.320424] Read of size 1 at addr ffff88810278df50 by task kunit_try_catch/276
[   13.320775] 
[   13.320873] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT(voluntary) 
[   13.320935] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.320947] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.320969] Call Trace:
[   13.320979]  <TASK>
[   13.320995]  dump_stack_lvl+0x73/0xb0
[   13.321020]  print_report+0xd1/0x650
[   13.321105]  ? __virt_addr_valid+0x1db/0x2d0
[   13.321132]  ? strcmp+0xb0/0xc0
[   13.321150]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.321174]  ? strcmp+0xb0/0xc0
[   13.321193]  kasan_report+0x141/0x180
[   13.321215]  ? strcmp+0xb0/0xc0
[   13.321237]  __asan_report_load1_noabort+0x18/0x20
[   13.321262]  strcmp+0xb0/0xc0
[   13.321281]  kasan_strings+0x431/0xe80
[   13.321300]  ? trace_hardirqs_on+0x37/0xe0
[   13.321324]  ? __pfx_kasan_strings+0x10/0x10
[   13.321344]  ? finish_task_switch.isra.0+0x153/0x700
[   13.321366]  ? __switch_to+0x47/0xf50
[   13.321392]  ? __schedule+0x10cc/0x2b60
[   13.321415]  ? __pfx_read_tsc+0x10/0x10
[   13.321436]  ? ktime_get_ts64+0x86/0x230
[   13.321460]  kunit_try_run_case+0x1a5/0x480
[   13.321482]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.321501]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.321526]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.321550]  ? __kthread_parkme+0x82/0x180
[   13.321570]  ? preempt_count_sub+0x50/0x80
[   13.321592]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.321614]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.321638]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.321663]  kthread+0x337/0x6f0
[   13.321682]  ? trace_preempt_on+0x20/0xc0
[   13.321712]  ? __pfx_kthread+0x10/0x10
[   13.321731]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.321754]  ? calculate_sigpending+0x7b/0xa0
[   13.321777]  ? __pfx_kthread+0x10/0x10
[   13.321798]  ret_from_fork+0x116/0x1d0
[   13.321816]  ? __pfx_kthread+0x10/0x10
[   13.321836]  ret_from_fork_asm+0x1a/0x30
[   13.321866]  </TASK>
[   13.321877] 
[   13.329912] Allocated by task 276:
[   13.330134]  kasan_save_stack+0x45/0x70
[   13.330342]  kasan_save_track+0x18/0x40
[   13.330515]  kasan_save_alloc_info+0x3b/0x50
[   13.330682]  __kasan_kmalloc+0xb7/0xc0
[   13.330880]  __kmalloc_cache_noprof+0x189/0x420
[   13.331303]  kasan_strings+0xc0/0xe80
[   13.331479]  kunit_try_run_case+0x1a5/0x480
[   13.331689]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.331873]  kthread+0x337/0x6f0
[   13.332166]  ret_from_fork+0x116/0x1d0
[   13.332354]  ret_from_fork_asm+0x1a/0x30
[   13.332680] 
[   13.332764] Freed by task 276:
[   13.332875]  kasan_save_stack+0x45/0x70
[   13.333192]  kasan_save_track+0x18/0x40
[   13.333437]  kasan_save_free_info+0x3f/0x60
[   13.333617]  __kasan_slab_free+0x56/0x70
[   13.333788]  kfree+0x222/0x3f0
[   13.333968]  kasan_strings+0x2aa/0xe80
[   13.334122]  kunit_try_run_case+0x1a5/0x480
[   13.334330]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.334532]  kthread+0x337/0x6f0
[   13.334650]  ret_from_fork+0x116/0x1d0
[   13.334782]  ret_from_fork_asm+0x1a/0x30
[   13.334928] 
[   13.334998] The buggy address belongs to the object at ffff88810278df40
[   13.334998]  which belongs to the cache kmalloc-32 of size 32
[   13.335449] The buggy address is located 16 bytes inside of
[   13.335449]  freed 32-byte region [ffff88810278df40, ffff88810278df60)
[   13.336513] 
[   13.336589] The buggy address belongs to the physical page:
[   13.336760] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10278d
[   13.337014] flags: 0x200000000000000(node=0|zone=2)
[   13.337180] page_type: f5(slab)
[   13.337395] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.337907] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   13.338323] page dumped because: kasan: bad access detected
[   13.338575] 
[   13.338707] Memory state around the buggy address:
[   13.339158]  ffff88810278de00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.339403]  ffff88810278de80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.339777] >ffff88810278df00: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.340004]                                                  ^
[   13.340522]  ffff88810278df80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.340871]  ffff88810278e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   13.341242] ==================================================================