Hay
Date
July 5, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.181461] ==================================================================
[   18.181522] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x3f4/0x468
[   18.181576] Read of size 1 at addr fff00000c65c50a8 by task kunit_try_catch/188
[   18.181625] 
[   18.181655] CPU: 0 UID: 0 PID: 188 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.181733] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.181760] Hardware name: linux,dummy-virt (DT)
[   18.181792] Call trace:
[   18.181812]  show_stack+0x20/0x38 (C)
[   18.181859]  dump_stack_lvl+0x8c/0xd0
[   18.182204]  print_report+0x118/0x608
[   18.182274]  kasan_report+0xdc/0x128
[   18.182322]  __asan_report_load1_noabort+0x20/0x30
[   18.182734]  kmalloc_uaf2+0x3f4/0x468
[   18.182792]  kunit_try_run_case+0x170/0x3f0
[   18.183232]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.183299]  kthread+0x328/0x630
[   18.183542]  ret_from_fork+0x10/0x20
[   18.183612] 
[   18.183740] Allocated by task 188:
[   18.183837]  kasan_save_stack+0x3c/0x68
[   18.183882]  kasan_save_track+0x20/0x40
[   18.183931]  kasan_save_alloc_info+0x40/0x58
[   18.184078]  __kasan_kmalloc+0xd4/0xd8
[   18.184286]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.184423]  kmalloc_uaf2+0xc4/0x468
[   18.184702]  kunit_try_run_case+0x170/0x3f0
[   18.184784]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.184862]  kthread+0x328/0x630
[   18.184898]  ret_from_fork+0x10/0x20
[   18.184934] 
[   18.184953] Freed by task 188:
[   18.184980]  kasan_save_stack+0x3c/0x68
[   18.185017]  kasan_save_track+0x20/0x40
[   18.185053]  kasan_save_free_info+0x4c/0x78
[   18.185102]  __kasan_slab_free+0x6c/0x98
[   18.185139]  kfree+0x214/0x3c8
[   18.185426]  kmalloc_uaf2+0x134/0x468
[   18.185492]  kunit_try_run_case+0x170/0x3f0
[   18.185569]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.185625]  kthread+0x328/0x630
[   18.185893]  ret_from_fork+0x10/0x20
[   18.186028] 
[   18.186240] The buggy address belongs to the object at fff00000c65c5080
[   18.186240]  which belongs to the cache kmalloc-64 of size 64
[   18.186458] The buggy address is located 40 bytes inside of
[   18.186458]  freed 64-byte region [fff00000c65c5080, fff00000c65c50c0)
[   18.186568] 
[   18.186715] The buggy address belongs to the physical page:
[   18.186779] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1065c5
[   18.186950] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.187344] page_type: f5(slab)
[   18.187411] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   18.187604] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   18.187707] page dumped because: kasan: bad access detected
[   18.187761] 
[   18.187906] Memory state around the buggy address:
[   18.187989]  fff00000c65c4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.188170]  fff00000c65c5000: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.188242] >fff00000c65c5080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.188405]                                   ^
[   18.188576]  fff00000c65c5100: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   18.188744]  fff00000c65c5180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.188909] ==================================================================

[   13.911647] ==================================================================
[   13.912217] BUG: KASAN: slab-use-after-free in kmalloc_uaf2+0x4a8/0x520
[   13.912720] Read of size 1 at addr ffff8881029fb2a8 by task kunit_try_catch/206
[   13.913060] 
[   13.913263] CPU: 1 UID: 0 PID: 206 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   13.913340] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.913357] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.913394] Call Trace:
[   13.913409]  <TASK>
[   13.913431]  dump_stack_lvl+0x73/0xb0
[   13.913471]  print_report+0xd1/0x650
[   13.913499]  ? __virt_addr_valid+0x1db/0x2d0
[   13.913529]  ? kmalloc_uaf2+0x4a8/0x520
[   13.913555]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.913584]  ? kmalloc_uaf2+0x4a8/0x520
[   13.913609]  kasan_report+0x141/0x180
[   13.913636]  ? kmalloc_uaf2+0x4a8/0x520
[   13.913665]  __asan_report_load1_noabort+0x18/0x20
[   13.913697]  kmalloc_uaf2+0x4a8/0x520
[   13.913722]  ? __pfx_kmalloc_uaf2+0x10/0x10
[   13.913746]  ? finish_task_switch.isra.0+0x153/0x700
[   13.913776]  ? __switch_to+0x47/0xf50
[   13.913823]  ? __schedule+0x10cc/0x2b60
[   13.913850]  ? __pfx_read_tsc+0x10/0x10
[   13.913877]  ? ktime_get_ts64+0x86/0x230
[   13.913907]  kunit_try_run_case+0x1a5/0x480
[   13.913940]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.913969]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.913999]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.914029]  ? __kthread_parkme+0x82/0x180
[   13.914056]  ? preempt_count_sub+0x50/0x80
[   13.914084]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.914126]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.914164]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.914195]  kthread+0x337/0x6f0
[   13.914219]  ? trace_preempt_on+0x20/0xc0
[   13.914248]  ? __pfx_kthread+0x10/0x10
[   13.914273]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.914300]  ? calculate_sigpending+0x7b/0xa0
[   13.914332]  ? __pfx_kthread+0x10/0x10
[   13.914359]  ret_from_fork+0x116/0x1d0
[   13.914382]  ? __pfx_kthread+0x10/0x10
[   13.914407]  ret_from_fork_asm+0x1a/0x30
[   13.914445]  </TASK>
[   13.914459] 
[   13.924047] Allocated by task 206:
[   13.924302]  kasan_save_stack+0x45/0x70
[   13.924683]  kasan_save_track+0x18/0x40
[   13.924896]  kasan_save_alloc_info+0x3b/0x50
[   13.925120]  __kasan_kmalloc+0xb7/0xc0
[   13.925367]  __kmalloc_cache_noprof+0x189/0x420
[   13.925554]  kmalloc_uaf2+0xc6/0x520
[   13.925705]  kunit_try_run_case+0x1a5/0x480
[   13.925889]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.926204]  kthread+0x337/0x6f0
[   13.926474]  ret_from_fork+0x116/0x1d0
[   13.926705]  ret_from_fork_asm+0x1a/0x30
[   13.926956] 
[   13.927077] Freed by task 206:
[   13.927325]  kasan_save_stack+0x45/0x70
[   13.927529]  kasan_save_track+0x18/0x40
[   13.927685]  kasan_save_free_info+0x3f/0x60
[   13.927939]  __kasan_slab_free+0x56/0x70
[   13.928162]  kfree+0x222/0x3f0
[   13.928467]  kmalloc_uaf2+0x14c/0x520
[   13.928666]  kunit_try_run_case+0x1a5/0x480
[   13.928884]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.929111]  kthread+0x337/0x6f0
[   13.929249]  ret_from_fork+0x116/0x1d0
[   13.929486]  ret_from_fork_asm+0x1a/0x30
[   13.929813] 
[   13.929925] The buggy address belongs to the object at ffff8881029fb280
[   13.929925]  which belongs to the cache kmalloc-64 of size 64
[   13.930525] The buggy address is located 40 bytes inside of
[   13.930525]  freed 64-byte region [ffff8881029fb280, ffff8881029fb2c0)
[   13.930952] 
[   13.931073] The buggy address belongs to the physical page:
[   13.931363] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029fb
[   13.931773] flags: 0x200000000000000(node=0|zone=2)
[   13.932065] page_type: f5(slab)
[   13.932291] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   13.932552] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   13.932815] page dumped because: kasan: bad access detected
[   13.933493] 
[   13.933610] Memory state around the buggy address:
[   13.933892]  ffff8881029fb180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.934531]  ffff8881029fb200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.934874] >ffff8881029fb280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   13.935292]                                   ^
[   13.935501]  ffff8881029fb300: 00 00 00 00 00 03 fc fc fc fc fc fc fc fc fc fc
[   13.935747]  ffff8881029fb380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.936138] ==================================================================