Hay
Date
July 1, 2025, 3:08 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.208293] ==================================================================
[   19.208456] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   19.208559] Read of size 1 at addr fff00000c57eabd0 by task kunit_try_catch/260
[   19.208629] 
[   19.208684] CPU: 0 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.208774] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.208804] Hardware name: linux,dummy-virt (DT)
[   19.208839] Call trace:
[   19.208865]  show_stack+0x20/0x38 (C)
[   19.208919]  dump_stack_lvl+0x8c/0xd0
[   19.208968]  print_report+0x118/0x608
[   19.209018]  kasan_report+0xdc/0x128
[   19.209065]  __asan_report_load1_noabort+0x20/0x30
[   19.209117]  strcmp+0xc0/0xc8
[   19.209159]  kasan_strings+0x340/0xb00
[   19.209206]  kunit_try_run_case+0x170/0x3f0
[   19.209271]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.210223]  kthread+0x328/0x630
[   19.210503]  ret_from_fork+0x10/0x20
[   19.210669] 
[   19.210727] Allocated by task 260:
[   19.210811]  kasan_save_stack+0x3c/0x68
[   19.210861]  kasan_save_track+0x20/0x40
[   19.211162]  kasan_save_alloc_info+0x40/0x58
[   19.211298]  __kasan_kmalloc+0xd4/0xd8
[   19.211588]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.211715]  kasan_strings+0xc8/0xb00
[   19.211795]  kunit_try_run_case+0x170/0x3f0
[   19.212035]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.212241]  kthread+0x328/0x630
[   19.212339]  ret_from_fork+0x10/0x20
[   19.212465] 
[   19.212515] Freed by task 260:
[   19.212548]  kasan_save_stack+0x3c/0x68
[   19.212871]  kasan_save_track+0x20/0x40
[   19.212942]  kasan_save_free_info+0x4c/0x78
[   19.213014]  __kasan_slab_free+0x6c/0x98
[   19.213161]  kfree+0x214/0x3c8
[   19.213218]  kasan_strings+0x24c/0xb00
[   19.213393]  kunit_try_run_case+0x170/0x3f0
[   19.213596]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.213693]  kthread+0x328/0x630
[   19.213885]  ret_from_fork+0x10/0x20
[   19.213936] 
[   19.214063] The buggy address belongs to the object at fff00000c57eabc0
[   19.214063]  which belongs to the cache kmalloc-32 of size 32
[   19.214238] The buggy address is located 16 bytes inside of
[   19.214238]  freed 32-byte region [fff00000c57eabc0, fff00000c57eabe0)
[   19.214410] 
[   19.214465] The buggy address belongs to the physical page:
[   19.214558] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1057ea
[   19.214673] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.214875] page_type: f5(slab)
[   19.215064] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.215170] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.215310] page dumped because: kasan: bad access detected
[   19.215369] 
[   19.215389] Memory state around the buggy address:
[   19.215583]  fff00000c57eaa80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.215823]  fff00000c57eab00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.215920] >fff00000c57eab80: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.215964]                                                  ^
[   19.216209]  fff00000c57eac00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.216445]  fff00000c57eac80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.216532] ==================================================================

[   13.561844] ==================================================================
[   13.564079] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   13.564553] Read of size 1 at addr ffff8881033c1910 by task kunit_try_catch/276
[   13.564831] 
[   13.565006] CPU: 0 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.565067] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.565079] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.565102] Call Trace:
[   13.565116]  <TASK>
[   13.565137]  dump_stack_lvl+0x73/0xb0
[   13.565165]  print_report+0xd1/0x650
[   13.565189]  ? __virt_addr_valid+0x1db/0x2d0
[   13.565214]  ? strcmp+0xb0/0xc0
[   13.565234]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.565256]  ? strcmp+0xb0/0xc0
[   13.565276]  kasan_report+0x141/0x180
[   13.565297]  ? strcmp+0xb0/0xc0
[   13.565323]  __asan_report_load1_noabort+0x18/0x20
[   13.565346]  strcmp+0xb0/0xc0
[   13.565367]  kasan_strings+0x431/0xe80
[   13.565386]  ? trace_hardirqs_on+0x37/0xe0
[   13.565409]  ? __pfx_kasan_strings+0x10/0x10
[   13.565429]  ? finish_task_switch.isra.0+0x153/0x700
[   13.565450]  ? __switch_to+0x47/0xf50
[   13.565477]  ? __schedule+0x10cc/0x2b60
[   13.565499]  ? __pfx_read_tsc+0x10/0x10
[   13.565520]  ? ktime_get_ts64+0x86/0x230
[   13.565544]  kunit_try_run_case+0x1a5/0x480
[   13.565569]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.565590]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.565612]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.565635]  ? __kthread_parkme+0x82/0x180
[   13.565686]  ? preempt_count_sub+0x50/0x80
[   13.565708]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.565731]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.565768]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.565953]  kthread+0x337/0x6f0
[   13.565979]  ? trace_preempt_on+0x20/0xc0
[   13.566001]  ? __pfx_kthread+0x10/0x10
[   13.566034]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.566055]  ? calculate_sigpending+0x7b/0xa0
[   13.566079]  ? __pfx_kthread+0x10/0x10
[   13.566100]  ret_from_fork+0x116/0x1d0
[   13.566118]  ? __pfx_kthread+0x10/0x10
[   13.566138]  ret_from_fork_asm+0x1a/0x30
[   13.566170]  </TASK>
[   13.566183] 
[   13.579130] Allocated by task 276:
[   13.579320]  kasan_save_stack+0x45/0x70
[   13.579520]  kasan_save_track+0x18/0x40
[   13.579762]  kasan_save_alloc_info+0x3b/0x50
[   13.579965]  __kasan_kmalloc+0xb7/0xc0
[   13.580161]  __kmalloc_cache_noprof+0x189/0x420
[   13.580369]  kasan_strings+0xc0/0xe80
[   13.580540]  kunit_try_run_case+0x1a5/0x480
[   13.581179]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.581389]  kthread+0x337/0x6f0
[   13.581540]  ret_from_fork+0x116/0x1d0
[   13.581871]  ret_from_fork_asm+0x1a/0x30
[   13.582079] 
[   13.582180] Freed by task 276:
[   13.582337]  kasan_save_stack+0x45/0x70
[   13.582519]  kasan_save_track+0x18/0x40
[   13.582959]  kasan_save_free_info+0x3f/0x60
[   13.583179]  __kasan_slab_free+0x56/0x70
[   13.583364]  kfree+0x222/0x3f0
[   13.583520]  kasan_strings+0x2aa/0xe80
[   13.583762]  kunit_try_run_case+0x1a5/0x480
[   13.583961]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.584206]  kthread+0x337/0x6f0
[   13.584360]  ret_from_fork+0x116/0x1d0
[   13.584530]  ret_from_fork_asm+0x1a/0x30
[   13.584826] 
[   13.584920] The buggy address belongs to the object at ffff8881033c1900
[   13.584920]  which belongs to the cache kmalloc-32 of size 32
[   13.585403] The buggy address is located 16 bytes inside of
[   13.585403]  freed 32-byte region [ffff8881033c1900, ffff8881033c1920)
[   13.585915] 
[   13.586006] The buggy address belongs to the physical page:
[   13.586246] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1033c1
[   13.586564] flags: 0x200000000000000(node=0|zone=2)
[   13.586838] page_type: f5(slab)
[   13.586999] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.587315] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.587614] page dumped because: kasan: bad access detected
[   13.588978] 
[   13.589072] Memory state around the buggy address:
[   13.589234]  ffff8881033c1800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.589449]  ffff8881033c1880: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.589784] >ffff8881033c1900: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.590009]                          ^
[   13.590150]  ffff8881033c1980: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.590440]  ffff8881033c1a00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.590666] ==================================================================