Hay
Date
June 19, 2025, 12:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   30.703332] ==================================================================
[   30.703519] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   30.703673] Read of size 1 at addr fff00000c4726d08 by task kunit_try_catch/195
[   30.703793] 
[   30.704419] CPU: 1 UID: 0 PID: 195 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250619 #1 PREEMPT 
[   30.705173] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.705257] Hardware name: linux,dummy-virt (DT)
[   30.705405] Call trace:
[   30.705491]  show_stack+0x20/0x38 (C)
[   30.705864]  dump_stack_lvl+0x8c/0xd0
[   30.706016]  print_report+0x118/0x608
[   30.706263]  kasan_report+0xdc/0x128
[   30.706382]  __asan_report_load1_noabort+0x20/0x30
[   30.707018]  kmalloc_uaf+0x300/0x338
[   30.707275]  kunit_try_run_case+0x170/0x3f0
[   30.707512]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.707649]  kthread+0x328/0x630
[   30.707760]  ret_from_fork+0x10/0x20
[   30.707886] 
[   30.707932] Allocated by task 195:
[   30.708394]  kasan_save_stack+0x3c/0x68
[   30.708784]  kasan_save_track+0x20/0x40
[   30.709057]  kasan_save_alloc_info+0x40/0x58
[   30.709510]  __kasan_kmalloc+0xd4/0xd8
[   30.710447]  __kmalloc_cache_noprof+0x16c/0x3c0
[   30.710631]  kmalloc_uaf+0xb8/0x338
[   30.710823]  kunit_try_run_case+0x170/0x3f0
[   30.711020]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.711353]  kthread+0x328/0x630
[   30.711453]  ret_from_fork+0x10/0x20
[   30.711551] 
[   30.711647] Freed by task 195:
[   30.711801]  kasan_save_stack+0x3c/0x68
[   30.711994]  kasan_save_track+0x20/0x40
[   30.712092]  kasan_save_free_info+0x4c/0x78
[   30.712186]  __kasan_slab_free+0x6c/0x98
[   30.712312]  kfree+0x214/0x3c8
[   30.712436]  kmalloc_uaf+0x11c/0x338
[   30.713080]  kunit_try_run_case+0x170/0x3f0
[   30.713189]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.713376]  kthread+0x328/0x630
[   30.713460]  ret_from_fork+0x10/0x20
[   30.713666] 
[   30.713766] The buggy address belongs to the object at fff00000c4726d00
[   30.713766]  which belongs to the cache kmalloc-16 of size 16
[   30.714036] The buggy address is located 8 bytes inside of
[   30.714036]  freed 16-byte region [fff00000c4726d00, fff00000c4726d10)
[   30.714301] 
[   30.714370] The buggy address belongs to the physical page:
[   30.714441] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104726
[   30.714552] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.714655] page_type: f5(slab)
[   30.714732] raw: 0bfffe0000000000 fff00000c0001640 dead000000000100 dead000000000122
[   30.714838] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   30.715689] page dumped because: kasan: bad access detected
[   30.715866] 
[   30.715954] Memory state around the buggy address:
[   30.716099]  fff00000c4726c00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   30.716263]  fff00000c4726c80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   30.716431] >fff00000c4726d00: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.716609]                       ^
[   30.716691]  fff00000c4726d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.716826]  fff00000c4726e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.717015] ==================================================================

[   27.201853] ==================================================================
[   27.202670] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   27.203282] Read of size 1 at addr ffff8881022a26a8 by task kunit_try_catch/213
[   27.203718] 
[   27.203904] CPU: 1 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250619 #1 PREEMPT(voluntary) 
[   27.204010] Tainted: [B]=BAD_PAGE, [N]=TEST
[   27.204034] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   27.204064] Call Trace:
[   27.204087]  <TASK>
[   27.204959]  dump_stack_lvl+0x73/0xb0
[   27.205212]  print_report+0xd1/0x650
[   27.205258]  ? __virt_addr_valid+0x1db/0x2d0
[   27.205297]  ? kmalloc_uaf+0x320/0x380
[   27.205363]  ? kasan_complete_mode_report_info+0x64/0x200
[   27.205396]  ? kmalloc_uaf+0x320/0x380
[   27.205418]  kasan_report+0x141/0x180
[   27.205442]  ? kmalloc_uaf+0x320/0x380
[   27.205467]  __asan_report_load1_noabort+0x18/0x20
[   27.205492]  kmalloc_uaf+0x320/0x380
[   27.205513]  ? __pfx_kmalloc_uaf+0x10/0x10
[   27.205535]  ? __schedule+0x10cc/0x2b60
[   27.205559]  ? __pfx_read_tsc+0x10/0x10
[   27.205581]  ? ktime_get_ts64+0x86/0x230
[   27.205608]  kunit_try_run_case+0x1a5/0x480
[   27.205635]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.205657]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   27.205681]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   27.205705]  ? __kthread_parkme+0x82/0x180
[   27.205727]  ? preempt_count_sub+0x50/0x80
[   27.205752]  ? __pfx_kunit_try_run_case+0x10/0x10
[   27.205776]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.205799]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   27.205823]  kthread+0x337/0x6f0
[   27.205843]  ? trace_preempt_on+0x20/0xc0
[   27.205867]  ? __pfx_kthread+0x10/0x10
[   27.205889]  ? _raw_spin_unlock_irq+0x47/0x80
[   27.205918]  ? calculate_sigpending+0x7b/0xa0
[   27.206057]  ? __pfx_kthread+0x10/0x10
[   27.206080]  ret_from_fork+0x116/0x1d0
[   27.206114]  ? __pfx_kthread+0x10/0x10
[   27.206139]  ret_from_fork_asm+0x1a/0x30
[   27.206172]  </TASK>
[   27.206186] 
[   27.221799] Allocated by task 213:
[   27.222582]  kasan_save_stack+0x45/0x70
[   27.222888]  kasan_save_track+0x18/0x40
[   27.223464]  kasan_save_alloc_info+0x3b/0x50
[   27.224124]  __kasan_kmalloc+0xb7/0xc0
[   27.224324]  __kmalloc_cache_noprof+0x189/0x420
[   27.224728]  kmalloc_uaf+0xaa/0x380
[   27.224983]  kunit_try_run_case+0x1a5/0x480
[   27.225362]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.226304]  kthread+0x337/0x6f0
[   27.226649]  ret_from_fork+0x116/0x1d0
[   27.227542]  ret_from_fork_asm+0x1a/0x30
[   27.228234] 
[   27.228459] Freed by task 213:
[   27.228745]  kasan_save_stack+0x45/0x70
[   27.229290]  kasan_save_track+0x18/0x40
[   27.229856]  kasan_save_free_info+0x3f/0x60
[   27.230381]  __kasan_slab_free+0x56/0x70
[   27.230899]  kfree+0x222/0x3f0
[   27.231477]  kmalloc_uaf+0x12c/0x380
[   27.231692]  kunit_try_run_case+0x1a5/0x480
[   27.232413]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   27.233238]  kthread+0x337/0x6f0
[   27.233868]  ret_from_fork+0x116/0x1d0
[   27.234058]  ret_from_fork_asm+0x1a/0x30
[   27.234465] 
[   27.234643] The buggy address belongs to the object at ffff8881022a26a0
[   27.234643]  which belongs to the cache kmalloc-16 of size 16
[   27.235830] The buggy address is located 8 bytes inside of
[   27.235830]  freed 16-byte region [ffff8881022a26a0, ffff8881022a26b0)
[   27.236940] 
[   27.237407] The buggy address belongs to the physical page:
[   27.237816] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1022a2
[   27.238666] flags: 0x200000000000000(node=0|zone=2)
[   27.239288] page_type: f5(slab)
[   27.239476] raw: 0200000000000000 ffff888100041640 dead000000000100 dead000000000122
[   27.239977] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   27.240404] page dumped because: kasan: bad access detected
[   27.240751] 
[   27.240883] Memory state around the buggy address:
[   27.241813]  ffff8881022a2580: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.242136]  ffff8881022a2600: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   27.242961] >ffff8881022a2680: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   27.243609]                                   ^
[   27.244275]  ffff8881022a2700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.244930]  ffff8881022a2780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   27.245735] ==================================================================