Hay
Date
May 29, 2025, 7:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.921270] ==================================================================
[   21.921472] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   21.921634] Read of size 1 at addr fff00000c5e38b28 by task kunit_try_catch/188
[   21.921761] 
[   21.921856] CPU: 1 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   21.922075] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.922148] Hardware name: linux,dummy-virt (DT)
[   21.922888] Call trace:
[   21.923066]  show_stack+0x20/0x38 (C)
[   21.923232]  dump_stack_lvl+0x8c/0xd0
[   21.923366]  print_report+0x118/0x608
[   21.923503]  kasan_report+0xdc/0x128
[   21.923604]  __asan_report_load1_noabort+0x20/0x30
[   21.923701]  kmalloc_uaf2+0x3f4/0x468
[   21.923801]  kunit_try_run_case+0x170/0x3f0
[   21.923975]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.924647]  kthread+0x328/0x630
[   21.925029]  ret_from_fork+0x10/0x20
[   21.925284] 
[   21.925331] Allocated by task 188:
[   21.925795]  kasan_save_stack+0x3c/0x68
[   21.926079]  kasan_save_track+0x20/0x40
[   21.926195]  kasan_save_alloc_info+0x40/0x58
[   21.926389]  __kasan_kmalloc+0xd4/0xd8
[   21.926606]  __kmalloc_cache_noprof+0x15c/0x3c0
[   21.926716]  kmalloc_uaf2+0xc4/0x468
[   21.927067]  kunit_try_run_case+0x170/0x3f0
[   21.927210]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.927349]  kthread+0x328/0x630
[   21.927445]  ret_from_fork+0x10/0x20
[   21.927535] 
[   21.927586] Freed by task 188:
[   21.927662]  kasan_save_stack+0x3c/0x68
[   21.927995]  kasan_save_track+0x20/0x40
[   21.928215]  kasan_save_free_info+0x4c/0x78
[   21.928329]  __kasan_slab_free+0x6c/0x98
[   21.928949]  kfree+0x214/0x3c8
[   21.929140]  kmalloc_uaf2+0x134/0x468
[   21.929328]  kunit_try_run_case+0x170/0x3f0
[   21.929454]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.929561]  kthread+0x328/0x630
[   21.929985]  ret_from_fork+0x10/0x20
[   21.930215] 
[   21.930670] The buggy address belongs to the object at fff00000c5e38b00
[   21.930670]  which belongs to the cache kmalloc-64 of size 64
[   21.930907] The buggy address is located 40 bytes inside of
[   21.930907]  freed 64-byte region [fff00000c5e38b00, fff00000c5e38b40)
[   21.931162] 
[   21.931365] The buggy address belongs to the physical page:
[   21.931534] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105e38
[   21.931686] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   21.931791] page_type: f5(slab)
[   21.931871] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   21.931979] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   21.932079] page dumped because: kasan: bad access detected
[   21.932428] 
[   21.932766] Memory state around the buggy address:
[   21.932872]  fff00000c5e38a00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.933083]  fff00000c5e38a80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.933291] >fff00000c5e38b00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.933408]                                   ^
[   21.933728]  fff00000c5e38b80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   21.934066]  fff00000c5e38c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.934270] ==================================================================


[   11.163033] ==================================================================
[   11.163452] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   11.163712] Read of size 1 at addr ffff888102f991a8 by task kunit_try_catch/205
[   11.164371] 
[   11.164636] CPU: 0 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   11.164685] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.164697] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.164736] Call Trace:
[   11.164747]  <TASK>
[   11.164762]  dump_stack_lvl+0x73/0xb0
[   11.164789]  print_report+0xd1/0x650
[   11.164811]  ? __virt_addr_valid+0x1db/0x2d0
[   11.164833]  ? kmalloc_uaf2+0x4a8/0x520
[   11.164878]  ? kasan_complete_mode_report_info+0x64/0x200
[   11.164901]  ? kmalloc_uaf2+0x4a8/0x520
[   11.164922]  kasan_report+0x141/0x180
[   11.164955]  ? kmalloc_uaf2+0x4a8/0x520
[   11.164980]  __asan_report_load1_noabort+0x18/0x20
[   11.165009]  kmalloc_uaf2+0x4a8/0x520
[   11.165043]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   11.165063]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   11.165093]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   11.165118]  kunit_try_run_case+0x1a5/0x480
[   11.165139]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.165158]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.165183]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.165206]  ? __kthread_parkme+0x82/0x180
[   11.165227]  ? preempt_count_sub+0x50/0x80
[   11.165249]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.165270]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.165293]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.165317]  kthread+0x337/0x6f0
[   11.165336]  ? trace_preempt_on+0x20/0xc0
[   11.165359]  ? __pfx_kthread+0x10/0x10
[   11.165380]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.165402]  ? calculate_sigpending+0x7b/0xa0
[   11.165425]  ? __pfx_kthread+0x10/0x10
[   11.165446]  ret_from_fork+0x116/0x1d0
[   11.165464]  ? __pfx_kthread+0x10/0x10
[   11.165484]  ret_from_fork_asm+0x1a/0x30
[   11.165514]  </TASK>
[   11.165524] 
[   11.176468] Allocated by task 205:
[   11.176667]  kasan_save_stack+0x45/0x70
[   11.177143]  kasan_save_track+0x18/0x40
[   11.177333]  kasan_save_alloc_info+0x3b/0x50
[   11.177520]  __kasan_kmalloc+0xb7/0xc0
[   11.177726]  __kmalloc_cache_noprof+0x189/0x420
[   11.177911]  kmalloc_uaf2+0xc6/0x520
[   11.178244]  kunit_try_run_case+0x1a5/0x480
[   11.178526]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.178845]  kthread+0x337/0x6f0
[   11.179151]  ret_from_fork+0x116/0x1d0
[   11.179345]  ret_from_fork_asm+0x1a/0x30
[   11.179547] 
[   11.179847] Freed by task 205:
[   11.180087]  kasan_save_stack+0x45/0x70
[   11.180394]  kasan_save_track+0x18/0x40
[   11.180589]  kasan_save_free_info+0x3f/0x60
[   11.180945]  __kasan_slab_free+0x56/0x70
[   11.181162]  kfree+0x222/0x3f0
[   11.181329]  kmalloc_uaf2+0x14c/0x520
[   11.181580]  kunit_try_run_case+0x1a5/0x480
[   11.181834]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.182205]  kthread+0x337/0x6f0
[   11.182344]  ret_from_fork+0x116/0x1d0
[   11.182545]  ret_from_fork_asm+0x1a/0x30
[   11.182756] 
[   11.183076] The buggy address belongs to the object at ffff888102f99180
[   11.183076]  which belongs to the cache kmalloc-64 of size 64
[   11.183531] The buggy address is located 40 bytes inside of
[   11.183531]  freed 64-byte region [ffff888102f99180, ffff888102f991c0)
[   11.184121] 
[   11.184367] The buggy address belongs to the physical page:
[   11.184630] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102f99
[   11.185118] flags: 0x200000000000000(node=0|zone=2)
[   11.185424] page_type: f5(slab)
[   11.185729] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   11.186193] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   11.186490] page dumped because: kasan: bad access detected
[   11.186732] 
[   11.187113] Memory state around the buggy address:
[   11.187418]  ffff888102f99080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.187714]  ffff888102f99100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.188401] >ffff888102f99180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   11.188748]                                   ^
[   11.189058]  ffff888102f99200: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   11.189423]  ffff888102f99280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.189816] ==================================================================