Hay
Date
July 12, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.801471] ==================================================================
[   16.801577] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   16.801629] Read of size 1 at addr fff00000c45d1ac8 by task kunit_try_catch/184
[   16.801700] 
[   16.801730] CPU: 1 UID: 0 PID: 184 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.801898] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.801927] Hardware name: linux,dummy-virt (DT)
[   16.802064] Call trace:
[   16.802165]  show_stack+0x20/0x38 (C)
[   16.802260]  dump_stack_lvl+0x8c/0xd0
[   16.802353]  print_report+0x118/0x5d0
[   16.802399]  kasan_report+0xdc/0x128
[   16.802443]  __asan_report_load1_noabort+0x20/0x30
[   16.802494]  kmalloc_uaf+0x300/0x338
[   16.802535]  kunit_try_run_case+0x170/0x3f0
[   16.802655]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.802708]  kthread+0x328/0x630
[   16.802772]  ret_from_fork+0x10/0x20
[   16.802990] 
[   16.803015] Allocated by task 184:
[   16.803097]  kasan_save_stack+0x3c/0x68
[   16.803142]  kasan_save_track+0x20/0x40
[   16.803190]  kasan_save_alloc_info+0x40/0x58
[   16.803237]  __kasan_kmalloc+0xd4/0xd8
[   16.803275]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.803314]  kmalloc_uaf+0xb8/0x338
[   16.803346]  kunit_try_run_case+0x170/0x3f0
[   16.803384]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.803428]  kthread+0x328/0x630
[   16.803460]  ret_from_fork+0x10/0x20
[   16.803636] 
[   16.803756] Freed by task 184:
[   16.803824]  kasan_save_stack+0x3c/0x68
[   16.803867]  kasan_save_track+0x20/0x40
[   16.803905]  kasan_save_free_info+0x4c/0x78
[   16.803967]  __kasan_slab_free+0x6c/0x98
[   16.804005]  kfree+0x214/0x3c8
[   16.804233]  kmalloc_uaf+0x11c/0x338
[   16.804358]  kunit_try_run_case+0x170/0x3f0
[   16.804418]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.804497]  kthread+0x328/0x630
[   16.804550]  ret_from_fork+0x10/0x20
[   16.804585] 
[   16.804850] The buggy address belongs to the object at fff00000c45d1ac0
[   16.804850]  which belongs to the cache kmalloc-16 of size 16
[   16.804971] The buggy address is located 8 bytes inside of
[   16.804971]  freed 16-byte region [fff00000c45d1ac0, fff00000c45d1ad0)
[   16.805070] 
[   16.805127] The buggy address belongs to the physical page:
[   16.805230] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1045d1
[   16.805304] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.805387] page_type: f5(slab)
[   16.805425] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   16.805476] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   16.805516] page dumped because: kasan: bad access detected
[   16.805556] 
[   16.805574] Memory state around the buggy address:
[   16.805616]  fff00000c45d1980: fa fb fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   16.805672]  fff00000c45d1a00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.805726] >fff00000c45d1a80: fa fb fc fc fa fb fc fc fa fb fc fc fc fc fc fc
[   16.805774]                                               ^
[   16.805811]  fff00000c45d1b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.805866]  fff00000c45d1b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.805905] ==================================================================

[   13.212534] ==================================================================
[   13.214148] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   13.214400] Read of size 1 at addr ffff888102610b88 by task kunit_try_catch/201
[   13.214624] 
[   13.214721] CPU: 1 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.214768] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.214779] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.214800] Call Trace:
[   13.214814]  <TASK>
[   13.214831]  dump_stack_lvl+0x73/0xb0
[   13.214860]  print_report+0xd1/0x610
[   13.214883]  ? __virt_addr_valid+0x1db/0x2d0
[   13.214907]  ? kmalloc_uaf+0x320/0x380
[   13.214926]  ? kasan_complete_mode_report_info+0x64/0x200
[   13.214949]  ? kmalloc_uaf+0x320/0x380
[   13.214969]  kasan_report+0x141/0x180
[   13.215003]  ? kmalloc_uaf+0x320/0x380
[   13.215027]  __asan_report_load1_noabort+0x18/0x20
[   13.215051]  kmalloc_uaf+0x320/0x380
[   13.215476]  ? __pfx_kmalloc_uaf+0x10/0x10
[   13.215500]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   13.215654]  ? trace_hardirqs_on+0x37/0xe0
[   13.215685]  ? __pfx_read_tsc+0x10/0x10
[   13.215707]  ? ktime_get_ts64+0x86/0x230
[   13.215731]  kunit_try_run_case+0x1a5/0x480
[   13.215757]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.215782]  ? queued_spin_lock_slowpath+0x116/0xb40
[   13.215808]  ? __kthread_parkme+0x82/0x180
[   13.215829]  ? preempt_count_sub+0x50/0x80
[   13.215853]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.215877]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.215901]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.215927]  kthread+0x337/0x6f0
[   13.215946]  ? trace_preempt_on+0x20/0xc0
[   13.215968]  ? __pfx_kthread+0x10/0x10
[   13.216053]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.216075]  ? calculate_sigpending+0x7b/0xa0
[   13.216099]  ? __pfx_kthread+0x10/0x10
[   13.216120]  ret_from_fork+0x116/0x1d0
[   13.216139]  ? __pfx_kthread+0x10/0x10
[   13.216174]  ret_from_fork_asm+0x1a/0x30
[   13.216204]  </TASK>
[   13.216215] 
[   13.228121] Allocated by task 201:
[   13.228324]  kasan_save_stack+0x45/0x70
[   13.228521]  kasan_save_track+0x18/0x40
[   13.228691]  kasan_save_alloc_info+0x3b/0x50
[   13.228883]  __kasan_kmalloc+0xb7/0xc0
[   13.229675]  __kmalloc_cache_noprof+0x189/0x420
[   13.229860]  kmalloc_uaf+0xaa/0x380
[   13.229990]  kunit_try_run_case+0x1a5/0x480
[   13.230409]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.230653]  kthread+0x337/0x6f0
[   13.230818]  ret_from_fork+0x116/0x1d0
[   13.231039]  ret_from_fork_asm+0x1a/0x30
[   13.231222] 
[   13.231321] Freed by task 201:
[   13.231465]  kasan_save_stack+0x45/0x70
[   13.231642]  kasan_save_track+0x18/0x40
[   13.231819]  kasan_save_free_info+0x3f/0x60
[   13.232154]  __kasan_slab_free+0x56/0x70
[   13.232355]  kfree+0x222/0x3f0
[   13.232503]  kmalloc_uaf+0x12c/0x380
[   13.232655]  kunit_try_run_case+0x1a5/0x480
[   13.232836]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.233141]  kthread+0x337/0x6f0
[   13.233307]  ret_from_fork+0x116/0x1d0
[   13.233481]  ret_from_fork_asm+0x1a/0x30
[   13.233661] 
[   13.233750] The buggy address belongs to the object at ffff888102610b80
[   13.233750]  which belongs to the cache kmalloc-16 of size 16
[   13.235256] The buggy address is located 8 bytes inside of
[   13.235256]  freed 16-byte region [ffff888102610b80, ffff888102610b90)
[   13.235820] 
[   13.235898] The buggy address belongs to the physical page:
[   13.236718] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102610
[   13.237289] flags: 0x200000000000000(node=0|zone=2)
[   13.237515] page_type: f5(slab)
[   13.237671] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   13.238029] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   13.238342] page dumped because: kasan: bad access detected
[   13.238564] 
[   13.238650] Memory state around the buggy address:
[   13.238856]  ffff888102610a80: 00 04 fc fc 00 01 fc fc 00 01 fc fc 00 04 fc fc
[   13.239208]  ffff888102610b00: 00 04 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   13.239506] >ffff888102610b80: fa fb fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.239794]                       ^
[   13.239950]  ffff888102610c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.240386]  ffff888102610c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.240678] ==================================================================