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

Environment
qemu-arm64
qemu-x86_64

[   19.176317] ==================================================================
[   19.177032] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   19.177171] Read of size 1 at addr fff00000c78aa8a8 by task kunit_try_catch/189
[   19.177298] 
[   19.177379] CPU: 0 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.177561] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.177687] Hardware name: linux,dummy-virt (DT)
[   19.177758] Call trace:
[   19.177801]  show_stack+0x20/0x38 (C)
[   19.178305]  dump_stack_lvl+0x8c/0xd0
[   19.178455]  print_report+0x118/0x608
[   19.178552]  kasan_report+0xdc/0x128
[   19.179002]  __asan_report_load1_noabort+0x20/0x30
[   19.179122]  kmalloc_uaf2+0x3f4/0x468
[   19.179172]  kunit_try_run_case+0x170/0x3f0
[   19.179221]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.179276]  kthread+0x328/0x630
[   19.179322]  ret_from_fork+0x10/0x20
[   19.179417] 
[   19.179464] Allocated by task 189:
[   19.179526]  kasan_save_stack+0x3c/0x68
[   19.179628]  kasan_save_track+0x20/0x40
[   19.179749]  kasan_save_alloc_info+0x40/0x58
[   19.179872]  __kasan_kmalloc+0xd4/0xd8
[   19.179985]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.180082]  kmalloc_uaf2+0xc4/0x468
[   19.180173]  kunit_try_run_case+0x170/0x3f0
[   19.180251]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.180394]  kthread+0x328/0x630
[   19.180503]  ret_from_fork+0x10/0x20
[   19.180617] 
[   19.180680] Freed by task 189:
[   19.180739]  kasan_save_stack+0x3c/0x68
[   19.180826]  kasan_save_track+0x20/0x40
[   19.180933]  kasan_save_free_info+0x4c/0x78
[   19.181062]  __kasan_slab_free+0x6c/0x98
[   19.181179]  kfree+0x214/0x3c8
[   19.181256]  kmalloc_uaf2+0x134/0x468
[   19.181655]  kunit_try_run_case+0x170/0x3f0
[   19.181936]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.182165]  kthread+0x328/0x630
[   19.182347]  ret_from_fork+0x10/0x20
[   19.182487] 
[   19.182551] The buggy address belongs to the object at fff00000c78aa880
[   19.182551]  which belongs to the cache kmalloc-64 of size 64
[   19.182711] The buggy address is located 40 bytes inside of
[   19.182711]  freed 64-byte region [fff00000c78aa880, fff00000c78aa8c0)
[   19.182865] 
[   19.182917] The buggy address belongs to the physical page:
[   19.182990] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078aa
[   19.183099] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.183199] page_type: f5(slab)
[   19.183265] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   19.184988] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   19.185133] page dumped because: kasan: bad access detected
[   19.185217] 
[   19.185520] Memory state around the buggy address:
[   19.185768]  fff00000c78aa780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.185885]  fff00000c78aa800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.185989] >fff00000c78aa880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   19.186077]                                   ^
[   19.186176]  fff00000c78aa900: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   19.186283]  fff00000c78aa980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.186500] ==================================================================

[   13.958133] ==================================================================
[   13.958694] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   13.959240] Read of size 1 at addr ffff88810332dd28 by task kunit_try_catch/205
[   13.959591] 
[   13.959751] CPU: 1 UID: 0 PID: 205 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.959808] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.959822] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.959849] Call Trace:
[   13.959864]  <TASK>
[   13.959885]  dump_stack_lvl+0x73/0xb0
[   13.959922]  print_report+0xd1/0x650
[   13.959948]  ? __virt_addr_valid+0x1db/0x2d0
[   13.959977]  ? kmalloc_uaf2+0x4a8/0x520
[   13.960000]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.960026]  ? kmalloc_uaf2+0x4a8/0x520
[   13.960049]  kasan_report+0x141/0x180
[   13.960142]  ? kmalloc_uaf2+0x4a8/0x520
[   13.960191]  __asan_report_load1_noabort+0x18/0x20
[   13.960219]  kmalloc_uaf2+0x4a8/0x520
[   13.960243]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   13.960265]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   13.960301]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   13.960329]  kunit_try_run_case+0x1a5/0x480
[   13.960359]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.960383]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.960411]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.960437]  ? __kthread_parkme+0x82/0x180
[   13.960462]  ? preempt_count_sub+0x50/0x80
[   13.960491]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.960519]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.960546]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.960572]  kthread+0x337/0x6f0
[   13.960594]  ? trace_preempt_on+0x20/0xc0
[   13.960621]  ? __pfx_kthread+0x10/0x10
[   13.960645]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.960678]  ? calculate_sigpending+0x7b/0xa0
[   13.960707]  ? __pfx_kthread+0x10/0x10
[   13.960731]  ret_from_fork+0x116/0x1d0
[   13.960754]  ? __pfx_kthread+0x10/0x10
[   13.960825]  ret_from_fork_asm+0x1a/0x30
[   13.960868]  </TASK>
[   13.960882] 
[   13.970031] Allocated by task 205:
[   13.970321]  kasan_save_stack+0x45/0x70
[   13.970575]  kasan_save_track+0x18/0x40
[   13.970912]  kasan_save_alloc_info+0x3b/0x50
[   13.971318]  __kasan_kmalloc+0xb7/0xc0
[   13.971616]  __kmalloc_cache_noprof+0x189/0x420
[   13.971939]  kmalloc_uaf2+0xc6/0x520
[   13.972318]  kunit_try_run_case+0x1a5/0x480
[   13.972576]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.972951]  kthread+0x337/0x6f0
[   13.973146]  ret_from_fork+0x116/0x1d0
[   13.973306]  ret_from_fork_asm+0x1a/0x30
[   13.973475] 
[   13.973562] Freed by task 205:
[   13.973782]  kasan_save_stack+0x45/0x70
[   13.974220]  kasan_save_track+0x18/0x40
[   13.974519]  kasan_save_free_info+0x3f/0x60
[   13.974813]  __kasan_slab_free+0x56/0x70
[   13.974979]  kfree+0x222/0x3f0
[   13.975118]  kmalloc_uaf2+0x14c/0x520
[   13.975434]  kunit_try_run_case+0x1a5/0x480
[   13.975735]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.976064]  kthread+0x337/0x6f0
[   13.976349]  ret_from_fork+0x116/0x1d0
[   13.976515]  ret_from_fork_asm+0x1a/0x30
[   13.976764] 
[   13.976909] The buggy address belongs to the object at ffff88810332dd00
[   13.976909]  which belongs to the cache kmalloc-64 of size 64
[   13.977800] The buggy address is located 40 bytes inside of
[   13.977800]  freed 64-byte region [ffff88810332dd00, ffff88810332dd40)
[   13.978835] 
[   13.978991] The buggy address belongs to the physical page:
[   13.979882] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10332d
[   13.980527] flags: 0x200000000000000(node=0|zone=2)
[   13.981012] page_type: f5(slab)
[   13.981239] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   13.981614] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   13.982411] page dumped because: kasan: bad access detected
[   13.983468] 
[   13.983617] Memory state around the buggy address:
[   13.984291]  ffff88810332dc00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.985042]  ffff88810332dc80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.985411] >ffff88810332dd00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.985749]                                   ^
[   13.986367]  ffff88810332dd80: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   13.987381]  ffff88810332de00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.988183] ==================================================================