Hay
Date
July 9, 2025, 1:08 p.m.

Environment
qemu-arm64
qemu-x86_64

[   29.441994] ==================================================================
[   29.442111] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   29.442187] Read of size 1 at addr fff00000c592c908 by task kunit_try_catch/216
[   29.442273] 
[   29.442318] CPU: 0 UID: 0 PID: 216 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250709 #1 PREEMPT 
[   29.442405] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.442432] Hardware name: linux,dummy-virt (DT)
[   29.442463] Call trace:
[   29.442484]  show_stack+0x20/0x38 (C)
[   29.442681]  dump_stack_lvl+0x8c/0xd0
[   29.442768]  print_report+0x118/0x5d0
[   29.442812]  kasan_report+0xdc/0x128
[   29.442860]  __asan_report_load1_noabort+0x20/0x30
[   29.442934]  kmalloc_uaf+0x300/0x338
[   29.442979]  kunit_try_run_case+0x170/0x3f0
[   29.443132]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.443226]  kthread+0x328/0x630
[   29.443275]  ret_from_fork+0x10/0x20
[   29.443329] 
[   29.443388] Allocated by task 216:
[   29.443416]  kasan_save_stack+0x3c/0x68
[   29.443458]  kasan_save_track+0x20/0x40
[   29.443495]  kasan_save_alloc_info+0x40/0x58
[   29.443533]  __kasan_kmalloc+0xd4/0xd8
[   29.443571]  __kmalloc_cache_noprof+0x16c/0x3c0
[   29.443610]  kmalloc_uaf+0xb8/0x338
[   29.443646]  kunit_try_run_case+0x170/0x3f0
[   29.443860]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.443918]  kthread+0x328/0x630
[   29.443964]  ret_from_fork+0x10/0x20
[   29.444006] 
[   29.444024] Freed by task 216:
[   29.444061]  kasan_save_stack+0x3c/0x68
[   29.444232]  kasan_save_track+0x20/0x40
[   29.444273]  kasan_save_free_info+0x4c/0x78
[   29.444364]  __kasan_slab_free+0x6c/0x98
[   29.444506]  kfree+0x214/0x3c8
[   29.444585]  kmalloc_uaf+0x11c/0x338
[   29.444693]  kunit_try_run_case+0x170/0x3f0
[   29.444776]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.444871]  kthread+0x328/0x630
[   29.444928]  ret_from_fork+0x10/0x20
[   29.445019] 
[   29.445141] The buggy address belongs to the object at fff00000c592c900
[   29.445141]  which belongs to the cache kmalloc-16 of size 16
[   29.445258] The buggy address is located 8 bytes inside of
[   29.445258]  freed 16-byte region [fff00000c592c900, fff00000c592c910)
[   29.445354] 
[   29.445415] The buggy address belongs to the physical page:
[   29.445462] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10592c
[   29.445569] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   29.445638] page_type: f5(slab)
[   29.445713] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   29.445764] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   29.445804] page dumped because: kasan: bad access detected
[   29.446022] 
[   29.446134] Memory state around the buggy address:
[   29.446223]  fff00000c592c800: fa fb fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   29.446338]  fff00000c592c880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   29.446461] >fff00000c592c900: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.446498]                       ^
[   29.446727]  fff00000c592c980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.446874]  fff00000c592ca00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   29.446963] ==================================================================

[   24.330062] ==================================================================
[   24.330606] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   24.331396] Read of size 1 at addr ffff8881058a8208 by task kunit_try_catch/234
[   24.331831] 
[   24.332118] CPU: 0 UID: 0 PID: 234 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc5-next-20250709 #1 PREEMPT(voluntary) 
[   24.332184] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   24.332339] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.332369] Call Trace:
[   24.332385]  <TASK>
[   24.332409]  dump_stack_lvl+0x73/0xb0
[   24.332446]  print_report+0xd1/0x610
[   24.332470]  ? __virt_addr_valid+0x1db/0x2d0
[   24.332496]  ? kmalloc_uaf+0x320/0x380
[   24.332515]  ? kasan_complete_mode_report_info+0x64/0x200
[   24.332540]  ? kmalloc_uaf+0x320/0x380
[   24.332560]  kasan_report+0x141/0x180
[   24.332581]  ? kmalloc_uaf+0x320/0x380
[   24.332605]  __asan_report_load1_noabort+0x18/0x20
[   24.332628]  kmalloc_uaf+0x320/0x380
[   24.332647]  ? __pfx_kmalloc_uaf+0x10/0x10
[   24.332667]  ? __schedule+0x10cc/0x2b60
[   24.332691]  ? __pfx_read_tsc+0x10/0x10
[   24.332729]  ? ktime_get_ts64+0x86/0x230
[   24.332757]  kunit_try_run_case+0x1a5/0x480
[   24.332797]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.332819]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   24.332842]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.332866]  ? __kthread_parkme+0x82/0x180
[   24.332900]  ? preempt_count_sub+0x50/0x80
[   24.332924]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.332944]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.332970]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.332994]  kthread+0x337/0x6f0
[   24.333013]  ? trace_preempt_on+0x20/0xc0
[   24.333037]  ? __pfx_kthread+0x10/0x10
[   24.333061]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.333084]  ? calculate_sigpending+0x7b/0xa0
[   24.333110]  ? __pfx_kthread+0x10/0x10
[   24.333131]  ret_from_fork+0x116/0x1d0
[   24.333150]  ? __pfx_kthread+0x10/0x10
[   24.333170]  ret_from_fork_asm+0x1a/0x30
[   24.333204]  </TASK>
[   24.333217] 
[   24.344303] Allocated by task 234:
[   24.344688]  kasan_save_stack+0x45/0x70
[   24.345225]  kasan_save_track+0x18/0x40
[   24.345534]  kasan_save_alloc_info+0x3b/0x50
[   24.345857]  __kasan_kmalloc+0xb7/0xc0
[   24.346147]  __kmalloc_cache_noprof+0x189/0x420
[   24.346476]  kmalloc_uaf+0xaa/0x380
[   24.346729]  kunit_try_run_case+0x1a5/0x480
[   24.347159]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.347499]  kthread+0x337/0x6f0
[   24.347659]  ret_from_fork+0x116/0x1d0
[   24.347829]  ret_from_fork_asm+0x1a/0x30
[   24.348375] 
[   24.348466] Freed by task 234:
[   24.348597]  kasan_save_stack+0x45/0x70
[   24.349051]  kasan_save_track+0x18/0x40
[   24.349334]  kasan_save_free_info+0x3f/0x60
[   24.349648]  __kasan_slab_free+0x56/0x70
[   24.349860]  kfree+0x222/0x3f0
[   24.350411]  kmalloc_uaf+0x12c/0x380
[   24.350633]  kunit_try_run_case+0x1a5/0x480
[   24.350945]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.351394]  kthread+0x337/0x6f0
[   24.351574]  ret_from_fork+0x116/0x1d0
[   24.351978]  ret_from_fork_asm+0x1a/0x30
[   24.352303] 
[   24.352406] The buggy address belongs to the object at ffff8881058a8200
[   24.352406]  which belongs to the cache kmalloc-16 of size 16
[   24.353179] The buggy address is located 8 bytes inside of
[   24.353179]  freed 16-byte region [ffff8881058a8200, ffff8881058a8210)
[   24.353849] 
[   24.353994] The buggy address belongs to the physical page:
[   24.354324] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058a8
[   24.354679] flags: 0x200000000000000(node=0|zone=2)
[   24.355308] page_type: f5(slab)
[   24.355463] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   24.356150] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   24.356462] page dumped because: kasan: bad access detected
[   24.356868] 
[   24.356967] Memory state around the buggy address:
[   24.357359]  ffff8881058a8100: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   24.357755]  ffff8881058a8180: fa fb fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   24.358096] >ffff8881058a8200: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.358552]                       ^
[   24.358754]  ffff8881058a8280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.359303]  ffff8881058a8300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.359588] ==================================================================