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

Environment
qemu-arm64
qemu-x86_64

[   32.830011] ==================================================================
[   32.830062] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   32.830114] Read of size 1 at addr fff00000c9c2cc50 by task kunit_try_catch/292
[   32.830182] 
[   32.830219] CPU: 1 UID: 0 PID: 292 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250723 #1 PREEMPT 
[   32.830351] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   32.830401] Hardware name: linux,dummy-virt (DT)
[   32.830435] Call trace:
[   32.830476]  show_stack+0x20/0x38 (C)
[   32.830539]  dump_stack_lvl+0x8c/0xd0
[   32.830586]  print_report+0x118/0x5e8
[   32.830637]  kasan_report+0xdc/0x128
[   32.830680]  __asan_report_load1_noabort+0x20/0x30
[   32.830738]  strnlen+0x80/0x88
[   32.830783]  kasan_strings+0x478/0xb00
[   32.830830]  kunit_try_run_case+0x170/0x3f0
[   32.830877]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.830940]  kthread+0x328/0x630
[   32.830983]  ret_from_fork+0x10/0x20
[   32.831029] 
[   32.831254] Allocated by task 292:
[   32.831308]  kasan_save_stack+0x3c/0x68
[   32.831367]  kasan_save_track+0x20/0x40
[   32.831407]  kasan_save_alloc_info+0x40/0x58
[   32.831454]  __kasan_kmalloc+0xd4/0xd8
[   32.831491]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.831534]  kasan_strings+0xc8/0xb00
[   32.831572]  kunit_try_run_case+0x170/0x3f0
[   32.831612]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.831675]  kthread+0x328/0x630
[   32.831743]  ret_from_fork+0x10/0x20
[   32.831783] 
[   32.831805] Freed by task 292:
[   32.831840]  kasan_save_stack+0x3c/0x68
[   32.831879]  kasan_save_track+0x20/0x40
[   32.831928]  kasan_save_free_info+0x4c/0x78
[   32.831967]  __kasan_slab_free+0x6c/0x98
[   32.832005]  kfree+0x214/0x3c8
[   32.832041]  kasan_strings+0x24c/0xb00
[   32.832081]  kunit_try_run_case+0x170/0x3f0
[   32.832146]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.832192]  kthread+0x328/0x630
[   32.832228]  ret_from_fork+0x10/0x20
[   32.832426] 
[   32.832449] The buggy address belongs to the object at fff00000c9c2cc40
[   32.832449]  which belongs to the cache kmalloc-32 of size 32
[   32.832519] The buggy address is located 16 bytes inside of
[   32.832519]  freed 32-byte region [fff00000c9c2cc40, fff00000c9c2cc60)
[   32.832662] 
[   32.832732] The buggy address belongs to the physical page:
[   32.832787] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109c2c
[   32.832844] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.832893] page_type: f5(slab)
[   32.832942] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   32.833012] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   32.833053] page dumped because: kasan: bad access detected
[   32.833085] 
[   32.833105] Memory state around the buggy address:
[   32.833158]  fff00000c9c2cb00: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   32.833382]  fff00000c9c2cb80: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   32.833467] >fff00000c9c2cc00: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   32.833582]                                                  ^
[   32.833655]  fff00000c9c2cc80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   32.833700]  fff00000c9c2cd00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   32.833739] ==================================================================

[   27.297735] ==================================================================
[   27.298183] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   27.298463] Read of size 1 at addr ffff8881060ae110 by task kunit_try_catch/308
[   27.298777] 
[   27.298881] CPU: 1 UID: 0 PID: 308 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT(voluntary) 
[   27.298930] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.298942] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.298964] Call Trace:
[   27.298981]  <TASK>
[   27.298998]  dump_stack_lvl+0x73/0xb0
[   27.299022]  print_report+0xd1/0x640
[   27.299045]  ? __virt_addr_valid+0x1db/0x2d0
[   27.299069]  ? strnlen+0x73/0x80
[   27.299089]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.299115]  ? strnlen+0x73/0x80
[   27.299134]  kasan_report+0x141/0x180
[   27.299167]  ? strnlen+0x73/0x80
[   27.299191]  __asan_report_load1_noabort+0x18/0x20
[   27.299215]  strnlen+0x73/0x80
[   27.299236]  kasan_strings+0x615/0xe80
[   27.299256]  ? trace_hardirqs_on+0x37/0xe0
[   27.299279]  ? __pfx_kasan_strings+0x10/0x10
[   27.299298]  ? finish_task_switch.isra.0+0x153/0x700
[   27.299320]  ? __switch_to+0x47/0xf80
[   27.299345]  ? __schedule+0x10da/0x2b60
[   27.299369]  ? __pfx_read_tsc+0x10/0x10
[   27.299391]  ? ktime_get_ts64+0x86/0x230
[   27.299414]  kunit_try_run_case+0x1a5/0x480
[   27.299438]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.299461]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.299500]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.299526]  ? __kthread_parkme+0x82/0x180
[   27.299546]  ? preempt_count_sub+0x50/0x80
[   27.299569]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.299593]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.299616]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.299644]  kthread+0x337/0x6f0
[   27.299664]  ? trace_preempt_on+0x20/0xc0
[   27.299687]  ? __pfx_kthread+0x10/0x10
[   27.299707]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.299731]  ? calculate_sigpending+0x7b/0xa0
[   27.299754]  ? __pfx_kthread+0x10/0x10
[   27.299776]  ret_from_fork+0x116/0x1d0
[   27.299795]  ? __pfx_kthread+0x10/0x10
[   27.299816]  ret_from_fork_asm+0x1a/0x30
[   27.299847]  </TASK>
[   27.299858] 
[   27.307864] Allocated by task 308:
[   27.308158]  kasan_save_stack+0x45/0x70
[   27.308334]  kasan_save_track+0x18/0x40
[   27.308618]  kasan_save_alloc_info+0x3b/0x50
[   27.308793]  __kasan_kmalloc+0xb7/0xc0
[   27.309003]  __kmalloc_cache_noprof+0x189/0x420
[   27.309202]  kasan_strings+0xc0/0xe80
[   27.309418]  kunit_try_run_case+0x1a5/0x480
[   27.309572]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.309816]  kthread+0x337/0x6f0
[   27.309944]  ret_from_fork+0x116/0x1d0
[   27.310189]  ret_from_fork_asm+0x1a/0x30
[   27.310377] 
[   27.310480] Freed by task 308:
[   27.310586]  kasan_save_stack+0x45/0x70
[   27.310716]  kasan_save_track+0x18/0x40
[   27.310843]  kasan_save_free_info+0x3f/0x60
[   27.310982]  __kasan_slab_free+0x56/0x70
[   27.311111]  kfree+0x222/0x3f0
[   27.311469]  kasan_strings+0x2aa/0xe80
[   27.311681]  kunit_try_run_case+0x1a5/0x480
[   27.311885]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.312126]  kthread+0x337/0x6f0
[   27.312298]  ret_from_fork+0x116/0x1d0
[   27.312477]  ret_from_fork_asm+0x1a/0x30
[   27.312880] 
[   27.313022] The buggy address belongs to the object at ffff8881060ae100
[   27.313022]  which belongs to the cache kmalloc-32 of size 32
[   27.313567] The buggy address is located 16 bytes inside of
[   27.313567]  freed 32-byte region [ffff8881060ae100, ffff8881060ae120)
[   27.314041] 
[   27.314137] The buggy address belongs to the physical page:
[   27.314373] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1060ae
[   27.314737] flags: 0x200000000000000(node=0|zone=2)
[   27.314955] page_type: f5(slab)
[   27.315100] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   27.315441] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   27.315726] page dumped because: kasan: bad access detected
[   27.315905] 
[   27.316036] Memory state around the buggy address:
[   27.316432]  ffff8881060ae000: 00 00 00 04 fc fc fc fc 00 00 07 fc fc fc fc fc
[   27.316723]  ffff8881060ae080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.317039] >ffff8881060ae100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.317299]                          ^
[   27.317607]  ffff8881060ae180: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   27.317897]  ffff8881060ae200: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   27.318216] ==================================================================