Hay
Date
June 2, 2025, 2:13 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.003050] ==================================================================
[   19.003818] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   19.004730] Read of size 1 at addr fff00000c58f5f28 by task kunit_try_catch/174
[   19.005833] 
[   19.006410] CPU: 1 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   19.006586] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.006905] Hardware name: linux,dummy-virt (DT)
[   19.006991] Call trace:
[   19.007023]  show_stack+0x20/0x38 (C)
[   19.007097]  dump_stack_lvl+0x8c/0xd0
[   19.007166]  print_report+0x118/0x608
[   19.007227]  kasan_report+0xdc/0x128
[   19.007277]  __asan_report_load1_noabort+0x20/0x30
[   19.007330]  kmalloc_uaf+0x300/0x338
[   19.007378]  kunit_try_run_case+0x170/0x3f0
[   19.007430]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.007486]  kthread+0x318/0x620
[   19.007534]  ret_from_fork+0x10/0x20
[   19.007589] 
[   19.012390] Allocated by task 174:
[   19.012783]  kasan_save_stack+0x3c/0x68
[   19.013330]  kasan_save_track+0x20/0x40
[   19.013767]  kasan_save_alloc_info+0x40/0x58
[   19.014604]  __kasan_kmalloc+0xd4/0xd8
[   19.015146]  __kmalloc_cache_noprof+0x16c/0x3c0
[   19.015607]  kmalloc_uaf+0xb8/0x338
[   19.016059]  kunit_try_run_case+0x170/0x3f0
[   19.016530]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.017074]  kthread+0x318/0x620
[   19.017505]  ret_from_fork+0x10/0x20
[   19.017927] 
[   19.018247] Freed by task 174:
[   19.018623]  kasan_save_stack+0x3c/0x68
[   19.019280]  kasan_save_track+0x20/0x40
[   19.019706]  kasan_save_free_info+0x4c/0x78
[   19.020137]  __kasan_slab_free+0x6c/0x98
[   19.020539]  kfree+0x214/0x3c8
[   19.020984]  kmalloc_uaf+0x11c/0x338
[   19.021458]  kunit_try_run_case+0x170/0x3f0
[   19.021938]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.022689]  kthread+0x318/0x620
[   19.023142]  ret_from_fork+0x10/0x20
[   19.023634] 
[   19.023927] The buggy address belongs to the object at fff00000c58f5f20
[   19.023927]  which belongs to the cache kmalloc-16 of size 16
[   19.024820] The buggy address is located 8 bytes inside of
[   19.024820]  freed 16-byte region [fff00000c58f5f20, fff00000c58f5f30)
[   19.025756] 
[   19.026345] The buggy address belongs to the physical page:
[   19.026876] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1058f5
[   19.028321] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.028892] page_type: f5(slab)
[   19.029386] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   19.030055] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   19.030826] page dumped because: kasan: bad access detected
[   19.031595] 
[   19.031869] Memory state around the buggy address:
[   19.032285]  fff00000c58f5e00: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   19.032926]  fff00000c58f5e80: fa fb fc fc fa fb fc fc 00 04 fc fc fa fb fc fc
[   19.033639] >fff00000c58f5f00: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   19.034467]                                   ^
[   19.034961]  fff00000c58f5f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.035584]  fff00000c58f6000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.036305] ==================================================================

[   12.931521] ==================================================================
[   12.932220] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x322/0x380
[   12.932495] Read of size 1 at addr ffff888101b5aba8 by task kunit_try_catch/192
[   12.932775] 
[   12.932934] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N 6.14.10-rc1 #1
[   12.932985] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.932996] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.933024] Call Trace:
[   12.933036]  <TASK>
[   12.933050]  dump_stack_lvl+0x73/0xb0
[   12.933073]  print_report+0xd1/0x650
[   12.933093]  ? __virt_addr_valid+0x1db/0x2d0
[   12.933115]  ? kmalloc_uaf+0x322/0x380
[   12.933133]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.933157]  ? kmalloc_uaf+0x322/0x380
[   12.933176]  kasan_report+0x140/0x180
[   12.933197]  ? kmalloc_uaf+0x322/0x380
[   12.933220]  __asan_report_load1_noabort+0x18/0x20
[   12.933242]  kmalloc_uaf+0x322/0x380
[   12.933261]  ? __pfx_kmalloc_uaf+0x10/0x10
[   12.933281]  ? __schedule+0xce8/0x2840
[   12.933303]  ? __pfx_read_tsc+0x10/0x10
[   12.933324]  ? ktime_get_ts64+0x86/0x230
[   12.933349]  kunit_try_run_case+0x1a6/0x480
[   12.933371]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.933427]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.933450]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.933473]  ? __kthread_parkme+0x82/0x160
[   12.933507]  ? preempt_count_sub+0x50/0x80
[   12.933531]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.933572]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.933606]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.933631]  kthread+0x324/0x6e0
[   12.933662]  ? trace_preempt_on+0x20/0xc0
[   12.933685]  ? __pfx_kthread+0x10/0x10
[   12.933706]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.933727]  ? calculate_sigpending+0x7b/0xa0
[   12.933754]  ? __pfx_kthread+0x10/0x10
[   12.933776]  ret_from_fork+0x41/0x80
[   12.933794]  ? __pfx_kthread+0x10/0x10
[   12.933815]  ret_from_fork_asm+0x1a/0x30
[   12.933845]  </TASK>
[   12.933855] 
[   12.942701] Allocated by task 192:
[   12.943039]  kasan_save_stack+0x45/0x70
[   12.943201]  kasan_save_track+0x18/0x40
[   12.943601]  kasan_save_alloc_info+0x3b/0x50
[   12.943780]  __kasan_kmalloc+0xb7/0xc0
[   12.943976]  __kmalloc_cache_noprof+0x18a/0x420
[   12.944201]  kmalloc_uaf+0xab/0x380
[   12.944447]  kunit_try_run_case+0x1a6/0x480
[   12.944605]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.944774]  kthread+0x324/0x6e0
[   12.945100]  ret_from_fork+0x41/0x80
[   12.945328]  ret_from_fork_asm+0x1a/0x30
[   12.945462] 
[   12.945529] Freed by task 192:
[   12.946204]  kasan_save_stack+0x45/0x70
[   12.946396]  kasan_save_track+0x18/0x40
[   12.946594]  kasan_save_free_info+0x3f/0x60
[   12.946767]  __kasan_slab_free+0x56/0x70
[   12.946897]  kfree+0x224/0x3f0
[   12.947008]  kmalloc_uaf+0x12d/0x380
[   12.947143]  kunit_try_run_case+0x1a6/0x480
[   12.947281]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.947562]  kthread+0x324/0x6e0
[   12.947900]  ret_from_fork+0x41/0x80
[   12.948087]  ret_from_fork_asm+0x1a/0x30
[   12.948283] 
[   12.948378] The buggy address belongs to the object at ffff888101b5aba0
[   12.948378]  which belongs to the cache kmalloc-16 of size 16
[   12.949367] The buggy address is located 8 bytes inside of
[   12.949367]  freed 16-byte region [ffff888101b5aba0, ffff888101b5abb0)
[   12.950166] 
[   12.950333] The buggy address belongs to the physical page:
[   12.950530] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b5a
[   12.951007] flags: 0x200000000000000(node=0|zone=2)
[   12.951258] page_type: f5(slab)
[   12.951423] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.951954] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.952409] page dumped because: kasan: bad access detected
[   12.952829] 
[   12.952914] Memory state around the buggy address:
[   12.953083]  ffff888101b5aa80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   12.953291]  ffff888101b5ab00: fa fb fc fc fa fb fc fc 00 05 fc fc fa fb fc fc
[   12.953499] >ffff888101b5ab80: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   12.953973]                                   ^
[   12.954248]  ffff888101b5ac00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.954989]  ffff888101b5ac80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.955380] ==================================================================