Hay
Date
July 10, 2025, 6:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.192261] ==================================================================
[   19.192436] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   19.192500] Read of size 1 at addr fff00000c5a4d450 by task kunit_try_catch/259
[   19.192553] 
[   19.192677] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.192768] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.192950] Hardware name: linux,dummy-virt (DT)
[   19.192986] Call trace:
[   19.193011]  show_stack+0x20/0x38 (C)
[   19.193066]  dump_stack_lvl+0x8c/0xd0
[   19.193264]  print_report+0x118/0x608
[   19.193332]  kasan_report+0xdc/0x128
[   19.193403]  __asan_report_load1_noabort+0x20/0x30
[   19.193461]  strnlen+0x80/0x88
[   19.193505]  kasan_strings+0x478/0xb00
[   19.193554]  kunit_try_run_case+0x170/0x3f0
[   19.193606]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.193671]  kthread+0x328/0x630
[   19.193717]  ret_from_fork+0x10/0x20
[   19.193768] 
[   19.193791] Allocated by task 259:
[   19.193830]  kasan_save_stack+0x3c/0x68
[   19.193877]  kasan_save_track+0x20/0x40
[   19.194274]  kasan_save_alloc_info+0x40/0x58
[   19.194732]  __kasan_kmalloc+0xd4/0xd8
[   19.194858]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.194932]  kasan_strings+0xc8/0xb00
[   19.195089]  kunit_try_run_case+0x170/0x3f0
[   19.195146]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.195540]  kthread+0x328/0x630
[   19.195661]  ret_from_fork+0x10/0x20
[   19.195830] 
[   19.195955] Freed by task 259:
[   19.196082]  kasan_save_stack+0x3c/0x68
[   19.196165]  kasan_save_track+0x20/0x40
[   19.196400]  kasan_save_free_info+0x4c/0x78
[   19.196555]  __kasan_slab_free+0x6c/0x98
[   19.196708]  kfree+0x214/0x3c8
[   19.196881]  kasan_strings+0x24c/0xb00
[   19.196968]  kunit_try_run_case+0x170/0x3f0
[   19.197040]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.197244]  kthread+0x328/0x630
[   19.197353]  ret_from_fork+0x10/0x20
[   19.197994] 
[   19.198256] The buggy address belongs to the object at fff00000c5a4d440
[   19.198256]  which belongs to the cache kmalloc-32 of size 32
[   19.198463] The buggy address is located 16 bytes inside of
[   19.198463]  freed 32-byte region [fff00000c5a4d440, fff00000c5a4d460)
[   19.198558] 
[   19.198583] The buggy address belongs to the physical page:
[   19.199001] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105a4d
[   19.199085] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.199230] page_type: f5(slab)
[   19.199328] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   19.199554] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   19.199823] page dumped because: kasan: bad access detected
[   19.199877] 
[   19.199989] Memory state around the buggy address:
[   19.200087]  fff00000c5a4d300: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.200352]  fff00000c5a4d380: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   19.200426] >fff00000c5a4d400: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.200665]                                                  ^
[   19.200993]  fff00000c5a4d480: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   19.201188]  fff00000c5a4d500: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   19.201309] ==================================================================

[   14.480739] ==================================================================
[   14.480975] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   14.481836] Read of size 1 at addr ffff8881027b2750 by task kunit_try_catch/276
[   14.482202] 
[   14.482296] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.482339] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.482350] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.482370] Call Trace:
[   14.482384]  <TASK>
[   14.482399]  dump_stack_lvl+0x73/0xb0
[   14.482428]  print_report+0xd1/0x650
[   14.482449]  ? __virt_addr_valid+0x1db/0x2d0
[   14.482472]  ? strnlen+0x73/0x80
[   14.482489]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.482515]  ? strnlen+0x73/0x80
[   14.482534]  kasan_report+0x141/0x180
[   14.482556]  ? strnlen+0x73/0x80
[   14.482579]  __asan_report_load1_noabort+0x18/0x20
[   14.482604]  strnlen+0x73/0x80
[   14.482622]  kasan_strings+0x615/0xe80
[   14.482642]  ? trace_hardirqs_on+0x37/0xe0
[   14.482664]  ? __pfx_kasan_strings+0x10/0x10
[   14.482687]  ? __kasan_check_write+0x18/0x20
[   14.482706]  ? queued_spin_lock_slowpath+0x116/0xb40
[   14.482730]  ? irqentry_exit+0x2a/0x60
[   14.482752]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   14.482778]  ? trace_hardirqs_on+0x37/0xe0
[   14.482801]  ? __pfx_read_tsc+0x10/0x10
[   14.482821]  ? ktime_get_ts64+0x86/0x230
[   14.482846]  kunit_try_run_case+0x1a5/0x480
[   14.482869]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.482894]  ? queued_spin_lock_slowpath+0x116/0xb40
[   14.482918]  ? __kthread_parkme+0x82/0x180
[   14.482940]  ? preempt_count_sub+0x50/0x80
[   14.482963]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.482987]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.483012]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.483048]  kthread+0x337/0x6f0
[   14.483068]  ? trace_preempt_on+0x20/0xc0
[   14.483089]  ? __pfx_kthread+0x10/0x10
[   14.483109]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.483130]  ? calculate_sigpending+0x7b/0xa0
[   14.483153]  ? __pfx_kthread+0x10/0x10
[   14.483174]  ret_from_fork+0x116/0x1d0
[   14.483193]  ? __pfx_kthread+0x10/0x10
[   14.483214]  ret_from_fork_asm+0x1a/0x30
[   14.483245]  </TASK>
[   14.483254] 
[   14.491433] Allocated by task 276:
[   14.491615]  kasan_save_stack+0x45/0x70
[   14.491809]  kasan_save_track+0x18/0x40
[   14.492204]  kasan_save_alloc_info+0x3b/0x50
[   14.492392]  __kasan_kmalloc+0xb7/0xc0
[   14.492528]  __kmalloc_cache_noprof+0x189/0x420
[   14.492686]  kasan_strings+0xc0/0xe80
[   14.492938]  kunit_try_run_case+0x1a5/0x480
[   14.493168]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.493422]  kthread+0x337/0x6f0
[   14.493588]  ret_from_fork+0x116/0x1d0
[   14.493781]  ret_from_fork_asm+0x1a/0x30
[   14.494120] 
[   14.494218] Freed by task 276:
[   14.494357]  kasan_save_stack+0x45/0x70
[   14.494514]  kasan_save_track+0x18/0x40
[   14.494705]  kasan_save_free_info+0x3f/0x60
[   14.494884]  __kasan_slab_free+0x56/0x70
[   14.495093]  kfree+0x222/0x3f0
[   14.495258]  kasan_strings+0x2aa/0xe80
[   14.495390]  kunit_try_run_case+0x1a5/0x480
[   14.495535]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.495709]  kthread+0x337/0x6f0
[   14.495826]  ret_from_fork+0x116/0x1d0
[   14.496164]  ret_from_fork_asm+0x1a/0x30
[   14.496433] 
[   14.496527] The buggy address belongs to the object at ffff8881027b2740
[   14.496527]  which belongs to the cache kmalloc-32 of size 32
[   14.497088] The buggy address is located 16 bytes inside of
[   14.497088]  freed 32-byte region [ffff8881027b2740, ffff8881027b2760)
[   14.497437] 
[   14.497508] The buggy address belongs to the physical page:
[   14.497683] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027b2
[   14.498484] flags: 0x200000000000000(node=0|zone=2)
[   14.498734] page_type: f5(slab)
[   14.498924] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.499296] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.499727] page dumped because: kasan: bad access detected
[   14.500000] 
[   14.500099] Memory state around the buggy address:
[   14.500387]  ffff8881027b2600: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.500641]  ffff8881027b2680: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.501157] >ffff8881027b2700: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.501385]                                                  ^
[   14.501623]  ffff8881027b2780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.502067]  ffff8881027b2800: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   14.502301] ==================================================================