Hay
Date
July 1, 2025, 11:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.065241] ==================================================================
[   21.065453] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   21.065540] Read of size 1 at addr fff00000c76d9210 by task kunit_try_catch/260
[   21.065823] 
[   21.065972] CPU: 0 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   21.066355] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.066416] Hardware name: linux,dummy-virt (DT)
[   21.066464] Call trace:
[   21.066499]  show_stack+0x20/0x38 (C)
[   21.066971]  dump_stack_lvl+0x8c/0xd0
[   21.067063]  print_report+0x118/0x608
[   21.067211]  kasan_report+0xdc/0x128
[   21.067426]  __asan_report_load1_noabort+0x20/0x30
[   21.067492]  strcmp+0xc0/0xc8
[   21.067539]  kasan_strings+0x340/0xb00
[   21.067588]  kunit_try_run_case+0x170/0x3f0
[   21.068092]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.068270]  kthread+0x328/0x630
[   21.068433]  ret_from_fork+0x10/0x20
[   21.068974] 
[   21.069110] Allocated by task 260:
[   21.069216]  kasan_save_stack+0x3c/0x68
[   21.069377]  kasan_save_track+0x20/0x40
[   21.069505]  kasan_save_alloc_info+0x40/0x58
[   21.069580]  __kasan_kmalloc+0xd4/0xd8
[   21.070017]  __kmalloc_cache_noprof+0x16c/0x3c0
[   21.070553]  kasan_strings+0xc8/0xb00
[   21.070674]  kunit_try_run_case+0x170/0x3f0
[   21.071119]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.071197]  kthread+0x328/0x630
[   21.071237]  ret_from_fork+0x10/0x20
[   21.071312] 
[   21.071339] Freed by task 260:
[   21.072165]  kasan_save_stack+0x3c/0x68
[   21.072383]  kasan_save_track+0x20/0x40
[   21.072548]  kasan_save_free_info+0x4c/0x78
[   21.072910]  __kasan_slab_free+0x6c/0x98
[   21.073127]  kfree+0x214/0x3c8
[   21.073219]  kasan_strings+0x24c/0xb00
[   21.073339]  kunit_try_run_case+0x170/0x3f0
[   21.073385]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.073563]  kthread+0x328/0x630
[   21.073610]  ret_from_fork+0x10/0x20
[   21.073898] 
[   21.074310] The buggy address belongs to the object at fff00000c76d9200
[   21.074310]  which belongs to the cache kmalloc-32 of size 32
[   21.074621] The buggy address is located 16 bytes inside of
[   21.074621]  freed 32-byte region [fff00000c76d9200, fff00000c76d9220)
[   21.074747] 
[   21.074816] The buggy address belongs to the physical page:
[   21.074869] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1076d9
[   21.074959] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.075032] page_type: f5(slab)
[   21.075084] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   21.075175] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   21.075226] page dumped because: kasan: bad access detected
[   21.075265] 
[   21.075286] Memory state around the buggy address:
[   21.075342]  fff00000c76d9100: 00 00 00 fc fc fc fc fc 00 00 00 04 fc fc fc fc
[   21.075394]  fff00000c76d9180: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.075446] >fff00000c76d9200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   21.075493]                          ^
[   21.075530]  fff00000c76d9280: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   21.075581]  fff00000c76d9300: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   21.075651] ==================================================================

[   13.426606] ==================================================================
[   13.427589] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   13.427865] Read of size 1 at addr ffff888103aaf390 by task kunit_try_catch/276
[   13.428180] 
[   13.428271] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.428318] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.428330] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.428352] Call Trace:
[   13.428365]  <TASK>
[   13.428397]  dump_stack_lvl+0x73/0xb0
[   13.428426]  print_report+0xd1/0x650
[   13.428451]  ? __virt_addr_valid+0x1db/0x2d0
[   13.428476]  ? strcmp+0xb0/0xc0
[   13.428495]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.428518]  ? strcmp+0xb0/0xc0
[   13.428538]  kasan_report+0x141/0x180
[   13.428559]  ? strcmp+0xb0/0xc0
[   13.428584]  __asan_report_load1_noabort+0x18/0x20
[   13.428608]  strcmp+0xb0/0xc0
[   13.428631]  kasan_strings+0x431/0xe80
[   13.428660]  ? trace_hardirqs_on+0x37/0xe0
[   13.428684]  ? __pfx_kasan_strings+0x10/0x10
[   13.428704]  ? finish_task_switch.isra.0+0x153/0x700
[   13.428726]  ? __switch_to+0x47/0xf50
[   13.428753]  ? __schedule+0x10cc/0x2b60
[   13.428775]  ? __pfx_read_tsc+0x10/0x10
[   13.428797]  ? ktime_get_ts64+0x86/0x230
[   13.428820]  kunit_try_run_case+0x1a5/0x480
[   13.428845]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.428867]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.428890]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.428912]  ? __kthread_parkme+0x82/0x180
[   13.428933]  ? preempt_count_sub+0x50/0x80
[   13.428955]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.428980]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.429002]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.429025]  kthread+0x337/0x6f0
[   13.429044]  ? trace_preempt_on+0x20/0xc0
[   13.429065]  ? __pfx_kthread+0x10/0x10
[   13.429085]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.429105]  ? calculate_sigpending+0x7b/0xa0
[   13.429128]  ? __pfx_kthread+0x10/0x10
[   13.429148]  ret_from_fork+0x116/0x1d0
[   13.429166]  ? __pfx_kthread+0x10/0x10
[   13.429185]  ret_from_fork_asm+0x1a/0x30
[   13.429216]  </TASK>
[   13.429227] 
[   13.436162] Allocated by task 276:
[   13.436341]  kasan_save_stack+0x45/0x70
[   13.436554]  kasan_save_track+0x18/0x40
[   13.436750]  kasan_save_alloc_info+0x3b/0x50
[   13.436959]  __kasan_kmalloc+0xb7/0xc0
[   13.437147]  __kmalloc_cache_noprof+0x189/0x420
[   13.437327]  kasan_strings+0xc0/0xe80
[   13.437514]  kunit_try_run_case+0x1a5/0x480
[   13.437701]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.437875]  kthread+0x337/0x6f0
[   13.437995]  ret_from_fork+0x116/0x1d0
[   13.438164]  ret_from_fork_asm+0x1a/0x30
[   13.438359] 
[   13.438462] Freed by task 276:
[   13.438652]  kasan_save_stack+0x45/0x70
[   13.438845]  kasan_save_track+0x18/0x40
[   13.439036]  kasan_save_free_info+0x3f/0x60
[   13.439204]  __kasan_slab_free+0x56/0x70
[   13.439406]  kfree+0x222/0x3f0
[   13.439565]  kasan_strings+0x2aa/0xe80
[   13.439711]  kunit_try_run_case+0x1a5/0x480
[   13.439920]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.440137]  kthread+0x337/0x6f0
[   13.440299]  ret_from_fork+0x116/0x1d0
[   13.440461]  ret_from_fork_asm+0x1a/0x30
[   13.440709] 
[   13.440793] The buggy address belongs to the object at ffff888103aaf380
[   13.440793]  which belongs to the cache kmalloc-32 of size 32
[   13.441254] The buggy address is located 16 bytes inside of
[   13.441254]  freed 32-byte region [ffff888103aaf380, ffff888103aaf3a0)
[   13.441708] 
[   13.441810] The buggy address belongs to the physical page:
[   13.442058] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103aaf
[   13.442419] flags: 0x200000000000000(node=0|zone=2)
[   13.442688] page_type: f5(slab)
[   13.442813] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.443093] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.443440] page dumped because: kasan: bad access detected
[   13.443777] 
[   13.443866] Memory state around the buggy address:
[   13.444072]  ffff888103aaf280: fa fb fb fb fc fc fc fc 00 00 07 fc fc fc fc fc
[   13.444350]  ffff888103aaf300: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.444719] >ffff888103aaf380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.444992]                          ^
[   13.445159]  ffff888103aaf400: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.445442]  ffff888103aaf480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.445829] ==================================================================