Hay
Date
July 23, 2025, 3:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   30.368340] ==================================================================
[   30.368587] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x3bc/0x438
[   30.368690] Read of size 16 at addr fff00000c8603ea0 by task kunit_try_catch/201
[   30.368743] 
[   30.368799] CPU: 0 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT 
[   30.369058] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.369087] Hardware name: linux,dummy-virt (DT)
[   30.369120] Call trace:
[   30.369276]  show_stack+0x20/0x38 (C)
[   30.369433]  dump_stack_lvl+0x8c/0xd0
[   30.369562]  print_report+0x118/0x5e8
[   30.369664]  kasan_report+0xdc/0x128
[   30.369829]  __asan_report_load16_noabort+0x20/0x30
[   30.369932]  kmalloc_uaf_16+0x3bc/0x438
[   30.369991]  kunit_try_run_case+0x170/0x3f0
[   30.370435]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.371309]  kthread+0x328/0x630
[   30.371388]  ret_from_fork+0x10/0x20
[   30.371520] 
[   30.371540] Allocated by task 201:
[   30.371588]  kasan_save_stack+0x3c/0x68
[   30.371925]  kasan_save_track+0x20/0x40
[   30.372070]  kasan_save_alloc_info+0x40/0x58
[   30.372166]  __kasan_kmalloc+0xd4/0xd8
[   30.372340]  __kmalloc_cache_noprof+0x16c/0x3c0
[   30.372469]  kmalloc_uaf_16+0x140/0x438
[   30.372509]  kunit_try_run_case+0x170/0x3f0
[   30.372565]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.372750]  kthread+0x328/0x630
[   30.372983]  ret_from_fork+0x10/0x20
[   30.373286] 
[   30.373312] Freed by task 201:
[   30.373491]  kasan_save_stack+0x3c/0x68
[   30.374319]  kasan_save_track+0x20/0x40
[   30.374420]  kasan_save_free_info+0x4c/0x78
[   30.374611]  __kasan_slab_free+0x6c/0x98
[   30.374685]  kfree+0x214/0x3c8
[   30.375149]  kmalloc_uaf_16+0x190/0x438
[   30.375404]  kunit_try_run_case+0x170/0x3f0
[   30.375481]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.375641]  kthread+0x328/0x630
[   30.375708]  ret_from_fork+0x10/0x20
[   30.375816] 
[   30.375866] The buggy address belongs to the object at fff00000c8603ea0
[   30.375866]  which belongs to the cache kmalloc-16 of size 16
[   30.375985] The buggy address is located 0 bytes inside of
[   30.375985]  freed 16-byte region [fff00000c8603ea0, fff00000c8603eb0)
[   30.376241] 
[   30.376516] The buggy address belongs to the physical page:
[   30.376570] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xfff00000c8603e00 pfn:0x108603
[   30.376632] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.376682] page_type: f5(slab)
[   30.376953] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   30.377132] raw: fff00000c8603e00 000000008080007f 00000000f5000000 0000000000000000
[   30.377254] page dumped because: kasan: bad access detected
[   30.377285] 
[   30.377349] Memory state around the buggy address:
[   30.377522]  fff00000c8603d80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   30.377569]  fff00000c8603e00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   30.377734] >fff00000c8603e80: 00 00 fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   30.377819]                                ^
[   30.377880]  fff00000c8603f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.377950]  fff00000c8603f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.377996] ==================================================================

[   25.159789] ==================================================================
[   25.160218] BUG: KASAN: slab-use-after-free in kmalloc_uaf_16+0x47b/0x4c0
[   25.160477] Read of size 16 at addr ffff8881046316a0 by task kunit_try_catch/217
[   25.160922] 
[   25.161038] CPU: 1 UID: 0 PID: 217 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250723 #1 PREEMPT(voluntary) 
[   25.161092] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.161104] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.161126] Call Trace:
[   25.161312]  <TASK>
[   25.161342]  dump_stack_lvl+0x73/0xb0
[   25.161391]  print_report+0xd1/0x640
[   25.161416]  ? __virt_addr_valid+0x1db/0x2d0
[   25.161443]  ? kmalloc_uaf_16+0x47b/0x4c0
[   25.161464]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.161489]  ? kmalloc_uaf_16+0x47b/0x4c0
[   25.161509]  kasan_report+0x141/0x180
[   25.161531]  ? kmalloc_uaf_16+0x47b/0x4c0
[   25.161555]  __asan_report_load16_noabort+0x18/0x20
[   25.161579]  kmalloc_uaf_16+0x47b/0x4c0
[   25.161600]  ? __pfx_kmalloc_uaf_16+0x10/0x10
[   25.161621]  ? __schedule+0x10da/0x2b60
[   25.161646]  ? __pfx_read_tsc+0x10/0x10
[   25.161669]  ? ktime_get_ts64+0x86/0x230
[   25.161695]  kunit_try_run_case+0x1a5/0x480
[   25.161721]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.161743]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.161767]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.161792]  ? __kthread_parkme+0x82/0x180
[   25.161813]  ? preempt_count_sub+0x50/0x80
[   25.161837]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.161860]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.161883]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.161907]  kthread+0x337/0x6f0
[   25.161927]  ? trace_preempt_on+0x20/0xc0
[   25.162134]  ? __pfx_kthread+0x10/0x10
[   25.162175]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.162199]  ? calculate_sigpending+0x7b/0xa0
[   25.162225]  ? __pfx_kthread+0x10/0x10
[   25.162492]  ret_from_fork+0x116/0x1d0
[   25.162530]  ? __pfx_kthread+0x10/0x10
[   25.162555]  ret_from_fork_asm+0x1a/0x30
[   25.162587]  </TASK>
[   25.162599] 
[   25.174763] Allocated by task 217:
[   25.175277]  kasan_save_stack+0x45/0x70
[   25.175631]  kasan_save_track+0x18/0x40
[   25.175808]  kasan_save_alloc_info+0x3b/0x50
[   25.176314]  __kasan_kmalloc+0xb7/0xc0
[   25.176727]  __kmalloc_cache_noprof+0x189/0x420
[   25.177223]  kmalloc_uaf_16+0x15b/0x4c0
[   25.177687]  kunit_try_run_case+0x1a5/0x480
[   25.178056]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.178316]  kthread+0x337/0x6f0
[   25.178789]  ret_from_fork+0x116/0x1d0
[   25.178995]  ret_from_fork_asm+0x1a/0x30
[   25.179182] 
[   25.179264] Freed by task 217:
[   25.179825]  kasan_save_stack+0x45/0x70
[   25.180136]  kasan_save_track+0x18/0x40
[   25.180351]  kasan_save_free_info+0x3f/0x60
[   25.180629]  __kasan_slab_free+0x56/0x70
[   25.180810]  kfree+0x222/0x3f0
[   25.181201]  kmalloc_uaf_16+0x1d6/0x4c0
[   25.181764]  kunit_try_run_case+0x1a5/0x480
[   25.182038]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.182287]  kthread+0x337/0x6f0
[   25.182921]  ret_from_fork+0x116/0x1d0
[   25.183088]  ret_from_fork_asm+0x1a/0x30
[   25.183672] 
[   25.183781] The buggy address belongs to the object at ffff8881046316a0
[   25.183781]  which belongs to the cache kmalloc-16 of size 16
[   25.184711] The buggy address is located 0 bytes inside of
[   25.184711]  freed 16-byte region [ffff8881046316a0, ffff8881046316b0)
[   25.185540] 
[   25.185899] The buggy address belongs to the physical page:
[   25.186709] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104631
[   25.187178] flags: 0x200000000000000(node=0|zone=2)
[   25.187392] page_type: f5(slab)
[   25.187552] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122
[   25.187869] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   25.188526] page dumped because: kasan: bad access detected
[   25.189166] 
[   25.189458] Memory state around the buggy address:
[   25.189914]  ffff888104631580: 00 06 fc fc 00 06 fc fc fa fb fc fc fa fb fc fc
[   25.190224]  ffff888104631600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.190863] >ffff888104631680: 00 00 fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   25.191656]                                ^
[   25.192075]  ffff888104631700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.192369]  ffff888104631780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.193140] ==================================================================