Hay
Date
June 2, 2025, 2:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   22.091561] ==================================================================
[   22.092786] BUG: KASAN: slab-use-after-free in strchr+0xcc/0xd8
[   22.093532] Read of size 1 at addr fff00000c6cfdcd0 by task kunit_try_catch/246
[   22.094284] 
[   22.094629] CPU: 0 UID: 0 PID: 246 Comm: kunit_try_catch Tainted: G    B            N 6.12.32-rc1 #1
[   22.094861] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.094934] Hardware name: linux,dummy-virt (DT)
[   22.095023] Call trace:
[   22.095087]  dump_backtrace+0x9c/0x128
[   22.095218]  show_stack+0x20/0x38
[   22.095333]  dump_stack_lvl+0x8c/0xd0
[   22.095491]  print_report+0x118/0x5f0
[   22.095586]  kasan_report+0xdc/0x128
[   22.095666]  __asan_report_load1_noabort+0x20/0x30
[   22.095765]  strchr+0xcc/0xd8
[   22.095841]  kasan_strings+0x18c/0x938
[   22.095931]  kunit_try_run_case+0x170/0x3f0
[   22.096022]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.096121]  kthread+0x24c/0x2d0
[   22.096212]  ret_from_fork+0x10/0x20
[   22.096326] 
[   22.102812] Allocated by task 246:
[   22.103615]  kasan_save_stack+0x3c/0x68
[   22.104411]  kasan_save_track+0x20/0x40
[   22.105326]  kasan_save_alloc_info+0x40/0x58
[   22.105790]  __kasan_kmalloc+0xd4/0xd8
[   22.106188]  __kmalloc_cache_noprof+0x154/0x320
[   22.106752]  kasan_strings+0xb0/0x938
[   22.107257]  kunit_try_run_case+0x170/0x3f0
[   22.107814]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.108457]  kthread+0x24c/0x2d0
[   22.108960]  ret_from_fork+0x10/0x20
[   22.109425] 
[   22.109715] Freed by task 246:
[   22.110133]  kasan_save_stack+0x3c/0x68
[   22.110559]  kasan_save_track+0x20/0x40
[   22.110992]  kasan_save_free_info+0x4c/0x78
[   22.111662]  __kasan_slab_free+0x6c/0x98
[   22.111963]  kfree+0x110/0x3b8
[   22.112218]  kasan_strings+0x128/0x938
[   22.112900]  kunit_try_run_case+0x170/0x3f0
[   22.113490]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.114131]  kthread+0x24c/0x2d0
[   22.114625]  ret_from_fork+0x10/0x20
[   22.115473] 
[   22.115947] The buggy address belongs to the object at fff00000c6cfdcc0
[   22.115947]  which belongs to the cache kmalloc-32 of size 32
[   22.116967] The buggy address is located 16 bytes inside of
[   22.116967]  freed 32-byte region [fff00000c6cfdcc0, fff00000c6cfdce0)
[   22.117767] 
[   22.118103] The buggy address belongs to the physical page:
[   22.118547] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106cfd
[   22.119773] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.120418] page_type: f5(slab)
[   22.120696] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   22.121418] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   22.122021] page dumped because: kasan: bad access detected
[   22.122645] 
[   22.122936] Memory state around the buggy address:
[   22.123741]  fff00000c6cfdb80: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   22.124317]  fff00000c6cfdc00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   22.124854] >fff00000c6cfdc80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   22.125671]                                                  ^
[   22.126176]  fff00000c6cfdd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.126945]  fff00000c6cfdd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.128356] ==================================================================

[   14.026853] ==================================================================
[   14.027296] BUG: KASAN: slab-use-after-free in strchr+0x9c/0xc0
[   14.027626] Read of size 1 at addr ffff888102632890 by task kunit_try_catch/264
[   14.027869] 
[   14.027957] CPU: 0 UID: 0 PID: 264 Comm: kunit_try_catch Tainted: G    B            N 6.12.32-rc1 #1
[   14.028000] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.028012] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.028032] Call Trace:
[   14.028044]  <TASK>
[   14.028060]  dump_stack_lvl+0x73/0xb0
[   14.028437]  print_report+0xd1/0x640
[   14.028463]  ? __virt_addr_valid+0x1db/0x2d0
[   14.028488]  ? strchr+0x9c/0xc0
[   14.028506]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.028528]  ? strchr+0x9c/0xc0
[   14.028546]  kasan_report+0x140/0x180
[   14.028568]  ? strchr+0x9c/0xc0
[   14.028591]  __asan_report_load1_noabort+0x18/0x20
[   14.028611]  strchr+0x9c/0xc0
[   14.028630]  kasan_strings+0x1b1/0xb60
[   14.028651]  ? __pfx_kasan_strings+0x10/0x10
[   14.028695]  ? __schedule+0xc49/0x27a0
[   14.028715]  ? __pfx_read_tsc+0x10/0x10
[   14.028734]  ? ktime_get_ts64+0x84/0x230
[   14.028761]  kunit_try_run_case+0x1a6/0x480
[   14.028783]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.028802]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   14.028821]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.028844]  ? __kthread_parkme+0x82/0x160
[   14.028863]  ? preempt_count_sub+0x50/0x80
[   14.028884]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.028903]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.028927]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.028951]  kthread+0x257/0x310
[   14.028968]  ? __pfx_kthread+0x10/0x10
[   14.028986]  ret_from_fork+0x41/0x80
[   14.029005]  ? __pfx_kthread+0x10/0x10
[   14.029022]  ret_from_fork_asm+0x1a/0x30
[   14.029051]  </TASK>
[   14.029061] 
[   14.034286] Allocated by task 264:
[   14.034521]  kasan_save_stack+0x45/0x70
[   14.034625]  kasan_save_track+0x18/0x40
[   14.034722]  kasan_save_alloc_info+0x3b/0x50
[   14.034816]  __kasan_kmalloc+0xb7/0xc0
[   14.034924]  __kmalloc_cache_noprof+0x168/0x350
[   14.035608]  kasan_strings+0xb3/0xb60
[   14.035874]  kunit_try_run_case+0x1a6/0x480
[   14.036282]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.036546]  kthread+0x257/0x310
[   14.036701]  ret_from_fork+0x41/0x80
[   14.036941]  ret_from_fork_asm+0x1a/0x30
[   14.037387] 
[   14.037566] Freed by task 264:
[   14.037691]  kasan_save_stack+0x45/0x70
[   14.037912]  kasan_save_track+0x18/0x40
[   14.038326]  kasan_save_free_info+0x3f/0x60
[   14.038566]  __kasan_slab_free+0x56/0x70
[   14.038688]  kfree+0x123/0x3d0
[   14.038773]  kasan_strings+0x13a/0xb60
[   14.038861]  kunit_try_run_case+0x1a6/0x480
[   14.038949]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.039333]  kthread+0x257/0x310
[   14.039538]  ret_from_fork+0x41/0x80
[   14.039640]  ret_from_fork_asm+0x1a/0x30
[   14.039875] 
[   14.039980] The buggy address belongs to the object at ffff888102632880
[   14.039980]  which belongs to the cache kmalloc-32 of size 32
[   14.040318] The buggy address is located 16 bytes inside of
[   14.040318]  freed 32-byte region [ffff888102632880, ffff8881026328a0)
[   14.040725] 
[   14.040799] The buggy address belongs to the physical page:
[   14.040963] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102632
[   14.041173] flags: 0x200000000000000(node=0|zone=2)
[   14.041376] page_type: f5(slab)
[   14.041509] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.041863] raw: 0000000000000000 0000000080400040 00000001f5000000 0000000000000000
[   14.042112] page dumped because: kasan: bad access detected
[   14.042225] 
[   14.042279] Memory state around the buggy address:
[   14.042376]  ffff888102632780: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.042505]  ffff888102632800: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.042774] >ffff888102632880: fa fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
[   14.043039]                          ^
[   14.043432]  ffff888102632900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.043750]  ffff888102632980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.044124] ==================================================================