Hay
Date
July 9, 2025, 1:08 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.654519] ==================================================================
[   31.654579] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   31.654996] Read of size 1 at addr fff00000c9c23a10 by task kunit_try_catch/291
[   31.655426] 
[   31.655470] CPU: 1 UID: 0 PID: 291 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250709 #1 PREEMPT 
[   31.655587] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.655872] Hardware name: linux,dummy-virt (DT)
[   31.655941] Call trace:
[   31.655986]  show_stack+0x20/0x38 (C)
[   31.656328]  dump_stack_lvl+0x8c/0xd0
[   31.656568]  print_report+0x118/0x5d0
[   31.656738]  kasan_report+0xdc/0x128
[   31.656998]  __asan_report_load1_noabort+0x20/0x30
[   31.657420]  strnlen+0x80/0x88
[   31.657625]  kasan_strings+0x478/0xb00
[   31.657883]  kunit_try_run_case+0x170/0x3f0
[   31.658070]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.658184]  kthread+0x328/0x630
[   31.658271]  ret_from_fork+0x10/0x20
[   31.658782] 
[   31.658835] Allocated by task 291:
[   31.658981]  kasan_save_stack+0x3c/0x68
[   31.659118]  kasan_save_track+0x20/0x40
[   31.659181]  kasan_save_alloc_info+0x40/0x58
[   31.659276]  __kasan_kmalloc+0xd4/0xd8
[   31.659401]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.659605]  kasan_strings+0xc8/0xb00
[   31.659658]  kunit_try_run_case+0x170/0x3f0
[   31.659823]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.659878]  kthread+0x328/0x630
[   31.659927]  ret_from_fork+0x10/0x20
[   31.660303] 
[   31.660353] Freed by task 291:
[   31.660496]  kasan_save_stack+0x3c/0x68
[   31.660549]  kasan_save_track+0x20/0x40
[   31.660592]  kasan_save_free_info+0x4c/0x78
[   31.660642]  __kasan_slab_free+0x6c/0x98
[   31.660714]  kfree+0x214/0x3c8
[   31.660762]  kasan_strings+0x24c/0xb00
[   31.660810]  kunit_try_run_case+0x170/0x3f0
[   31.660858]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.661265]  kthread+0x328/0x630
[   31.661435]  ret_from_fork+0x10/0x20
[   31.662035] 
[   31.662092] The buggy address belongs to the object at fff00000c9c23a00
[   31.662092]  which belongs to the cache kmalloc-32 of size 32
[   31.662296] The buggy address is located 16 bytes inside of
[   31.662296]  freed 32-byte region [fff00000c9c23a00, fff00000c9c23a20)
[   31.662664] 
[   31.662716] The buggy address belongs to the physical page:
[   31.662783] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109c23
[   31.662888] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.663065] page_type: f5(slab)
[   31.663190] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   31.663356] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   31.663474] page dumped because: kasan: bad access detected
[   31.663532] 
[   31.663864] Memory state around the buggy address:
[   31.663946]  fff00000c9c23900: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   31.664045]  fff00000c9c23980: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   31.664186] >fff00000c9c23a00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   31.664227]                          ^
[   31.664259]  fff00000c9c23a80: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   31.664560]  fff00000c9c23b00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   31.664668] ==================================================================

[   26.109908] ==================================================================
[   26.110262] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   26.110522] Read of size 1 at addr ffff88810539c3d0 by task kunit_try_catch/309
[   26.110849] 
[   26.110940] CPU: 1 UID: 0 PID: 309 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc5-next-20250709 #1 PREEMPT(voluntary) 
[   26.111041] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   26.111055] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.111077] Call Trace:
[   26.111096]  <TASK>
[   26.111113]  dump_stack_lvl+0x73/0xb0
[   26.111143]  print_report+0xd1/0x610
[   26.111165]  ? __virt_addr_valid+0x1db/0x2d0
[   26.111190]  ? strnlen+0x73/0x80
[   26.111209]  ? kasan_complete_mode_report_info+0x64/0x200
[   26.111235]  ? strnlen+0x73/0x80
[   26.111254]  kasan_report+0x141/0x180
[   26.111278]  ? strnlen+0x73/0x80
[   26.111301]  __asan_report_load1_noabort+0x18/0x20
[   26.111325]  strnlen+0x73/0x80
[   26.111345]  kasan_strings+0x615/0xe80
[   26.111364]  ? trace_hardirqs_on+0x37/0xe0
[   26.111388]  ? __pfx_kasan_strings+0x10/0x10
[   26.111408]  ? finish_task_switch.isra.0+0x153/0x700
[   26.111432]  ? __switch_to+0x47/0xf80
[   26.111458]  ? __schedule+0x10cc/0x2b60
[   26.111482]  ? __pfx_read_tsc+0x10/0x10
[   26.111504]  ? ktime_get_ts64+0x86/0x230
[   26.111530]  kunit_try_run_case+0x1a5/0x480
[   26.111551]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.111571]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.111594]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.111618]  ? __kthread_parkme+0x82/0x180
[   26.111638]  ? preempt_count_sub+0x50/0x80
[   26.111661]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.111682]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.111719]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.111744]  kthread+0x337/0x6f0
[   26.111764]  ? trace_preempt_on+0x20/0xc0
[   26.111785]  ? __pfx_kthread+0x10/0x10
[   26.111806]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.111834]  ? calculate_sigpending+0x7b/0xa0
[   26.111858]  ? __pfx_kthread+0x10/0x10
[   26.111879]  ret_from_fork+0x116/0x1d0
[   26.111899]  ? __pfx_kthread+0x10/0x10
[   26.111920]  ret_from_fork_asm+0x1a/0x30
[   26.111950]  </TASK>
[   26.111961] 
[   26.120010] Allocated by task 309:
[   26.120146]  kasan_save_stack+0x45/0x70
[   26.120290]  kasan_save_track+0x18/0x40
[   26.120420]  kasan_save_alloc_info+0x3b/0x50
[   26.120563]  __kasan_kmalloc+0xb7/0xc0
[   26.120690]  __kmalloc_cache_noprof+0x189/0x420
[   26.120854]  kasan_strings+0xc0/0xe80
[   26.120978]  kunit_try_run_case+0x1a5/0x480
[   26.121175]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.121422]  kthread+0x337/0x6f0
[   26.121793]  ret_from_fork+0x116/0x1d0
[   26.121983]  ret_from_fork_asm+0x1a/0x30
[   26.122172] 
[   26.122259] Freed by task 309:
[   26.122549]  kasan_save_stack+0x45/0x70
[   26.122757]  kasan_save_track+0x18/0x40
[   26.123084]  kasan_save_free_info+0x3f/0x60
[   26.123291]  __kasan_slab_free+0x56/0x70
[   26.123482]  kfree+0x222/0x3f0
[   26.123640]  kasan_strings+0x2aa/0xe80
[   26.123871]  kunit_try_run_case+0x1a5/0x480
[   26.124079]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.124330]  kthread+0x337/0x6f0
[   26.124442]  ret_from_fork+0x116/0x1d0
[   26.124564]  ret_from_fork_asm+0x1a/0x30
[   26.124704] 
[   26.124769] The buggy address belongs to the object at ffff88810539c3c0
[   26.124769]  which belongs to the cache kmalloc-32 of size 32
[   26.125530] The buggy address is located 16 bytes inside of
[   26.125530]  freed 32-byte region [ffff88810539c3c0, ffff88810539c3e0)
[   26.126402] 
[   26.126520] The buggy address belongs to the physical page:
[   26.126747] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10539c
[   26.127161] flags: 0x200000000000000(node=0|zone=2)
[   26.127378] page_type: f5(slab)
[   26.127493] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   26.127720] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   26.128084] page dumped because: kasan: bad access detected
[   26.128433] 
[   26.128528] Memory state around the buggy address:
[   26.128689]  ffff88810539c280: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   26.129277]  ffff88810539c300: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   26.129558] >ffff88810539c380: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.129846]                                                  ^
[   26.130339]  ffff88810539c400: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   26.130587]  ffff88810539c480: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   26.130798] ==================================================================