Hay
Date
June 20, 2025, 12:38 p.m.

Environment
qemu-arm64
qemu-x86_64

[   32.218110] ==================================================================
[   32.218316] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   32.218472] Read of size 1 at addr fff00000c58d29a8 by task kunit_try_catch/195
[   32.218599] 
[   32.220105] CPU: 1 UID: 0 PID: 195 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250620 #1 PREEMPT 
[   32.221384] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.221914] Hardware name: linux,dummy-virt (DT)
[   32.222003] Call trace:
[   32.222102]  show_stack+0x20/0x38 (C)
[   32.222442]  dump_stack_lvl+0x8c/0xd0
[   32.222647]  print_report+0x118/0x608
[   32.222893]  kasan_report+0xdc/0x128
[   32.223188]  __asan_report_load1_noabort+0x20/0x30
[   32.224098]  kmalloc_uaf+0x300/0x338
[   32.224505]  kunit_try_run_case+0x170/0x3f0
[   32.224727]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.224870]  kthread+0x328/0x630
[   32.224980]  ret_from_fork+0x10/0x20
[   32.225099] 
[   32.225141] Allocated by task 195:
[   32.225199]  kasan_save_stack+0x3c/0x68
[   32.225279]  kasan_save_track+0x20/0x40
[   32.225363]  kasan_save_alloc_info+0x40/0x58
[   32.226460]  __kasan_kmalloc+0xd4/0xd8
[   32.226917]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.227496]  kmalloc_uaf+0xb8/0x338
[   32.227720]  kunit_try_run_case+0x170/0x3f0
[   32.227902]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.228149]  kthread+0x328/0x630
[   32.228492]  ret_from_fork+0x10/0x20
[   32.229309] 
[   32.229378] Freed by task 195:
[   32.229492]  kasan_save_stack+0x3c/0x68
[   32.229727]  kasan_save_track+0x20/0x40
[   32.229945]  kasan_save_free_info+0x4c/0x78
[   32.230067]  __kasan_slab_free+0x6c/0x98
[   32.230284]  kfree+0x214/0x3c8
[   32.230382]  kmalloc_uaf+0x11c/0x338
[   32.231055]  kunit_try_run_case+0x170/0x3f0
[   32.231304]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.231900]  kthread+0x328/0x630
[   32.232083]  ret_from_fork+0x10/0x20
[   32.232357] 
[   32.232473] The buggy address belongs to the object at fff00000c58d29a0
[   32.232473]  which belongs to the cache kmalloc-16 of size 16
[   32.232653] The buggy address is located 8 bytes inside of
[   32.232653]  freed 16-byte region [fff00000c58d29a0, fff00000c58d29b0)
[   32.232791] 
[   32.232840] The buggy address belongs to the physical page:
[   32.232906] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058d2
[   32.234144] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.234764] page_type: f5(slab)
[   32.235381] raw: 0bfffe0000000000 fff00000c0001640 dead000000000100 dead000000000122
[   32.235599] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   32.235721] page dumped because: kasan: bad access detected
[   32.236350] 
[   32.236538] Memory state around the buggy address:
[   32.236729]  fff00000c58d2880: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.237115]  fff00000c58d2900: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   32.237216] >fff00000c58d2980: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   32.237288]                                   ^
[   32.237353]  fff00000c58d2a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.237428]  fff00000c58d2a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.237878] ==================================================================

[   25.865068] ==================================================================
[   25.865692] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   25.866463] Read of size 1 at addr ffff8881022cf728 by task kunit_try_catch/213
[   25.867057] 
[   25.867231] CPU: 0 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250620 #1 PREEMPT(voluntary) 
[   25.867338] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.867367] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.867415] Call Trace:
[   25.867457]  <TASK>
[   25.867496]  dump_stack_lvl+0x73/0xb0
[   25.867551]  print_report+0xd1/0x650
[   25.867588]  ? __virt_addr_valid+0x1db/0x2d0
[   25.867615]  ? kmalloc_uaf+0x320/0x380
[   25.867642]  ? kasan_complete_mode_report_info+0x64/0x200
[   25.867685]  ? kmalloc_uaf+0x320/0x380
[   25.867724]  kasan_report+0x141/0x180
[   25.867770]  ? kmalloc_uaf+0x320/0x380
[   25.867822]  __asan_report_load1_noabort+0x18/0x20
[   25.867871]  kmalloc_uaf+0x320/0x380
[   25.867911]  ? __pfx_kmalloc_uaf+0x10/0x10
[   25.867944]  ? __schedule+0x10cc/0x2b60
[   25.867969]  ? __pfx_read_tsc+0x10/0x10
[   25.867992]  ? ktime_get_ts64+0x86/0x230
[   25.868021]  kunit_try_run_case+0x1a5/0x480
[   25.868049]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.868072]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.868097]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.868121]  ? __kthread_parkme+0x82/0x180
[   25.868149]  ? preempt_count_sub+0x50/0x80
[   25.868190]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.868381]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.868452]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.868505]  kthread+0x337/0x6f0
[   25.868553]  ? trace_preempt_on+0x20/0xc0
[   25.868606]  ? __pfx_kthread+0x10/0x10
[   25.868653]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.868702]  ? calculate_sigpending+0x7b/0xa0
[   25.868780]  ? __pfx_kthread+0x10/0x10
[   25.868814]  ret_from_fork+0x116/0x1d0
[   25.868838]  ? __pfx_kthread+0x10/0x10
[   25.868860]  ret_from_fork_asm+0x1a/0x30
[   25.868893]  </TASK>
[   25.868908] 
[   25.880333] Allocated by task 213:
[   25.881453]  kasan_save_stack+0x45/0x70
[   25.882047]  kasan_save_track+0x18/0x40
[   25.882477]  kasan_save_alloc_info+0x3b/0x50
[   25.882830]  __kasan_kmalloc+0xb7/0xc0
[   25.883005]  __kmalloc_cache_noprof+0x189/0x420
[   25.883208]  kmalloc_uaf+0xaa/0x380
[   25.883373]  kunit_try_run_case+0x1a5/0x480
[   25.883811]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.884184]  kthread+0x337/0x6f0
[   25.884540]  ret_from_fork+0x116/0x1d0
[   25.885332]  ret_from_fork_asm+0x1a/0x30
[   25.885829] 
[   25.886006] Freed by task 213:
[   25.886716]  kasan_save_stack+0x45/0x70
[   25.887321]  kasan_save_track+0x18/0x40
[   25.887529]  kasan_save_free_info+0x3f/0x60
[   25.887871]  __kasan_slab_free+0x56/0x70
[   25.888214]  kfree+0x222/0x3f0
[   25.888408]  kmalloc_uaf+0x12c/0x380
[   25.888583]  kunit_try_run_case+0x1a5/0x480
[   25.888860]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.889270]  kthread+0x337/0x6f0
[   25.889578]  ret_from_fork+0x116/0x1d0
[   25.889861]  ret_from_fork_asm+0x1a/0x30
[   25.889998] 
[   25.890088] The buggy address belongs to the object at ffff8881022cf720
[   25.890088]  which belongs to the cache kmalloc-16 of size 16
[   25.890386] The buggy address is located 8 bytes inside of
[   25.890386]  freed 16-byte region [ffff8881022cf720, ffff8881022cf730)
[   25.890677] 
[   25.890757] The buggy address belongs to the physical page:
[   25.891314] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1022cf
[   25.892112] flags: 0x200000000000000(node=0|zone=2)
[   25.892802] page_type: f5(slab)
[   25.894196] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   25.895671] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   25.896268] page dumped because: kasan: bad access detected
[   25.897241] 
[   25.897359] Memory state around the buggy address:
[   25.897563]  ffff8881022cf600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.898401]  ffff8881022cf680: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   25.898673] >ffff8881022cf700: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   25.899213]                                   ^
[   25.899588]  ffff8881022cf780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.900011]  ffff8881022cf800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.900436] ==================================================================