Hay
Date
June 25, 2025, 8:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   26.811743] ==================================================================
[   26.811814] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   26.812051] Read of size 1 at addr fff00000c78b0ea8 by task kunit_try_catch/200
[   26.813018] 
[   26.813062] CPU: 1 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT 
[   26.813158] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.813358] Hardware name: linux,dummy-virt (DT)
[   26.813590] Call trace:
[   26.814332]  show_stack+0x20/0x38 (C)
[   26.814429]  dump_stack_lvl+0x8c/0xd0
[   26.814746]  print_report+0x118/0x608
[   26.814882]  kasan_report+0xdc/0x128
[   26.815011]  __asan_report_load1_noabort+0x20/0x30
[   26.815596]  kmalloc_uaf2+0x3f4/0x468
[   26.815835]  kunit_try_run_case+0x170/0x3f0
[   26.815956]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.816135]  kthread+0x328/0x630
[   26.816340]  ret_from_fork+0x10/0x20
[   26.816474] 
[   26.816494] Allocated by task 200:
[   26.816534]  kasan_save_stack+0x3c/0x68
[   26.816575]  kasan_save_track+0x20/0x40
[   26.816613]  kasan_save_alloc_info+0x40/0x58
[   26.816651]  __kasan_kmalloc+0xd4/0xd8
[   26.816688]  __kmalloc_cache_noprof+0x16c/0x3c0
[   26.816729]  kmalloc_uaf2+0xc4/0x468
[   26.816797]  kunit_try_run_case+0x170/0x3f0
[   26.816840]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.816885]  kthread+0x328/0x630
[   26.816917]  ret_from_fork+0x10/0x20
[   26.816963] 
[   26.816997] Freed by task 200:
[   26.817031]  kasan_save_stack+0x3c/0x68
[   26.817078]  kasan_save_track+0x20/0x40
[   26.817116]  kasan_save_free_info+0x4c/0x78
[   26.817150]  __kasan_slab_free+0x6c/0x98
[   26.817188]  kfree+0x214/0x3c8
[   26.817219]  kmalloc_uaf2+0x134/0x468
[   26.817264]  kunit_try_run_case+0x170/0x3f0
[   26.817315]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.817359]  kthread+0x328/0x630
[   26.817785]  ret_from_fork+0x10/0x20
[   26.817840] 
[   26.817890] The buggy address belongs to the object at fff00000c78b0e80
[   26.817890]  which belongs to the cache kmalloc-64 of size 64
[   26.818477] The buggy address is located 40 bytes inside of
[   26.818477]  freed 64-byte region [fff00000c78b0e80, fff00000c78b0ec0)
[   26.818630] 
[   26.818817] The buggy address belongs to the physical page:
[   26.819003] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078b0
[   26.819287] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   26.819728] page_type: f5(slab)
[   26.820034] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   26.820433] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   26.820561] page dumped because: kasan: bad access detected
[   26.820660] 
[   26.820679] Memory state around the buggy address:
[   26.820885]  fff00000c78b0d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   26.821139]  fff00000c78b0e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   26.821503] >fff00000c78b0e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   26.821575]                                   ^
[   26.821719]  fff00000c78b0f00: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   26.821767]  fff00000c78b0f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.821996] ==================================================================

[   22.178916] ==================================================================
[   22.180319] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   22.180770] Read of size 1 at addr ffff888102590028 by task kunit_try_catch/217
[   22.181366] 
[   22.181595] CPU: 0 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250625 #1 PREEMPT(voluntary) 
[   22.181650] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.181663] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.181685] Call Trace:
[   22.181700]  <TASK>
[   22.181721]  dump_stack_lvl+0x73/0xb0
[   22.181775]  print_report+0xd1/0x650
[   22.181803]  ? __virt_addr_valid+0x1db/0x2d0
[   22.181827]  ? kmalloc_uaf2+0x4a8/0x520
[   22.181845]  ? kasan_complete_mode_report_info+0x64/0x200
[   22.181869]  ? kmalloc_uaf2+0x4a8/0x520
[   22.181887]  kasan_report+0x141/0x180
[   22.181907]  ? kmalloc_uaf2+0x4a8/0x520
[   22.181929]  __asan_report_load1_noabort+0x18/0x20
[   22.181960]  kmalloc_uaf2+0x4a8/0x520
[   22.181979]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   22.182065]  ? finish_task_switch.isra.0+0x153/0x700
[   22.182094]  ? __switch_to+0x47/0xf50
[   22.182129]  ? __schedule+0x10cc/0x2b60
[   22.182155]  ? __pfx_read_tsc+0x10/0x10
[   22.182176]  ? ktime_get_ts64+0x86/0x230
[   22.182201]  kunit_try_run_case+0x1a5/0x480
[   22.182227]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.182249]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.182269]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.182292]  ? __kthread_parkme+0x82/0x180
[   22.182311]  ? preempt_count_sub+0x50/0x80
[   22.182332]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.182354]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.182376]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.182398]  kthread+0x337/0x6f0
[   22.182416]  ? trace_preempt_on+0x20/0xc0
[   22.182439]  ? __pfx_kthread+0x10/0x10
[   22.182458]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.182480]  ? calculate_sigpending+0x7b/0xa0
[   22.182503]  ? __pfx_kthread+0x10/0x10
[   22.182523]  ret_from_fork+0x116/0x1d0
[   22.182540]  ? __pfx_kthread+0x10/0x10
[   22.182558]  ret_from_fork_asm+0x1a/0x30
[   22.182588]  </TASK>
[   22.182600] 
[   22.195018] Allocated by task 217:
[   22.195395]  kasan_save_stack+0x45/0x70
[   22.195754]  kasan_save_track+0x18/0x40
[   22.196204]  kasan_save_alloc_info+0x3b/0x50
[   22.196457]  __kasan_kmalloc+0xb7/0xc0
[   22.196577]  __kmalloc_cache_noprof+0x189/0x420
[   22.196720]  kmalloc_uaf2+0xc6/0x520
[   22.196906]  kunit_try_run_case+0x1a5/0x480
[   22.197289]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.197892]  kthread+0x337/0x6f0
[   22.198213]  ret_from_fork+0x116/0x1d0
[   22.198570]  ret_from_fork_asm+0x1a/0x30
[   22.199033] 
[   22.199194] Freed by task 217:
[   22.199517]  kasan_save_stack+0x45/0x70
[   22.199711]  kasan_save_track+0x18/0x40
[   22.199905]  kasan_save_free_info+0x3f/0x60
[   22.200306]  __kasan_slab_free+0x56/0x70
[   22.200679]  kfree+0x222/0x3f0
[   22.201040]  kmalloc_uaf2+0x14c/0x520
[   22.201260]  kunit_try_run_case+0x1a5/0x480
[   22.201606]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.201764]  kthread+0x337/0x6f0
[   22.201929]  ret_from_fork+0x116/0x1d0
[   22.202315]  ret_from_fork_asm+0x1a/0x30
[   22.202664] 
[   22.202827] The buggy address belongs to the object at ffff888102590000
[   22.202827]  which belongs to the cache kmalloc-64 of size 64
[   22.203991] The buggy address is located 40 bytes inside of
[   22.203991]  freed 64-byte region [ffff888102590000, ffff888102590040)
[   22.204707] 
[   22.204864] The buggy address belongs to the physical page:
[   22.205431] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102590
[   22.205851] flags: 0x200000000000000(node=0|zone=2)
[   22.206378] page_type: f5(slab)
[   22.206647] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   22.207060] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   22.207661] page dumped because: kasan: bad access detected
[   22.207866] 
[   22.208034] Memory state around the buggy address:
[   22.208466]  ffff88810258ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.209150]  ffff88810258ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.209354] >ffff888102590000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   22.209547]                                   ^
[   22.209682]  ffff888102590080: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   22.209877]  ffff888102590100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.210458] ==================================================================