Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   24.014843] ==================================================================
[   24.015992] BUG: KASAN: slab-use-after-free in strrchr+0x6c/0x78
[   24.016683] Read of size 1 at addr fff00000c41f1950 by task kunit_try_catch/247
[   24.018060] 
[   24.018396] CPU: 1 UID: 0 PID: 247 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   24.018599] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.018685] Hardware name: linux,dummy-virt (DT)
[   24.018776] Call trace:
[   24.018847]  dump_backtrace+0x9c/0x128
[   24.018985]  show_stack+0x20/0x38
[   24.019106]  dump_stack_lvl+0x8c/0xd0
[   24.019230]  print_report+0x118/0x5f0
[   24.019350]  kasan_report+0xdc/0x128
[   24.019533]  __asan_report_load1_noabort+0x20/0x30
[   24.019654]  strrchr+0x6c/0x78
[   24.019757]  kasan_strings+0x1f0/0x938
[   24.019841]  kunit_try_run_case+0x170/0x3f0
[   24.019893]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.019951]  kthread+0x24c/0x2d0
[   24.020028]  ret_from_fork+0x10/0x20
[   24.020079] 
[   24.028201] Allocated by task 247:
[   24.028666]  kasan_save_stack+0x3c/0x68
[   24.029232]  kasan_save_track+0x20/0x40
[   24.029707]  kasan_save_alloc_info+0x40/0x58
[   24.030268]  __kasan_kmalloc+0xd4/0xd8
[   24.030795]  __kmalloc_cache_noprof+0x154/0x320
[   24.032223]  kasan_strings+0xb0/0x938
[   24.032607]  kunit_try_run_case+0x170/0x3f0
[   24.033154]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.033796]  kthread+0x24c/0x2d0
[   24.034278]  ret_from_fork+0x10/0x20
[   24.034734] 
[   24.035089] Freed by task 247:
[   24.035560]  kasan_save_stack+0x3c/0x68
[   24.036117]  kasan_save_track+0x20/0x40
[   24.036605]  kasan_save_free_info+0x4c/0x78
[   24.037566]  __kasan_slab_free+0x6c/0x98
[   24.038142]  kfree+0x110/0x3b8
[   24.038588]  kasan_strings+0x128/0x938
[   24.039078]  kunit_try_run_case+0x170/0x3f0
[   24.040286]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.040908]  kthread+0x24c/0x2d0
[   24.041435]  ret_from_fork+0x10/0x20
[   24.041920] 
[   24.042393] The buggy address belongs to the object at fff00000c41f1940
[   24.042393]  which belongs to the cache kmalloc-32 of size 32
[   24.043850] The buggy address is located 16 bytes inside of
[   24.043850]  freed 32-byte region [fff00000c41f1940, fff00000c41f1960)
[   24.044998] 
[   24.045326] The buggy address belongs to the physical page:
[   24.045910] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1041f1
[   24.046764] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.048105] page_type: f5(slab)
[   24.048516] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   24.049306] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   24.050058] page dumped because: kasan: bad access detected
[   24.050650] 
[   24.051000] Memory state around the buggy address:
[   24.051600]  fff00000c41f1800: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   24.052697]  fff00000c41f1880: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   24.053488] >fff00000c41f1900: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   24.054233]                                                  ^
[   24.054872]  fff00000c41f1980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.055792]  fff00000c41f1a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.056539] ==================================================================

[   20.720713] ==================================================================
[   20.721349] BUG: KASAN: slab-use-after-free in strrchr+0x64/0x70
[   20.722271] Read of size 1 at addr ffff888102af74d0 by task kunit_try_catch/264
[   20.723036] 
[   20.723290] CPU: 1 UID: 0 PID: 264 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   20.723411] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.723447] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.723506] Call Trace:
[   20.723542]  <TASK>
[   20.723588]  dump_stack_lvl+0x73/0xb0
[   20.723773]  print_report+0xd1/0x640
[   20.723854]  ? __virt_addr_valid+0x1db/0x2d0
[   20.723935]  ? strrchr+0x64/0x70
[   20.724005]  ? kasan_complete_mode_report_info+0x64/0x200
[   20.724085]  ? strrchr+0x64/0x70
[   20.724152]  kasan_report+0x140/0x180
[   20.724252]  ? strrchr+0x64/0x70
[   20.724334]  __asan_report_load1_noabort+0x18/0x20
[   20.724409]  strrchr+0x64/0x70
[   20.724478]  kasan_strings+0x24c/0xb60
[   20.724555]  ? __pfx_kasan_strings+0x10/0x10
[   20.724633]  ? __schedule+0xc49/0x27a0
[   20.724704]  ? __pfx_read_tsc+0x10/0x10
[   20.724769]  ? ktime_get_ts64+0x84/0x230
[   20.724850]  kunit_try_run_case+0x1a6/0x480
[   20.724930]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.724996]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   20.725068]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.725171]  ? __kthread_parkme+0x82/0x160
[   20.725202]  ? preempt_count_sub+0x50/0x80
[   20.725260]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.725291]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.725329]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.725365]  kthread+0x257/0x310
[   20.725390]  ? __pfx_kthread+0x10/0x10
[   20.725415]  ret_from_fork+0x41/0x80
[   20.725458]  ? __pfx_kthread+0x10/0x10
[   20.725555]  ret_from_fork_asm+0x1a/0x30
[   20.725652]  </TASK>
[   20.725688] 
[   20.739888] Allocated by task 264:
[   20.740258]  kasan_save_stack+0x45/0x70
[   20.740720]  kasan_save_track+0x18/0x40
[   20.741251]  kasan_save_alloc_info+0x3b/0x50
[   20.741637]  __kasan_kmalloc+0xb7/0xc0
[   20.742131]  __kmalloc_cache_noprof+0x168/0x350
[   20.742900]  kasan_strings+0xb3/0xb60
[   20.743244]  kunit_try_run_case+0x1a6/0x480
[   20.743584]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.744275]  kthread+0x257/0x310
[   20.744748]  ret_from_fork+0x41/0x80
[   20.745136]  ret_from_fork_asm+0x1a/0x30
[   20.745671] 
[   20.745899] Freed by task 264:
[   20.746289]  kasan_save_stack+0x45/0x70
[   20.746614]  kasan_save_track+0x18/0x40
[   20.746932]  kasan_save_free_info+0x3f/0x60
[   20.747292]  __kasan_slab_free+0x56/0x70
[   20.747620]  kfree+0x123/0x3d0
[   20.747996]  kasan_strings+0x13a/0xb60
[   20.749090]  kunit_try_run_case+0x1a6/0x480
[   20.749636]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.750410]  kthread+0x257/0x310
[   20.750776]  ret_from_fork+0x41/0x80
[   20.751196]  ret_from_fork_asm+0x1a/0x30
[   20.751670] 
[   20.752057] The buggy address belongs to the object at ffff888102af74c0
[   20.752057]  which belongs to the cache kmalloc-32 of size 32
[   20.753328] The buggy address is located 16 bytes inside of
[   20.753328]  freed 32-byte region [ffff888102af74c0, ffff888102af74e0)
[   20.754583] 
[   20.754822] The buggy address belongs to the physical page:
[   20.755326] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102af7
[   20.755826] flags: 0x200000000000000(node=0|zone=2)
[   20.756180] page_type: f5(slab)
[   20.756804] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   20.757715] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   20.759712] page dumped because: kasan: bad access detected
[   20.760151] 
[   20.760351] Memory state around the buggy address:
[   20.761856]  ffff888102af7380: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   20.762651]  ffff888102af7400: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   20.763252] >ffff888102af7480: 00 00 07 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   20.764101]                                                  ^
[   20.765335]  ffff888102af7500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.766061]  ffff888102af7580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.766753] ==================================================================