Hay
Date
May 23, 2025, 11:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.064332] ==================================================================
[   31.064506] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   31.064657] Read of size 1 at addr fff00000c77a2dd0 by task kunit_try_catch/261
[   31.064810] 
[   31.064909] CPU: 0 UID: 0 PID: 261 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7 #1 PREEMPT 
[   31.065162] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.065251] Hardware name: linux,dummy-virt (DT)
[   31.065731] Call trace:
[   31.065934]  show_stack+0x20/0x38 (C)
[   31.066107]  dump_stack_lvl+0x8c/0xd0
[   31.066257]  print_report+0x118/0x608
[   31.066387]  kasan_report+0xdc/0x128
[   31.066595]  __asan_report_load1_noabort+0x20/0x30
[   31.066848]  strnlen+0x80/0x88
[   31.067396]  kasan_strings+0x478/0xb00
[   31.067585]  kunit_try_run_case+0x170/0x3f0
[   31.067862]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.068393]  kthread+0x328/0x630
[   31.068587]  ret_from_fork+0x10/0x20
[   31.068887] 
[   31.068971] Allocated by task 261:
[   31.069166]  kasan_save_stack+0x3c/0x68
[   31.069386]  kasan_save_track+0x20/0x40
[   31.069617]  kasan_save_alloc_info+0x40/0x58
[   31.069834]  __kasan_kmalloc+0xd4/0xd8
[   31.070408]  __kmalloc_cache_noprof+0x15c/0x3c0
[   31.070664]  kasan_strings+0xc8/0xb00
[   31.070827]  kunit_try_run_case+0x170/0x3f0
[   31.071055]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.071286]  kthread+0x328/0x630
[   31.071427]  ret_from_fork+0x10/0x20
[   31.071781] 
[   31.071870] Freed by task 261:
[   31.072115]  kasan_save_stack+0x3c/0x68
[   31.072268]  kasan_save_track+0x20/0x40
[   31.072415]  kasan_save_free_info+0x4c/0x78
[   31.072582]  __kasan_slab_free+0x6c/0x98
[   31.072698]  kfree+0x214/0x3c8
[   31.072926]  kasan_strings+0x24c/0xb00
[   31.073052]  kunit_try_run_case+0x170/0x3f0
[   31.073224]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.073383]  kthread+0x328/0x630
[   31.073494]  ret_from_fork+0x10/0x20
[   31.073582] 
[   31.073630] The buggy address belongs to the object at fff00000c77a2dc0
[   31.073630]  which belongs to the cache kmalloc-32 of size 32
[   31.073785] The buggy address is located 16 bytes inside of
[   31.073785]  freed 32-byte region [fff00000c77a2dc0, fff00000c77a2de0)
[   31.074027] 
[   31.074120] The buggy address belongs to the physical page:
[   31.074261] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1077a2
[   31.074482] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.074624] page_type: f5(slab)
[   31.074933] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   31.075216] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   31.075341] page dumped because: kasan: bad access detected
[   31.075475] 
[   31.075532] Memory state around the buggy address:
[   31.075637]  fff00000c77a2c80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   31.075776]  fff00000c77a2d00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   31.075924] >fff00000c77a2d80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   31.076038]                                                  ^
[   31.076580]  fff00000c77a2e00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   31.076784]  fff00000c77a2e80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   31.076960] ==================================================================

[   14.574353] ==================================================================
[   14.574758] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   14.575077] Read of size 1 at addr ffff888102714790 by task kunit_try_catch/278
[   14.575547] 
[   14.575671] CPU: 0 UID: 0 PID: 278 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7 #1 PREEMPT(voluntary) 
[   14.575716] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.575728] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.575747] Call Trace:
[   14.575762]  <TASK>
[   14.575777]  dump_stack_lvl+0x73/0xb0
[   14.575804]  print_report+0xd1/0x650
[   14.575826]  ? __virt_addr_valid+0x1db/0x2d0
[   14.575847]  ? strnlen+0x73/0x80
[   14.575884]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.575907]  ? strnlen+0x73/0x80
[   14.575925]  kasan_report+0x141/0x180
[   14.575948]  ? strnlen+0x73/0x80
[   14.575971]  __asan_report_load1_noabort+0x18/0x20
[   14.575992]  strnlen+0x73/0x80
[   14.576011]  kasan_strings+0x615/0xe80
[   14.576031]  ? trace_hardirqs_on+0x37/0xe0
[   14.576054]  ? __pfx_kasan_strings+0x10/0x10
[   14.576075]  ? finish_task_switch.isra.0+0x153/0x700
[   14.576098]  ? __switch_to+0x5d9/0xf60
[   14.576117]  ? dequeue_task_fair+0x156/0x4e0
[   14.576141]  ? __schedule+0x10cc/0x2b30
[   14.576163]  ? __pfx_read_tsc+0x10/0x10
[   14.576183]  ? ktime_get_ts64+0x86/0x230
[   14.576207]  kunit_try_run_case+0x1a5/0x480
[   14.576231]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.576253]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.576276]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.576308]  ? __kthread_parkme+0x82/0x180
[   14.576328]  ? preempt_count_sub+0x50/0x80
[   14.576353]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.576375]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.576398]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.576437]  kthread+0x337/0x6f0
[   14.576454]  ? trace_preempt_on+0x20/0xc0
[   14.576477]  ? __pfx_kthread+0x10/0x10
[   14.576495]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.576516]  ? calculate_sigpending+0x7b/0xa0
[   14.576537]  ? __pfx_kthread+0x10/0x10
[   14.576556]  ret_from_fork+0x41/0x80
[   14.576576]  ? __pfx_kthread+0x10/0x10
[   14.576595]  ret_from_fork_asm+0x1a/0x30
[   14.576626]  </TASK>
[   14.576637] 
[   14.584008] Allocated by task 278:
[   14.584186]  kasan_save_stack+0x45/0x70
[   14.584392]  kasan_save_track+0x18/0x40
[   14.584613]  kasan_save_alloc_info+0x3b/0x50
[   14.584821]  __kasan_kmalloc+0xb7/0xc0
[   14.584996]  __kmalloc_cache_noprof+0x189/0x420
[   14.585180]  kasan_strings+0xc0/0xe80
[   14.585361]  kunit_try_run_case+0x1a5/0x480
[   14.585571]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.585830]  kthread+0x337/0x6f0
[   14.585971]  ret_from_fork+0x41/0x80
[   14.586126]  ret_from_fork_asm+0x1a/0x30
[   14.586269] 
[   14.586349] Freed by task 278:
[   14.586480]  kasan_save_stack+0x45/0x70
[   14.586664]  kasan_save_track+0x18/0x40
[   14.586862]  kasan_save_free_info+0x3f/0x60
[   14.587066]  __kasan_slab_free+0x56/0x70
[   14.587261]  kfree+0x222/0x3f0
[   14.587456]  kasan_strings+0x2aa/0xe80
[   14.587646]  kunit_try_run_case+0x1a5/0x480
[   14.587840]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.588016]  kthread+0x337/0x6f0
[   14.588134]  ret_from_fork+0x41/0x80
[   14.588323]  ret_from_fork_asm+0x1a/0x30
[   14.588548] 
[   14.588642] The buggy address belongs to the object at ffff888102714780
[   14.588642]  which belongs to the cache kmalloc-32 of size 32
[   14.589182] The buggy address is located 16 bytes inside of
[   14.589182]  freed 32-byte region [ffff888102714780, ffff8881027147a0)
[   14.589655] 
[   14.589730] The buggy address belongs to the physical page:
[   14.589903] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102714
[   14.590145] flags: 0x200000000000000(node=0|zone=2)
[   14.590317] page_type: f5(slab)
[   14.590458] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.590727] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.591073] page dumped because: kasan: bad access detected
[   14.591340] 
[   14.591454] Memory state around the buggy address:
[   14.591680]  ffff888102714680: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.592002]  ffff888102714700: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   14.592250] >ffff888102714780: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.592498]                          ^
[   14.592628]  ffff888102714800: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.592844]  ffff888102714880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.593058] ==================================================================