Hay
Date
July 12, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   22.317788] ==================================================================
[   22.317902] BUG: KASAN: slab-use-after-free in strlen+0xa8/0xb0
[   22.318008] Read of size 1 at addr fff00000c5941f90 by task kunit_try_catch/260
[   22.318107] 
[   22.318170] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   22.318330] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.318625] Hardware name: linux,dummy-virt (DT)
[   22.318722] Call trace:
[   22.318789]  show_stack+0x20/0x38 (C)
[   22.318934]  dump_stack_lvl+0x8c/0xd0
[   22.319046]  print_report+0x118/0x608
[   22.319211]  kasan_report+0xdc/0x128
[   22.319326]  __asan_report_load1_noabort+0x20/0x30
[   22.319656]  strlen+0xa8/0xb0
[   22.319810]  kasan_strings+0x418/0xb00
[   22.319976]  kunit_try_run_case+0x170/0x3f0
[   22.320087]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.320214]  kthread+0x328/0x630
[   22.320322]  ret_from_fork+0x10/0x20
[   22.320436] 
[   22.320485] Allocated by task 260:
[   22.320552]  kasan_save_stack+0x3c/0x68
[   22.320652]  kasan_save_track+0x20/0x40
[   22.320744]  kasan_save_alloc_info+0x40/0x58
[   22.320864]  __kasan_kmalloc+0xd4/0xd8
[   22.320974]  __kmalloc_cache_noprof+0x16c/0x3c0
[   22.321074]  kasan_strings+0xc8/0xb00
[   22.321166]  kunit_try_run_case+0x170/0x3f0
[   22.321261]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.321373]  kthread+0x328/0x630
[   22.321461]  ret_from_fork+0x10/0x20
[   22.321557] 
[   22.321606] Freed by task 260:
[   22.321671]  kasan_save_stack+0x3c/0x68
[   22.321759]  kasan_save_track+0x20/0x40
[   22.321863]  kasan_save_free_info+0x4c/0x78
[   22.321968]  __kasan_slab_free+0x6c/0x98
[   22.322068]  kfree+0x214/0x3c8
[   22.322156]  kasan_strings+0x24c/0xb00
[   22.322244]  kunit_try_run_case+0x170/0x3f0
[   22.322338]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.322451]  kthread+0x328/0x630
[   22.322546]  ret_from_fork+0x10/0x20
[   22.322645] 
[   22.322700] The buggy address belongs to the object at fff00000c5941f80
[   22.322700]  which belongs to the cache kmalloc-32 of size 32
[   22.323152] The buggy address is located 16 bytes inside of
[   22.323152]  freed 32-byte region [fff00000c5941f80, fff00000c5941fa0)
[   22.323312] 
[   22.323355] The buggy address belongs to the physical page:
[   22.324389] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105941
[   22.324573] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.324750] page_type: f5(slab)
[   22.324860] raw: 0bfffe0000000000 fff00000c0001780 dead000000000122 0000000000000000
[   22.325037] raw: 0000000000000000 0000000000400040 00000000f5000000 0000000000000000
[   22.325186] page dumped because: kasan: bad access detected
[   22.325260] 
[   22.325308] Memory state around the buggy address:
[   22.325386]  fff00000c5941e80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   22.325838]  fff00000c5941f00: 00 00 00 fc fc fc fc fc 00 00 07 fc fc fc fc fc
[   22.326097] >fff00000c5941f80: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   22.326189]                          ^
[   22.326264]  fff00000c5942000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   22.326359]  fff00000c5942080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.326436] ==================================================================

[   14.619558] ==================================================================
[   14.620249] BUG: KASAN: slab-use-after-free in strlen+0x8f/0xb0
[   14.620975] Read of size 1 at addr ffff888103acf910 by task kunit_try_catch/277
[   14.621536] 
[   14.621622] CPU: 0 UID: 0 PID: 277 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   14.621673] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.621685] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.621705] Call Trace:
[   14.621723]  <TASK>
[   14.621826]  dump_stack_lvl+0x73/0xb0
[   14.621859]  print_report+0xd1/0x650
[   14.621883]  ? __virt_addr_valid+0x1db/0x2d0
[   14.621906]  ? strlen+0x8f/0xb0
[   14.621923]  ? kasan_complete_mode_report_info+0x64/0x200
[   14.621947]  ? strlen+0x8f/0xb0
[   14.621965]  kasan_report+0x141/0x180
[   14.621987]  ? strlen+0x8f/0xb0
[   14.622008]  __asan_report_load1_noabort+0x18/0x20
[   14.622034]  strlen+0x8f/0xb0
[   14.622052]  kasan_strings+0x57b/0xe80
[   14.622071]  ? trace_hardirqs_on+0x37/0xe0
[   14.622095]  ? __pfx_kasan_strings+0x10/0x10
[   14.622115]  ? finish_task_switch.isra.0+0x153/0x700
[   14.622138]  ? __switch_to+0x47/0xf50
[   14.622163]  ? __schedule+0x10cc/0x2b60
[   14.622185]  ? __pfx_read_tsc+0x10/0x10
[   14.622207]  ? ktime_get_ts64+0x86/0x230
[   14.622231]  kunit_try_run_case+0x1a5/0x480
[   14.622255]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.622279]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.622303]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.622326]  ? __kthread_parkme+0x82/0x180
[   14.622348]  ? preempt_count_sub+0x50/0x80
[   14.622377]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.622401]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.622425]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.622451]  kthread+0x337/0x6f0
[   14.622470]  ? trace_preempt_on+0x20/0xc0
[   14.622492]  ? __pfx_kthread+0x10/0x10
[   14.622512]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.622533]  ? calculate_sigpending+0x7b/0xa0
[   14.622558]  ? __pfx_kthread+0x10/0x10
[   14.622580]  ret_from_fork+0x116/0x1d0
[   14.622598]  ? __pfx_kthread+0x10/0x10
[   14.622619]  ret_from_fork_asm+0x1a/0x30
[   14.622649]  </TASK>
[   14.622658] 
[   14.634523] Allocated by task 277:
[   14.634696]  kasan_save_stack+0x45/0x70
[   14.635141]  kasan_save_track+0x18/0x40
[   14.635480]  kasan_save_alloc_info+0x3b/0x50
[   14.635879]  __kasan_kmalloc+0xb7/0xc0
[   14.636452]  __kmalloc_cache_noprof+0x189/0x420
[   14.636874]  kasan_strings+0xc0/0xe80
[   14.637012]  kunit_try_run_case+0x1a5/0x480
[   14.637159]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.637336]  kthread+0x337/0x6f0
[   14.637455]  ret_from_fork+0x116/0x1d0
[   14.637586]  ret_from_fork_asm+0x1a/0x30
[   14.637778] 
[   14.637847] Freed by task 277:
[   14.637957]  kasan_save_stack+0x45/0x70
[   14.638297]  kasan_save_track+0x18/0x40
[   14.638500]  kasan_save_free_info+0x3f/0x60
[   14.638740]  __kasan_slab_free+0x56/0x70
[   14.638895]  kfree+0x222/0x3f0
[   14.639012]  kasan_strings+0x2aa/0xe80
[   14.639185]  kunit_try_run_case+0x1a5/0x480
[   14.639394]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.639709]  kthread+0x337/0x6f0
[   14.639892]  ret_from_fork+0x116/0x1d0
[   14.640082]  ret_from_fork_asm+0x1a/0x30
[   14.640243] 
[   14.640339] The buggy address belongs to the object at ffff888103acf900
[   14.640339]  which belongs to the cache kmalloc-32 of size 32
[   14.640711] The buggy address is located 16 bytes inside of
[   14.640711]  freed 32-byte region [ffff888103acf900, ffff888103acf920)
[   14.641194] 
[   14.641285] The buggy address belongs to the physical page:
[   14.641734] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103acf
[   14.642016] flags: 0x200000000000000(node=0|zone=2)
[   14.642195] page_type: f5(slab)
[   14.642371] raw: 0200000000000000 ffff888100041780 dead000000000122 0000000000000000
[   14.642832] raw: 0000000000000000 0000000080400040 00000000f5000000 0000000000000000
[   14.643154] page dumped because: kasan: bad access detected
[   14.643381] 
[   14.643476] Memory state around the buggy address:
[   14.643740]  ffff888103acf800: 00 00 00 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.644020]  ffff888103acf880: 00 00 07 fc fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.644289] >ffff888103acf900: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.644500]                          ^
[   14.644645]  ffff888103acf980: fa fb fb fb fc fc fc fc 00 00 00 fc fc fc fc fc
[   14.644985]  ffff888103acfa00: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   14.645297] ==================================================================