Hay
Date
June 20, 2025, 12:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   35.126081] ==================================================================
[   35.126269] BUG: KASAN: slab-use-after-free in strcmp+0xc0/0xc8
[   35.126429] Read of size 1 at addr fff00000c7699cd0 by task kunit_try_catch/270
[   35.126561] 
[   35.126736] CPU: 0 UID: 0 PID: 270 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250620 #1 PREEMPT 
[   35.127508] Tainted: [B]=BAD_PAGE, [N]=TEST
[   35.127639] Hardware name: linux,dummy-virt (DT)
[   35.127779] Call trace:
[   35.127844]  show_stack+0x20/0x38 (C)
[   35.127984]  dump_stack_lvl+0x8c/0xd0
[   35.128090]  print_report+0x118/0x608
[   35.128215]  kasan_report+0xdc/0x128
[   35.128375]  __asan_report_load1_noabort+0x20/0x30
[   35.128495]  strcmp+0xc0/0xc8
[   35.128998]  kasan_strings+0x340/0xb00
[   35.129108]  kunit_try_run_case+0x170/0x3f0
[   35.129408]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.129527]  kthread+0x328/0x630
[   35.129671]  ret_from_fork+0x10/0x20
[   35.129778] 
[   35.129825] Allocated by task 270:
[   35.129888]  kasan_save_stack+0x3c/0x68
[   35.129988]  kasan_save_track+0x20/0x40
[   35.130076]  kasan_save_alloc_info+0x40/0x58
[   35.130172]  __kasan_kmalloc+0xd4/0xd8
[   35.130318]  __kmalloc_cache_noprof+0x16c/0x3c0
[   35.130439]  kasan_strings+0xc8/0xb00
[   35.130555]  kunit_try_run_case+0x170/0x3f0
[   35.130726]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.130859]  kthread+0x328/0x630
[   35.130998]  ret_from_fork+0x10/0x20
[   35.131562] 
[   35.132042] Freed by task 270:
[   35.132173]  kasan_save_stack+0x3c/0x68
[   35.132343]  kasan_save_track+0x20/0x40
[   35.132466]  kasan_save_free_info+0x4c/0x78
[   35.132643]  __kasan_slab_free+0x6c/0x98
[   35.132736]  kfree+0x214/0x3c8
[   35.132805]  kasan_strings+0x24c/0xb00
[   35.132886]  kunit_try_run_case+0x170/0x3f0
[   35.132977]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   35.133084]  kthread+0x328/0x630
[   35.133622]  ret_from_fork+0x10/0x20
[   35.133822] 
[   35.133904] The buggy address belongs to the object at fff00000c7699cc0
[   35.133904]  which belongs to the cache kmalloc-32 of size 32
[   35.134511] The buggy address is located 16 bytes inside of
[   35.134511]  freed 32-byte region [fff00000c7699cc0, fff00000c7699ce0)
[   35.134750] 
[   35.134836] The buggy address belongs to the physical page:
[   35.135338] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107699
[   35.135524] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   35.135797] page_type: f5(slab)
[   35.136157] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   35.136385] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   35.136631] page dumped because: kasan: bad access detected
[   35.136808] 
[   35.136870] Memory state around the buggy address:
[   35.137168]  fff00000c7699b80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   35.137264]  fff00000c7699c00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   35.137399] >fff00000c7699c80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   35.137500]                                                  ^
[   35.137764]  fff00000c7699d00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   35.137912]  fff00000c7699d80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   35.138078] ==================================================================

[   27.826118] ==================================================================
[   27.827764] BUG: KASAN: slab-use-after-free in strcmp+0xb0/0xc0
[   27.828131] Read of size 1 at addr ffff888102336390 by task kunit_try_catch/288
[   27.828373] 
[   27.828496] CPU: 0 UID: 0 PID: 288 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250620 #1 PREEMPT(voluntary) 
[   27.828562] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.828578] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.828605] Call Trace:
[   27.828624]  <TASK>
[   27.828649]  dump_stack_lvl+0x73/0xb0
[   27.828683]  print_report+0xd1/0x650
[   27.828714]  ? __virt_addr_valid+0x1db/0x2d0
[   27.828743]  ? strcmp+0xb0/0xc0
[   27.828766]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.828796]  ? strcmp+0xb0/0xc0
[   27.828819]  kasan_report+0x141/0x180
[   27.828843]  ? strcmp+0xb0/0xc0
[   27.828871]  __asan_report_load1_noabort+0x18/0x20
[   27.828898]  strcmp+0xb0/0xc0
[   27.828923]  kasan_strings+0x431/0xe80
[   27.828946]  ? trace_hardirqs_on+0x37/0xe0
[   27.828972]  ? __pfx_kasan_strings+0x10/0x10
[   27.828995]  ? finish_task_switch.isra.0+0x153/0x700
[   27.829021]  ? __switch_to+0x47/0xf50
[   27.829050]  ? __schedule+0x10cc/0x2b60
[   27.829075]  ? __pfx_read_tsc+0x10/0x10
[   27.829100]  ? ktime_get_ts64+0x86/0x230
[   27.829130]  kunit_try_run_case+0x1a5/0x480
[   27.829747]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.829842]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.829902]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.829957]  ? __kthread_parkme+0x82/0x180
[   27.830008]  ? preempt_count_sub+0x50/0x80
[   27.830075]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.830129]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.830183]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.830228]  kthread+0x337/0x6f0
[   27.830263]  ? trace_preempt_on+0x20/0xc0
[   27.830305]  ? __pfx_kthread+0x10/0x10
[   27.830347]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.830390]  ? calculate_sigpending+0x7b/0xa0
[   27.830435]  ? __pfx_kthread+0x10/0x10
[   27.830489]  ret_from_fork+0x116/0x1d0
[   27.830531]  ? __pfx_kthread+0x10/0x10
[   27.830572]  ret_from_fork_asm+0x1a/0x30
[   27.830637]  </TASK>
[   27.830663] 
[   27.841384] Allocated by task 288:
[   27.842404]  kasan_save_stack+0x45/0x70
[   27.843021]  kasan_save_track+0x18/0x40
[   27.843277]  kasan_save_alloc_info+0x3b/0x50
[   27.843705]  __kasan_kmalloc+0xb7/0xc0
[   27.844381]  __kmalloc_cache_noprof+0x189/0x420
[   27.844932]  kasan_strings+0xc0/0xe80
[   27.845160]  kunit_try_run_case+0x1a5/0x480
[   27.845332]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.845546]  kthread+0x337/0x6f0
[   27.846392]  ret_from_fork+0x116/0x1d0
[   27.846755]  ret_from_fork_asm+0x1a/0x30
[   27.847122] 
[   27.847293] Freed by task 288:
[   27.847588]  kasan_save_stack+0x45/0x70
[   27.847929]  kasan_save_track+0x18/0x40
[   27.848286]  kasan_save_free_info+0x3f/0x60
[   27.848679]  __kasan_slab_free+0x56/0x70
[   27.849036]  kfree+0x222/0x3f0
[   27.849337]  kasan_strings+0x2aa/0xe80
[   27.850526]  kunit_try_run_case+0x1a5/0x480
[   27.851263]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.851493]  kthread+0x337/0x6f0
[   27.851829]  ret_from_fork+0x116/0x1d0
[   27.852738]  ret_from_fork_asm+0x1a/0x30
[   27.852992] 
[   27.853092] The buggy address belongs to the object at ffff888102336380
[   27.853092]  which belongs to the cache kmalloc-32 of size 32
[   27.853764] The buggy address is located 16 bytes inside of
[   27.853764]  freed 32-byte region [ffff888102336380, ffff8881023363a0)
[   27.855262] 
[   27.855462] The buggy address belongs to the physical page:
[   27.856267] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102336
[   27.856685] flags: 0x200000000000000(node=0|zone=2)
[   27.857203] page_type: f5(slab)
[   27.857392] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.857736] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.858907] page dumped because: kasan: bad access detected
[   27.859252] 
[   27.859419] Memory state around the buggy address:
[   27.859638]  ffff888102336280: 00 00 00 04 fc fc fc fc fa fb fb fb fc fc fc fc
[   27.860204]  ffff888102336300: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.860545] >ffff888102336380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.861009]                          ^
[   27.861692]  ffff888102336400: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.862110]  ffff888102336480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.862763] ==================================================================