Hay
Date
June 3, 2025, 7:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   20.726443] ==================================================================
[   20.726495] BUG: KASAN: slab-use-after-free in strnlen+0x80/0x88
[   20.726546] Read of size 1 at addr fff00000c58ba050 by task kunit_try_catch/259
[   20.726597] 
[   20.726627] CPU: 1 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250603 #1 PREEMPT 
[   20.726713] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.726741] Hardware name: linux,dummy-virt (DT)
[   20.726772] Call trace:
[   20.726977]  show_stack+0x20/0x38 (C)
[   20.727044]  dump_stack_lvl+0x8c/0xd0
[   20.727094]  print_report+0x118/0x608
[   20.727369]  kasan_report+0xdc/0x128
[   20.727492]  __asan_report_load1_noabort+0x20/0x30
[   20.727640]  strnlen+0x80/0x88
[   20.727732]  kasan_strings+0x478/0xb00
[   20.727861]  kunit_try_run_case+0x170/0x3f0
[   20.727970]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.728167]  kthread+0x328/0x630
[   20.728249]  ret_from_fork+0x10/0x20
[   20.728324] 
[   20.728345] Allocated by task 259:
[   20.728376]  kasan_save_stack+0x3c/0x68
[   20.728420]  kasan_save_track+0x20/0x40
[   20.728471]  kasan_save_alloc_info+0x40/0x58
[   20.728510]  __kasan_kmalloc+0xd4/0xd8
[   20.728755]  __kmalloc_cache_noprof+0x16c/0x3c0
[   20.728899]  kasan_strings+0xc8/0xb00
[   20.728952]  kunit_try_run_case+0x170/0x3f0
[   20.729003]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.729049]  kthread+0x328/0x630
[   20.729094]  ret_from_fork+0x10/0x20
[   20.729142] 
[   20.729172] Freed by task 259:
[   20.729203]  kasan_save_stack+0x3c/0x68
[   20.729242]  kasan_save_track+0x20/0x40
[   20.729285]  kasan_save_free_info+0x4c/0x78
[   20.729322]  __kasan_slab_free+0x6c/0x98
[   20.729371]  kfree+0x214/0x3c8
[   20.729431]  kasan_strings+0x24c/0xb00
[   20.729470]  kunit_try_run_case+0x170/0x3f0
[   20.729510]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.729557]  kthread+0x328/0x630
[   20.729592]  ret_from_fork+0x10/0x20
[   20.729636] 
[   20.729659] The buggy address belongs to the object at fff00000c58ba040
[   20.729659]  which belongs to the cache kmalloc-32 of size 32
[   20.729733] The buggy address is located 16 bytes inside of
[   20.729733]  freed 32-byte region [fff00000c58ba040, fff00000c58ba060)
[   20.729812] 
[   20.729842] The buggy address belongs to the physical page:
[   20.729875] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058ba
[   20.729944] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.730003] page_type: f5(slab)
[   20.730043] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   20.730105] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   20.730148] page dumped because: kasan: bad access detected
[   20.730180] 
[   20.730227] Memory state around the buggy address:
[   20.730262]  fff00000c58b9f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.730307]  fff00000c58b9f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.730360] >fff00000c58ba000: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   20.730408]                                                  ^
[   20.730929]  fff00000c58ba080: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.731186]  fff00000c58ba100: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   20.731319] ==================================================================


[   16.906913] ==================================================================
[   16.907950] BUG: KASAN: slab-use-after-free in strnlen+0x73/0x80
[   16.908343] Read of size 1 at addr ffff888103349910 by task kunit_try_catch/276
[   16.908545] 
[   16.908718] CPU: 1 UID: 0 PID: 276 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250603 #1 PREEMPT(voluntary) 
[   16.908775] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.908790] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   16.908814] Call Trace:
[   16.908923]  <TASK>
[   16.908949]  dump_stack_lvl+0x73/0xb0
[   16.908982]  print_report+0xd1/0x650
[   16.909009]  ? __virt_addr_valid+0x1db/0x2d0
[   16.909036]  ? strnlen+0x73/0x80
[   16.909057]  ? kasan_complete_mode_report_info+0x64/0x200
[   16.909081]  ? strnlen+0x73/0x80
[   16.909102]  kasan_report+0x141/0x180
[   16.909126]  ? strnlen+0x73/0x80
[   16.909152]  __asan_report_load1_noabort+0x18/0x20
[   16.909175]  strnlen+0x73/0x80
[   16.909196]  kasan_strings+0x615/0xe80
[   16.909276]  ? trace_hardirqs_on+0x37/0xe0
[   16.909338]  ? __pfx_kasan_strings+0x10/0x10
[   16.909365]  ? finish_task_switch.isra.0+0x153/0x700
[   16.909396]  ? __switch_to+0x47/0xf50
[   16.909426]  ? __schedule+0x10cc/0x2b60
[   16.909465]  ? __pfx_read_tsc+0x10/0x10
[   16.909496]  ? ktime_get_ts64+0x86/0x230
[   16.909524]  kunit_try_run_case+0x1a5/0x480
[   16.909550]  ? __pfx_kunit_try_run_case+0x10/0x10
[   16.909599]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   16.909639]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   16.909667]  ? __kthread_parkme+0x82/0x180
[   16.909703]  ? preempt_count_sub+0x50/0x80
[   16.909732]  ? __pfx_kunit_try_run_case+0x10/0x10
[   16.909757]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   16.909783]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   16.909810]  kthread+0x337/0x6f0
[   16.909831]  ? trace_preempt_on+0x20/0xc0
[   16.909892]  ? __pfx_kthread+0x10/0x10
[   16.909917]  ? _raw_spin_unlock_irq+0x47/0x80
[   16.909944]  ? calculate_sigpending+0x7b/0xa0
[   16.909971]  ? __pfx_kthread+0x10/0x10
[   16.909994]  ret_from_fork+0x116/0x1d0
[   16.910016]  ? __pfx_kthread+0x10/0x10
[   16.910038]  ret_from_fork_asm+0x1a/0x30
[   16.910073]  </TASK>
[   16.910087] 
[   16.920681] Allocated by task 276:
[   16.921055]  kasan_save_stack+0x45/0x70
[   16.921375]  kasan_save_track+0x18/0x40
[   16.921668]  kasan_save_alloc_info+0x3b/0x50
[   16.922005]  __kasan_kmalloc+0xb7/0xc0
[   16.922276]  __kmalloc_cache_noprof+0x189/0x420
[   16.922530]  kasan_strings+0xc0/0xe80
[   16.922745]  kunit_try_run_case+0x1a5/0x480
[   16.923011]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   16.923365]  kthread+0x337/0x6f0
[   16.923591]  ret_from_fork+0x116/0x1d0
[   16.923942]  ret_from_fork_asm+0x1a/0x30
[   16.924198] 
[   16.924337] Freed by task 276:
[   16.924544]  kasan_save_stack+0x45/0x70
[   16.924812]  kasan_save_track+0x18/0x40
[   16.925059]  kasan_save_free_info+0x3f/0x60
[   16.925320]  __kasan_slab_free+0x56/0x70
[   16.925601]  kfree+0x222/0x3f0
[   16.925885]  kasan_strings+0x2aa/0xe80
[   16.926071]  kunit_try_run_case+0x1a5/0x480
[   16.926403]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   16.926580]  kthread+0x337/0x6f0
[   16.926912]  ret_from_fork+0x116/0x1d0
[   16.927073]  ret_from_fork_asm+0x1a/0x30
[   16.927308] 
[   16.927416] The buggy address belongs to the object at ffff888103349900
[   16.927416]  which belongs to the cache kmalloc-32 of size 32
[   16.928046] The buggy address is located 16 bytes inside of
[   16.928046]  freed 32-byte region [ffff888103349900, ffff888103349920)
[   16.928761] 
[   16.928914] The buggy address belongs to the physical page:
[   16.929051] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103349
[   16.929258] flags: 0x200000000000000(node=0|zone=2)
[   16.929398] page_type: f5(slab)
[   16.929644] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   16.930279] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   16.930492] page dumped because: kasan: bad access detected
[   16.930667] 
[   16.930817] Memory state around the buggy address:
[   16.931165]  ffff888103349800: 00 00 00 04 fc fc fc fc fa fb fb fb fc fc fc fc
[   16.931696]  ffff888103349880: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   16.932024] >ffff888103349900: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   16.932329]                          ^
[   16.932631]  ffff888103349980: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   16.932995]  ffff888103349a00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   16.933487] ==================================================================