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

Environment
qemu-arm64
qemu-x86_64

[   17.748125] ==================================================================
[   17.748189] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   17.748242] Read of size 1 at addr fff00000c5977b10 by task kunit_try_catch/260
[   17.748428] 
[   17.748774] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   17.749495] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.749531] Hardware name: linux,dummy-virt (DT)
[   17.749564] Call trace:
[   17.749589]  show_stack+0x20/0x38 (C)
[   17.749645]  dump_stack_lvl+0x8c/0xd0
[   17.749694]  print_report+0x118/0x5d0
[   17.749743]  kasan_report+0xdc/0x128
[   17.749790]  __asan_report_load1_noabort+0x20/0x30
[   17.749844]  strcmp+0xc0/0xc8
[   17.749885]  kasan_strings+0x340/0xb00
[   17.749931]  kunit_try_run_case+0x170/0x3f0
[   17.749981]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.750036]  kthread+0x328/0x630
[   17.750080]  ret_from_fork+0x10/0x20
[   17.750129] 
[   17.750151] Allocated by task 260:
[   17.750197]  kasan_save_stack+0x3c/0x68
[   17.750241]  kasan_save_track+0x20/0x40
[   17.750279]  kasan_save_alloc_info+0x40/0x58
[   17.750323]  __kasan_kmalloc+0xd4/0xd8
[   17.750364]  __kmalloc_cache_noprof+0x16c/0x3c0
[   17.750407]  kasan_strings+0xc8/0xb00
[   17.750444]  kunit_try_run_case+0x170/0x3f0
[   17.750484]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.750573]  kthread+0x328/0x630
[   17.750632]  ret_from_fork+0x10/0x20
[   17.750671] 
[   17.750691] Freed by task 260:
[   17.750742]  kasan_save_stack+0x3c/0x68
[   17.750783]  kasan_save_track+0x20/0x40
[   17.750822]  kasan_save_free_info+0x4c/0x78
[   17.750864]  __kasan_slab_free+0x6c/0x98
[   17.750904]  kfree+0x214/0x3c8
[   17.750938]  kasan_strings+0x24c/0xb00
[   17.750974]  kunit_try_run_case+0x170/0x3f0
[   17.751013]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.751079]  kthread+0x328/0x630
[   17.751113]  ret_from_fork+0x10/0x20
[   17.751151] 
[   17.751172] The buggy address belongs to the object at fff00000c5977b00
[   17.751172]  which belongs to the cache kmalloc-32 of size 32
[   17.751243] The buggy address is located 16 bytes inside of
[   17.751243]  freed 32-byte region [fff00000c5977b00, fff00000c5977b20)
[   17.751307] 
[   17.751329] The buggy address belongs to the physical page:
[   17.751362] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105977
[   17.751417] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.751505] page_type: f5(slab)
[   17.751547] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   17.751675] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   17.751809] page dumped because: kasan: bad access detected
[   17.751871] 
[   17.751912] Memory state around the buggy address:
[   17.751959]  fff00000c5977a00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.752011]  fff00000c5977a80: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.752066] >fff00000c5977b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.752107]                          ^
[   17.752205]  fff00000c5977b80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   17.752321]  fff00000c5977c00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   17.752669] ==================================================================

[   14.440444] ==================================================================
[   14.441321] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   14.441670] Read of size 1 at addr ffff8881038e8050 by task kunit_try_catch/276
[   14.441987] 
[   14.442100] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   14.442146] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.442158] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.442180] Call Trace:
[   14.442191]  <TASK>
[   14.442207]  dump_stack_lvl+0x73/0xb0
[   14.442236]  print_report+0xd1/0x610
[   14.442259]  ? __virt_addr_valid+0x1db/0x2d0
[   14.442283]  ? strcmp+0xb0/0xc0
[   14.442299]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.442323]  ? strcmp+0xb0/0xc0
[   14.442341]  kasan_report+0x141/0x180
[   14.442363]  ? strcmp+0xb0/0xc0
[   14.442391]  __asan_report_load1_noabort+0x18/0x20
[   14.442417]  strcmp+0xb0/0xc0
[   14.442436]  kasan_strings+0x431/0xe80
[   14.442475]  ? trace_hardirqs_on+0x37/0xe0
[   14.442499]  ? __pfx_kasan_strings+0x10/0x10
[   14.442520]  ? finish_task_switch.isra.0+0x153/0x700
[   14.442544]  ? __switch_to+0x47/0xf50
[   14.442570]  ? __schedule+0x10cc/0x2b60
[   14.442593]  ? __pfx_read_tsc+0x10/0x10
[   14.442614]  ? ktime_get_ts64+0x86/0x230
[   14.442639]  kunit_try_run_case+0x1a5/0x480
[   14.442665]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.442688]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.442713]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.442738]  ? __kthread_parkme+0x82/0x180
[   14.442771]  ? preempt_count_sub+0x50/0x80
[   14.442795]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.442820]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.442845]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.442871]  kthread+0x337/0x6f0
[   14.442892]  ? trace_preempt_on+0x20/0xc0
[   14.442914]  ? __pfx_kthread+0x10/0x10
[   14.442935]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.442957]  ? calculate_sigpending+0x7b/0xa0
[   14.442981]  ? __pfx_kthread+0x10/0x10
[   14.443002]  ret_from_fork+0x116/0x1d0
[   14.443022]  ? __pfx_kthread+0x10/0x10
[   14.443042]  ret_from_fork_asm+0x1a/0x30
[   14.443075]  </TASK>
[   14.443085] 
[   14.450676] Allocated by task 276:
[   14.450872]  kasan_save_stack+0x45/0x70
[   14.451072]  kasan_save_track+0x18/0x40
[   14.451268]  kasan_save_alloc_info+0x3b/0x50
[   14.451635]  __kasan_kmalloc+0xb7/0xc0
[   14.451815]  __kmalloc_cache_noprof+0x189/0x420
[   14.452006]  kasan_strings+0xc0/0xe80
[   14.452198]  kunit_try_run_case+0x1a5/0x480
[   14.452457]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.452683]  kthread+0x337/0x6f0
[   14.452860]  ret_from_fork+0x116/0x1d0
[   14.453034]  ret_from_fork_asm+0x1a/0x30
[   14.453217] 
[   14.453294] Freed by task 276:
[   14.453508]  kasan_save_stack+0x45/0x70
[   14.453648]  kasan_save_track+0x18/0x40
[   14.453793]  kasan_save_free_info+0x3f/0x60
[   14.453944]  __kasan_slab_free+0x56/0x70
[   14.454079]  kfree+0x222/0x3f0
[   14.454229]  kasan_strings+0x2aa/0xe80
[   14.454602]  kunit_try_run_case+0x1a5/0x480
[   14.454833]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.455087]  kthread+0x337/0x6f0
[   14.455256]  ret_from_fork+0x116/0x1d0
[   14.455397]  ret_from_fork_asm+0x1a/0x30
[   14.455535] 
[   14.455605] The buggy address belongs to the object at ffff8881038e8040
[   14.455605]  which belongs to the cache kmalloc-32 of size 32
[   14.456078] The buggy address is located 16 bytes inside of
[   14.456078]  freed 32-byte region [ffff8881038e8040, ffff8881038e8060)
[   14.456809] 
[   14.456893] The buggy address belongs to the physical page:
[   14.457127] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038e8
[   14.457463] flags: 0x200000000000000(node=0|zone=2)
[   14.457736] page_type: f5(slab)
[   14.457912] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.458175] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.458405] page dumped because: kasan: bad access detected
[   14.458643] 
[   14.458739] Memory state around the buggy address:
[   14.458974]  ffff8881038e7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.459362]  ffff8881038e7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.459685] >ffff8881038e8000: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.460015]                                                  ^
[   14.460237]  ffff8881038e8080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.460579]  ffff8881038e8100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.460807] ==================================================================