Hay
Date
June 18, 2025, 6:43 a.m.

Environment
qemu-arm64
qemu-x86_64

[   23.319362] ==================================================================
[   23.319439] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   23.319508] Read of size 1 at addr fff00000c605c810 by task kunit_try_catch/269
[   23.319566] 
[   23.319611] CPU: 0 UID: 0 PID: 269 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc2-next-20250618 #1 PREEMPT 
[   23.319711] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   23.319748] Hardware name: linux,dummy-virt (DT)
[   23.319787] Call trace:
[   23.319818]  show_stack+0x20/0x38 (C)
[   23.319879]  dump_stack_lvl+0x8c/0xd0
[   23.319934]  print_report+0x118/0x608
[   23.319989]  kasan_report+0xdc/0x128
[   23.320074]  __asan_report_load1_noabort+0x20/0x30
[   23.320137]  strlen+0xa8/0xb0
[   23.320187]  kasan_strings+0x418/0xb00
[   23.320239]  kunit_try_run_case+0x170/0x3f0
[   23.320294]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.320354]  kthread+0x328/0x630
[   23.320404]  ret_from_fork+0x10/0x20
[   23.320462] 
[   23.320485] Allocated by task 269:
[   23.320520]  kasan_save_stack+0x3c/0x68
[   23.320592]  kasan_save_track+0x20/0x40
[   23.320637]  kasan_save_alloc_info+0x40/0x58
[   23.320686]  __kasan_kmalloc+0xd4/0xd8
[   23.320727]  __kmalloc_cache_noprof+0x16c/0x3c0
[   23.320772]  kasan_strings+0xc8/0xb00
[   23.320812]  kunit_try_run_case+0x170/0x3f0
[   23.320855]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.320905]  kthread+0x328/0x630
[   23.320942]  ret_from_fork+0x10/0x20
[   23.320986] 
[   23.321009] Freed by task 269:
[   23.321100]  kasan_save_stack+0x3c/0x68
[   23.321173]  kasan_save_track+0x20/0x40
[   23.321250]  kasan_save_free_info+0x4c/0x78
[   23.321341]  __kasan_slab_free+0x6c/0x98
[   23.321457]  kfree+0x214/0x3c8
[   23.321567]  kasan_strings+0x24c/0xb00
[   23.321663]  kunit_try_run_case+0x170/0x3f0
[   23.321779]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   23.321917]  kthread+0x328/0x630
[   23.322002]  ret_from_fork+0x10/0x20
[   23.322172] 
[   23.322229] The buggy address belongs to the object at fff00000c605c800
[   23.322229]  which belongs to the cache kmalloc-32 of size 32
[   23.322374] The buggy address is located 16 bytes inside of
[   23.322374]  freed 32-byte region [fff00000c605c800, fff00000c605c820)
[   23.322506] 
[   23.322551] The buggy address belongs to the physical page:
[   23.322624] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10605c
[   23.322757] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   23.322884] page_type: f5(slab)
[   23.322979] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   23.323121] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   23.323261] page dumped because: kasan: bad access detected
[   23.323340] 
[   23.323384] Memory state around the buggy address:
[   23.323471]  fff00000c605c700: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   23.323605]  fff00000c605c780: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   23.323723] >fff00000c605c800: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   23.323808]                          ^
[   23.323891]  fff00000c605c880: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   23.323996]  fff00000c605c900: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   23.324145] ==================================================================

[   13.128021] ==================================================================
[   13.128395] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   13.128777] Read of size 1 at addr ffff88810262ad90 by task kunit_try_catch/285
[   13.129006] 
[   13.129341] CPU: 0 UID: 0 PID: 285 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250618 #1 PREEMPT(voluntary) 
[   13.129393] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.129405] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.129426] Call Trace:
[   13.129439]  <TASK>
[   13.129524]  dump_stack_lvl+0x73/0xb0
[   13.129554]  print_report+0xd1/0x650
[   13.129576]  ? __virt_addr_valid+0x1db/0x2d0
[   13.129599]  ? strlen+0x8f/0xb0
[   13.129618]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.129644]  ? strlen+0x8f/0xb0
[   13.129664]  kasan_report+0x141/0x180
[   13.129685]  ? strlen+0x8f/0xb0
[   13.129710]  __asan_report_load1_noabort+0x18/0x20
[   13.129734]  strlen+0x8f/0xb0
[   13.129754]  kasan_strings+0x57b/0xe80
[   13.129773]  ? trace_hardirqs_on+0x37/0xe0
[   13.129795]  ? __pfx_kasan_strings+0x10/0x10
[   13.129815]  ? finish_task_switch.isra.0+0x153/0x700
[   13.129835]  ? __switch_to+0x47/0xf50
[   13.129861]  ? __schedule+0x10cc/0x2b60
[   13.129880]  ? __pfx_read_tsc+0x10/0x10
[   13.129901]  ? ktime_get_ts64+0x86/0x230
[   13.129925]  kunit_try_run_case+0x1a5/0x480
[   13.129947]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.129968]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.129990]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.130012]  ? __kthread_parkme+0x82/0x180
[   13.130030]  ? preempt_count_sub+0x50/0x80
[   13.130052]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.130075]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.130096]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.130119]  kthread+0x337/0x6f0
[   13.130138]  ? trace_preempt_on+0x20/0xc0
[   13.130159]  ? __pfx_kthread+0x10/0x10
[   13.130179]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.130199]  ? calculate_sigpending+0x7b/0xa0
[   13.130234]  ? __pfx_kthread+0x10/0x10
[   13.130255]  ret_from_fork+0x116/0x1d0
[   13.130273]  ? __pfx_kthread+0x10/0x10
[   13.130293]  ret_from_fork_asm+0x1a/0x30
[   13.130322]  </TASK>
[   13.130332] 
[   13.139638] Allocated by task 285:
[   13.139813]  kasan_save_stack+0x45/0x70
[   13.140118]  kasan_save_track+0x18/0x40
[   13.140399]  kasan_save_alloc_info+0x3b/0x50
[   13.140557]  __kasan_kmalloc+0xb7/0xc0
[   13.140750]  __kmalloc_cache_noprof+0x189/0x420
[   13.141085]  kasan_strings+0xc0/0xe80
[   13.141304]  kunit_try_run_case+0x1a5/0x480
[   13.141612]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.141841]  kthread+0x337/0x6f0
[   13.142538]  ret_from_fork+0x116/0x1d0
[   13.143333]  ret_from_fork_asm+0x1a/0x30
[   13.143496] 
[   13.143562] Freed by task 285:
[   13.143665]  kasan_save_stack+0x45/0x70
[   13.143790]  kasan_save_track+0x18/0x40
[   13.143910]  kasan_save_free_info+0x3f/0x60
[   13.144042]  __kasan_slab_free+0x56/0x70
[   13.144172]  kfree+0x222/0x3f0
[   13.144288]  kasan_strings+0x2aa/0xe80
[   13.144409]  kunit_try_run_case+0x1a5/0x480
[   13.144541]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.144706]  kthread+0x337/0x6f0
[   13.144815]  ret_from_fork+0x116/0x1d0
[   13.144935]  ret_from_fork_asm+0x1a/0x30
[   13.145061] 
[   13.145121] The buggy address belongs to the object at ffff88810262ad80
[   13.145121]  which belongs to the cache kmalloc-32 of size 32
[   13.147976] The buggy address is located 16 bytes inside of
[   13.147976]  freed 32-byte region [ffff88810262ad80, ffff88810262ada0)
[   13.149443] 
[   13.150331] The buggy address belongs to the physical page:
[   13.150587] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10262a
[   13.150938] flags: 0x200000000000000(node=0|zone=2)
[   13.151113] page_type: f5(slab)
[   13.151542] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   13.151865] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   13.152943] page dumped because: kasan: bad access detected
[   13.153434] 
[   13.153685] Memory state around the buggy address:
[   13.153902]  ffff88810262ac80: 00 00 00 fc fc fc fc fc fa fb fb fb fc fc fc fc
[   13.154417]  ffff88810262ad00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.154919] >ffff88810262ad80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.155391]                          ^
[   13.155567]  ffff88810262ae00: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   13.155854]  ffff88810262ae80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   13.156140] ==================================================================