Hay
Date
July 23, 2025, 3:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.824172] ==================================================================
[   32.824224] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   32.824274] Read of size 1 at addr fff00000c9c2cc50 by task kunit_try_catch/292
[   32.824352] 
[   32.824401] CPU: 1 UID: 0 PID: 292 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250723 #1 PREEMPT 
[   32.824531] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   32.824598] Hardware name: linux,dummy-virt (DT)
[   32.824723] Call trace:
[   32.824783]  show_stack+0x20/0x38 (C)
[   32.824931]  dump_stack_lvl+0x8c/0xd0
[   32.825012]  print_report+0x118/0x5e8
[   32.825077]  kasan_report+0xdc/0x128
[   32.825123]  __asan_report_load1_noabort+0x20/0x30
[   32.825175]  strlen+0xa8/0xb0
[   32.825219]  kasan_strings+0x418/0xb00
[   32.825325]  kunit_try_run_case+0x170/0x3f0
[   32.825376]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.825431]  kthread+0x328/0x630
[   32.825473]  ret_from_fork+0x10/0x20
[   32.825587] 
[   32.825655] Allocated by task 292:
[   32.825695]  kasan_save_stack+0x3c/0x68
[   32.825745]  kasan_save_track+0x20/0x40
[   32.825832]  kasan_save_alloc_info+0x40/0x58
[   32.825890]  __kasan_kmalloc+0xd4/0xd8
[   32.825944]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.826011]  kasan_strings+0xc8/0xb00
[   32.826085]  kunit_try_run_case+0x170/0x3f0
[   32.826122]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.826202]  kthread+0x328/0x630
[   32.826322]  ret_from_fork+0x10/0x20
[   32.826402] 
[   32.826461] Freed by task 292:
[   32.826653]  kasan_save_stack+0x3c/0x68
[   32.826693]  kasan_save_track+0x20/0x40
[   32.826856]  kasan_save_free_info+0x4c/0x78
[   32.827008]  __kasan_slab_free+0x6c/0x98
[   32.827088]  kfree+0x214/0x3c8
[   32.827222]  kasan_strings+0x24c/0xb00
[   32.827310]  kunit_try_run_case+0x170/0x3f0
[   32.827395]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.827520]  kthread+0x328/0x630
[   32.827565]  ret_from_fork+0x10/0x20
[   32.827603] 
[   32.827779] The buggy address belongs to the object at fff00000c9c2cc40
[   32.827779]  which belongs to the cache kmalloc-32 of size 32
[   32.827842] The buggy address is located 16 bytes inside of
[   32.827842]  freed 32-byte region [fff00000c9c2cc40, fff00000c9c2cc60)
[   32.827991] 
[   32.828041] The buggy address belongs to the physical page:
[   32.828229] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109c2c
[   32.828284] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.828332] page_type: f5(slab)
[   32.828369] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   32.828491] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   32.828613] page dumped because: kasan: bad access detected
[   32.828684] 
[   32.828770] Memory state around the buggy address:
[   32.828921]  fff00000c9c2cb00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   32.829014]  fff00000c9c2cb80: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   32.829121] >fff00000c9c2cc00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   32.829189]                                                  ^
[   32.829259]  fff00000c9c2cc80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   32.829304]  fff00000c9c2cd00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   32.829344] ==================================================================

[   27.276595] ==================================================================
[   27.276900] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   27.277180] Read of size 1 at addr ffff8881060ae110 by task kunit_try_catch/308
[   27.277642] 
[   27.277737] CPU: 1 UID: 0 PID: 308 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT(voluntary) 
[   27.277789] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.277803] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.277826] Call Trace:
[   27.277844]  <TASK>
[   27.277863]  dump_stack_lvl+0x73/0xb0
[   27.277891]  print_report+0xd1/0x640
[   27.277914]  ? __virt_addr_valid+0x1db/0x2d0
[   27.277939]  ? strlen+0x8f/0xb0
[   27.277959]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.277987]  ? strlen+0x8f/0xb0
[   27.278007]  kasan_report+0x141/0x180
[   27.278030]  ? strlen+0x8f/0xb0
[   27.278055]  __asan_report_load1_noabort+0x18/0x20
[   27.278093]  strlen+0x8f/0xb0
[   27.278114]  kasan_strings+0x57b/0xe80
[   27.278134]  ? trace_hardirqs_on+0x37/0xe0
[   27.278173]  ? __pfx_kasan_strings+0x10/0x10
[   27.278194]  ? finish_task_switch.isra.0+0x153/0x700
[   27.278216]  ? __switch_to+0x47/0xf80
[   27.278242]  ? __schedule+0x10da/0x2b60
[   27.278268]  ? __pfx_read_tsc+0x10/0x10
[   27.278289]  ? ktime_get_ts64+0x86/0x230
[   27.278314]  kunit_try_run_case+0x1a5/0x480
[   27.278339]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.278361]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.278403]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.278429]  ? __kthread_parkme+0x82/0x180
[   27.278449]  ? preempt_count_sub+0x50/0x80
[   27.278472]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.278497]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.278520]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.278544]  kthread+0x337/0x6f0
[   27.278564]  ? trace_preempt_on+0x20/0xc0
[   27.278586]  ? __pfx_kthread+0x10/0x10
[   27.278607]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.278631]  ? calculate_sigpending+0x7b/0xa0
[   27.278655]  ? __pfx_kthread+0x10/0x10
[   27.278676]  ret_from_fork+0x116/0x1d0
[   27.278696]  ? __pfx_kthread+0x10/0x10
[   27.278717]  ret_from_fork_asm+0x1a/0x30
[   27.278749]  </TASK>
[   27.278761] 
[   27.286978] Allocated by task 308:
[   27.287155]  kasan_save_stack+0x45/0x70
[   27.287308]  kasan_save_track+0x18/0x40
[   27.287441]  kasan_save_alloc_info+0x3b/0x50
[   27.287590]  __kasan_kmalloc+0xb7/0xc0
[   27.287723]  __kmalloc_cache_noprof+0x189/0x420
[   27.287873]  kasan_strings+0xc0/0xe80
[   27.288055]  kunit_try_run_case+0x1a5/0x480
[   27.288265]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.288506]  kthread+0x337/0x6f0
[   27.288662]  ret_from_fork+0x116/0x1d0
[   27.288841]  ret_from_fork_asm+0x1a/0x30
[   27.289130] 
[   27.289331] Freed by task 308:
[   27.289630]  kasan_save_stack+0x45/0x70
[   27.289788]  kasan_save_track+0x18/0x40
[   27.289996]  kasan_save_free_info+0x3f/0x60
[   27.290213]  __kasan_slab_free+0x56/0x70
[   27.290365]  kfree+0x222/0x3f0
[   27.290589]  kasan_strings+0x2aa/0xe80
[   27.290741]  kunit_try_run_case+0x1a5/0x480
[   27.290921]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.291181]  kthread+0x337/0x6f0
[   27.291339]  ret_from_fork+0x116/0x1d0
[   27.291602]  ret_from_fork_asm+0x1a/0x30
[   27.291780] 
[   27.291845] The buggy address belongs to the object at ffff8881060ae100
[   27.291845]  which belongs to the cache kmalloc-32 of size 32
[   27.292372] The buggy address is located 16 bytes inside of
[   27.292372]  freed 32-byte region [ffff8881060ae100, ffff8881060ae120)
[   27.292833] 
[   27.292902] The buggy address belongs to the physical page:
[   27.293383] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1060ae
[   27.293854] flags: 0x200000000000000(node=0|zone=2)
[   27.294213] page_type: f5(slab)
[   27.294426] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.294709] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.295086] page dumped because: kasan: bad access detected
[   27.295336] 
[   27.295510] Memory state around the buggy address:
[   27.295704]  ffff8881060ae000: 00 00 00 04 fc fc fc fc 00 00 07 fc fc fc fc fc
[   27.295972]  ffff8881060ae080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.296312] >ffff8881060ae100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.296760]                          ^
[   27.296917]  ffff8881060ae180: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.297132]  ffff8881060ae200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.297355] ==================================================================