Hay
Date
July 6, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   20.482597] ==================================================================
[   20.482773] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   20.482978] Read of size 1 at addr fff00000c56d5090 by task kunit_try_catch/259
[   20.483263] 
[   20.483314] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   20.483403] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.483459] Hardware name: linux,dummy-virt (DT)
[   20.483502] Call trace:
[   20.483536]  show_stack+0x20/0x38 (C)
[   20.483591]  dump_stack_lvl+0x8c/0xd0
[   20.483641]  print_report+0x118/0x608
[   20.483691]  kasan_report+0xdc/0x128
[   20.483739]  __asan_report_load1_noabort+0x20/0x30
[   20.483801]  strcmp+0xc0/0xc8
[   20.483847]  kasan_strings+0x340/0xb00
[   20.483894]  kunit_try_run_case+0x170/0x3f0
[   20.483945]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.483999]  kthread+0x328/0x630
[   20.484053]  ret_from_fork+0x10/0x20
[   20.484102] 
[   20.484123] Allocated by task 259:
[   20.484163]  kasan_save_stack+0x3c/0x68
[   20.484228]  kasan_save_track+0x20/0x40
[   20.484267]  kasan_save_alloc_info+0x40/0x58
[   20.484326]  __kasan_kmalloc+0xd4/0xd8
[   20.484365]  __kmalloc_cache_noprof+0x16c/0x3c0
[   20.484408]  kasan_strings+0xc8/0xb00
[   20.484455]  kunit_try_run_case+0x170/0x3f0
[   20.484508]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.484553]  kthread+0x328/0x630
[   20.484592]  ret_from_fork+0x10/0x20
[   20.484629] 
[   20.484649] Freed by task 259:
[   20.484690]  kasan_save_stack+0x3c/0x68
[   20.484730]  kasan_save_track+0x20/0x40
[   20.484778]  kasan_save_free_info+0x4c/0x78
[   20.484818]  __kasan_slab_free+0x6c/0x98
[   20.484858]  kfree+0x214/0x3c8
[   20.484906]  kasan_strings+0x24c/0xb00
[   20.484944]  kunit_try_run_case+0x170/0x3f0
[   20.484983]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.485037]  kthread+0x328/0x630
[   20.485072]  ret_from_fork+0x10/0x20
[   20.485108] 
[   20.485153] The buggy address belongs to the object at fff00000c56d5080
[   20.485153]  which belongs to the cache kmalloc-32 of size 32
[   20.485692] The buggy address is located 16 bytes inside of
[   20.485692]  freed 32-byte region [fff00000c56d5080, fff00000c56d50a0)
[   20.485785] 
[   20.485841] The buggy address belongs to the physical page:
[   20.485887] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056d5
[   20.485968] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.486415] page_type: f5(slab)
[   20.486623] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   20.487232] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   20.487427] page dumped because: kasan: bad access detected
[   20.487708] 
[   20.487835] Memory state around the buggy address:
[   20.488402]  fff00000c56d4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.488491]  fff00000c56d5000: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.488766] >fff00000c56d5080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.488899]                          ^
[   20.489288]  fff00000c56d5100: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.489374]  fff00000c56d5180: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.489635] ==================================================================

[   13.527058] ==================================================================
[   13.528179] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   13.528482] Read of size 1 at addr ffff8881027a7e10 by task kunit_try_catch/276
[   13.528869] 
[   13.528987] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.529032] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.529045] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.529066] Call Trace:
[   13.529079]  <TASK>
[   13.529131]  dump_stack_lvl+0x73/0xb0
[   13.529161]  print_report+0xd1/0x650
[   13.529185]  ? __virt_addr_valid+0x1db/0x2d0
[   13.529209]  ? strcmp+0xb0/0xc0
[   13.529230]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.529254]  ? strcmp+0xb0/0xc0
[   13.529275]  kasan_report+0x141/0x180
[   13.529297]  ? strcmp+0xb0/0xc0
[   13.529324]  __asan_report_load1_noabort+0x18/0x20
[   13.529348]  strcmp+0xb0/0xc0
[   13.529371]  kasan_strings+0x431/0xe80
[   13.529392]  ? trace_hardirqs_on+0x37/0xe0
[   13.529415]  ? __pfx_kasan_strings+0x10/0x10
[   13.529453]  ? finish_task_switch.isra.0+0x153/0x700
[   13.529521]  ? __switch_to+0x47/0xf50
[   13.529550]  ? __schedule+0x10cc/0x2b60
[   13.529572]  ? __pfx_read_tsc+0x10/0x10
[   13.529593]  ? ktime_get_ts64+0x86/0x230
[   13.529617]  kunit_try_run_case+0x1a5/0x480
[   13.529641]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.529663]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.529686]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.529710]  ? __kthread_parkme+0x82/0x180
[   13.529730]  ? preempt_count_sub+0x50/0x80
[   13.529753]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.529778]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.529801]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.529825]  kthread+0x337/0x6f0
[   13.529844]  ? trace_preempt_on+0x20/0xc0
[   13.529867]  ? __pfx_kthread+0x10/0x10
[   13.529888]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.529909]  ? calculate_sigpending+0x7b/0xa0
[   13.529945]  ? __pfx_kthread+0x10/0x10
[   13.529967]  ret_from_fork+0x116/0x1d0
[   13.529985]  ? __pfx_kthread+0x10/0x10
[   13.530006]  ret_from_fork_asm+0x1a/0x30
[   13.530037]  </TASK>
[   13.530049] 
[   13.539144] Allocated by task 276:
[   13.539559]  kasan_save_stack+0x45/0x70
[   13.539813]  kasan_save_track+0x18/0x40
[   13.540108]  kasan_save_alloc_info+0x3b/0x50
[   13.540336]  __kasan_kmalloc+0xb7/0xc0
[   13.540674]  __kmalloc_cache_noprof+0x189/0x420
[   13.541004]  kasan_strings+0xc0/0xe80
[   13.541303]  kunit_try_run_case+0x1a5/0x480
[   13.541692]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.541994]  kthread+0x337/0x6f0
[   13.542264]  ret_from_fork+0x116/0x1d0
[   13.542611]  ret_from_fork_asm+0x1a/0x30
[   13.542792] 
[   13.542883] Freed by task 276:
[   13.543042]  kasan_save_stack+0x45/0x70
[   13.543522]  kasan_save_track+0x18/0x40
[   13.543736]  kasan_save_free_info+0x3f/0x60
[   13.543929]  __kasan_slab_free+0x56/0x70
[   13.544277]  kfree+0x222/0x3f0
[   13.544591]  kasan_strings+0x2aa/0xe80
[   13.544965]  kunit_try_run_case+0x1a5/0x480
[   13.545292]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.545694]  kthread+0x337/0x6f0
[   13.545847]  ret_from_fork+0x116/0x1d0
[   13.546041]  ret_from_fork_asm+0x1a/0x30
[   13.546536] 
[   13.546764] The buggy address belongs to the object at ffff8881027a7e00
[   13.546764]  which belongs to the cache kmalloc-32 of size 32
[   13.547532] The buggy address is located 16 bytes inside of
[   13.547532]  freed 32-byte region [ffff8881027a7e00, ffff8881027a7e20)
[   13.548356] 
[   13.548459] The buggy address belongs to the physical page:
[   13.548697] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027a7
[   13.549041] flags: 0x200000000000000(node=0|zone=2)
[   13.549813] page_type: f5(slab)
[   13.549995] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.550850] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   13.551361] page dumped because: kasan: bad access detected
[   13.551782] 
[   13.552021] Memory state around the buggy address:
[   13.552382]  ffff8881027a7d00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.552933]  ffff8881027a7d80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.553391] >ffff8881027a7e00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.553718]                          ^
[   13.553897]  ffff8881027a7e80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.554802]  ffff8881027a7f00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.555233] ==================================================================