Hay
Date
July 25, 2025, 3:13 a.m.

Environment
qemu-arm64
qemu-x86_64

[   34.644884] ==================================================================
[   34.644942] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   34.645044] Read of size 1 at addr fff00000c9a94390 by task kunit_try_catch/291
[   34.645230] 
[   34.645703] CPU: 0 UID: 0 PID: 291 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250725 #1 PREEMPT 
[   34.645807] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   34.645842] Hardware name: linux,dummy-virt (DT)
[   34.645875] Call trace:
[   34.645899]  show_stack+0x20/0x38 (C)
[   34.646037]  dump_stack_lvl+0x8c/0xd0
[   34.646091]  print_report+0x118/0x5e8
[   34.646403]  kasan_report+0xdc/0x128
[   34.646534]  __asan_report_load1_noabort+0x20/0x30
[   34.646589]  strnlen+0x80/0x88
[   34.646634]  kasan_strings+0x478/0xb00
[   34.646739]  kunit_try_run_case+0x170/0x3f0
[   34.646815]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.646882]  kthread+0x328/0x630
[   34.646939]  ret_from_fork+0x10/0x20
[   34.647002] 
[   34.647024] Allocated by task 291:
[   34.647069]  kasan_save_stack+0x3c/0x68
[   34.647109]  kasan_save_track+0x20/0x40
[   34.647145]  kasan_save_alloc_info+0x40/0x58
[   34.647186]  __kasan_kmalloc+0xd4/0xd8
[   34.647469]  __kmalloc_cache_noprof+0x16c/0x3c0
[   34.647571]  kasan_strings+0xc8/0xb00
[   34.647650]  kunit_try_run_case+0x170/0x3f0
[   34.647775]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.648250]  kthread+0x328/0x630
[   34.648321]  ret_from_fork+0x10/0x20
[   34.648361] 
[   34.648383] Freed by task 291:
[   34.648414]  kasan_save_stack+0x3c/0x68
[   34.648452]  kasan_save_track+0x20/0x40
[   34.648489]  kasan_save_free_info+0x4c/0x78
[   34.648530]  __kasan_slab_free+0x7c/0xa8
[   34.648576]  kfree+0x214/0x3c8
[   34.648614]  kasan_strings+0x24c/0xb00
[   34.648669]  kunit_try_run_case+0x170/0x3f0
[   34.648709]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.648974]  kthread+0x328/0x630
[   34.649044]  ret_from_fork+0x10/0x20
[   34.649093] 
[   34.649161] The buggy address belongs to the object at fff00000c9a94380
[   34.649161]  which belongs to the cache kmalloc-32 of size 32
[   34.649242] The buggy address is located 16 bytes inside of
[   34.649242]  freed 32-byte region [fff00000c9a94380, fff00000c9a943a0)
[   34.649305] 
[   34.649327] The buggy address belongs to the physical page:
[   34.649365] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a94
[   34.649561] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   34.649616] page_type: f5(slab)
[   34.649667] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   34.649720] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   34.649967] page dumped because: kasan: bad access detected
[   34.650055] 
[   34.650167] Memory state around the buggy address:
[   34.650244]  fff00000c9a94280: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   34.650381]  fff00000c9a94300: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   34.650495] >fff00000c9a94380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   34.650605]                          ^
[   34.650705]  fff00000c9a94400: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   34.650784]  fff00000c9a94480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   34.650902] ==================================================================

[   27.807593] ==================================================================
[   27.808234] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   27.808608] Read of size 1 at addr ffff88810625ff90 by task kunit_try_catch/308
[   27.809242] 
[   27.809348] CPU: 1 UID: 0 PID: 308 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250725 #1 PREEMPT(voluntary) 
[   27.809399] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.809412] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.809434] Call Trace:
[   27.809454]  <TASK>
[   27.809470]  dump_stack_lvl+0x73/0xb0
[   27.809499]  print_report+0xd1/0x640
[   27.809522]  ? __virt_addr_valid+0x1db/0x2d0
[   27.809547]  ? strnlen+0x73/0x80
[   27.809567]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.809595]  ? strnlen+0x73/0x80
[   27.809616]  kasan_report+0x141/0x180
[   27.809640]  ? strnlen+0x73/0x80
[   27.809667]  __asan_report_load1_noabort+0x18/0x20
[   27.809694]  strnlen+0x73/0x80
[   27.809719]  kasan_strings+0x615/0xe80
[   27.809739]  ? trace_hardirqs_on+0x37/0xe0
[   27.809764]  ? __pfx_kasan_strings+0x10/0x10
[   27.809789]  ? finish_task_switch.isra.0+0x153/0x700
[   27.809814]  ? __switch_to+0x47/0xf80
[   27.809842]  ? __schedule+0x10da/0x2b60
[   27.809865]  ? __pfx_read_tsc+0x10/0x10
[   27.809888]  ? ktime_get_ts64+0x86/0x230
[   27.809914]  kunit_try_run_case+0x1a5/0x480
[   27.809940]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.809976]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.809999]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.810027]  ? __kthread_parkme+0x82/0x180
[   27.810049]  ? preempt_count_sub+0x50/0x80
[   27.810241]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.810268]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.810294]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.810321]  kthread+0x337/0x6f0
[   27.810343]  ? trace_preempt_on+0x20/0xc0
[   27.810367]  ? __pfx_kthread+0x10/0x10
[   27.810389]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.810415]  ? calculate_sigpending+0x7b/0xa0
[   27.810439]  ? __pfx_kthread+0x10/0x10
[   27.810462]  ret_from_fork+0x116/0x1d0
[   27.810483]  ? __pfx_kthread+0x10/0x10
[   27.810506]  ret_from_fork_asm+0x1a/0x30
[   27.810538]  </TASK>
[   27.810550] 
[   27.822963] Allocated by task 308:
[   27.823188]  kasan_save_stack+0x45/0x70
[   27.823664]  kasan_save_track+0x18/0x40
[   27.824070]  kasan_save_alloc_info+0x3b/0x50
[   27.824420]  __kasan_kmalloc+0xb7/0xc0
[   27.824726]  __kmalloc_cache_noprof+0x189/0x420
[   27.825157]  kasan_strings+0xc0/0xe80
[   27.825445]  kunit_try_run_case+0x1a5/0x480
[   27.825616]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.826193]  kthread+0x337/0x6f0
[   27.826382]  ret_from_fork+0x116/0x1d0
[   27.826535]  ret_from_fork_asm+0x1a/0x30
[   27.827093] 
[   27.827181] Freed by task 308:
[   27.827501]  kasan_save_stack+0x45/0x70
[   27.827805]  kasan_save_track+0x18/0x40
[   27.828028]  kasan_save_free_info+0x3f/0x60
[   27.828646]  __kasan_slab_free+0x5e/0x80
[   27.828840]  kfree+0x222/0x3f0
[   27.829276]  kasan_strings+0x2aa/0xe80
[   27.829581]  kunit_try_run_case+0x1a5/0x480
[   27.829914]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.830385]  kthread+0x337/0x6f0
[   27.830695]  ret_from_fork+0x116/0x1d0
[   27.831133]  ret_from_fork_asm+0x1a/0x30
[   27.831353] 
[   27.831446] The buggy address belongs to the object at ffff88810625ff80
[   27.831446]  which belongs to the cache kmalloc-32 of size 32
[   27.832062] The buggy address is located 16 bytes inside of
[   27.832062]  freed 32-byte region [ffff88810625ff80, ffff88810625ffa0)
[   27.833064] 
[   27.833188] The buggy address belongs to the physical page:
[   27.833624] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10625f
[   27.834235] flags: 0x200000000000000(node=0|zone=2)
[   27.834554] page_type: f5(slab)
[   27.834737] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.835408] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   27.835807] page dumped because: kasan: bad access detected
[   27.836254] 
[   27.836356] Memory state around the buggy address:
[   27.836583]  ffff88810625fe80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.836901]  ffff88810625ff00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   27.837554] >ffff88810625ff80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.837993]                          ^
[   27.838398]  ffff888106260000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   27.839060]  ffff888106260080: fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb
[   27.839501] ==================================================================