Hay
Date
July 17, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.757251] ==================================================================
[   16.757348] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x300/0x338
[   16.757411] Read of size 1 at addr fff00000c3e55168 by task kunit_try_catch/184
[   16.757458] 
[   16.757497] CPU: 1 UID: 0 PID: 184 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.757579] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.757616] Hardware name: linux,dummy-virt (DT)
[   16.757648] Call trace:
[   16.757682]  show_stack+0x20/0x38 (C)
[   16.757730]  dump_stack_lvl+0x8c/0xd0
[   16.757779]  print_report+0x118/0x5d0
[   16.757833]  kasan_report+0xdc/0x128
[   16.757890]  __asan_report_load1_noabort+0x20/0x30
[   16.757941]  kmalloc_uaf+0x300/0x338
[   16.757983]  kunit_try_run_case+0x170/0x3f0
[   16.758031]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.758080]  kthread+0x328/0x630
[   16.758122]  ret_from_fork+0x10/0x20
[   16.758169] 
[   16.758188] Allocated by task 184:
[   16.758223]  kasan_save_stack+0x3c/0x68
[   16.758272]  kasan_save_track+0x20/0x40
[   16.758310]  kasan_save_alloc_info+0x40/0x58
[   16.758350]  __kasan_kmalloc+0xd4/0xd8
[   16.758386]  __kmalloc_cache_noprof+0x16c/0x3c0
[   16.758436]  kmalloc_uaf+0xb8/0x338
[   16.758474]  kunit_try_run_case+0x170/0x3f0
[   16.758510]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.758561]  kthread+0x328/0x630
[   16.758594]  ret_from_fork+0x10/0x20
[   16.758628] 
[   16.758648] Freed by task 184:
[   16.758672]  kasan_save_stack+0x3c/0x68
[   16.758709]  kasan_save_track+0x20/0x40
[   16.758744]  kasan_save_free_info+0x4c/0x78
[   16.758799]  __kasan_slab_free+0x6c/0x98
[   16.758836]  kfree+0x214/0x3c8
[   16.758877]  kmalloc_uaf+0x11c/0x338
[   16.758912]  kunit_try_run_case+0x170/0x3f0
[   16.758948]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.759248]  kthread+0x328/0x630
[   16.759427]  ret_from_fork+0x10/0x20
[   16.759618] 
[   16.759645] The buggy address belongs to the object at fff00000c3e55160
[   16.759645]  which belongs to the cache kmalloc-16 of size 16
[   16.760065] The buggy address is located 8 bytes inside of
[   16.760065]  freed 16-byte region [fff00000c3e55160, fff00000c3e55170)
[   16.760316] 
[   16.760372] The buggy address belongs to the physical page:
[   16.760447] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103e55
[   16.760551] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.760664] page_type: f5(slab)
[   16.760757] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   16.760858] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   16.760913] page dumped because: kasan: bad access detected
[   16.760944] 
[   16.760962] Memory state around the buggy address:
[   16.760996]  fff00000c3e55000: 00 06 fc fc 00 06 fc fc 00 02 fc fc 00 06 fc fc
[   16.761038]  fff00000c3e55080: 00 05 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.761227] >fff00000c3e55100: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   16.761311]                                                           ^
[   16.761414]  fff00000c3e55180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.761492]  fff00000c3e55200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.761609] ==================================================================

[   12.506655] ==================================================================
[   12.507109] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x320/0x380
[   12.507334] Read of size 1 at addr ffff8881022efca8 by task kunit_try_catch/201
[   12.507558] 
[   12.507652] CPU: 0 UID: 0 PID: 201 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   12.507699] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.507710] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.507732] Call Trace:
[   12.507743]  <TASK>
[   12.507760]  dump_stack_lvl+0x73/0xb0
[   12.507788]  print_report+0xd1/0x610
[   12.507808]  ? __virt_addr_valid+0x1db/0x2d0
[   12.507831]  ? kmalloc_uaf+0x320/0x380
[   12.507848]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.507869]  ? kmalloc_uaf+0x320/0x380
[   12.507888]  kasan_report+0x141/0x180
[   12.507908]  ? kmalloc_uaf+0x320/0x380
[   12.507933]  __asan_report_load1_noabort+0x18/0x20
[   12.507955]  kmalloc_uaf+0x320/0x380
[   12.507973]  ? __pfx_kmalloc_uaf+0x10/0x10
[   12.507993]  ? __schedule+0x10cc/0x2b60
[   12.508015]  ? __pfx_read_tsc+0x10/0x10
[   12.508035]  ? ktime_get_ts64+0x86/0x230
[   12.508102]  kunit_try_run_case+0x1a5/0x480
[   12.508129]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.508151]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.508175]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.508198]  ? __kthread_parkme+0x82/0x180
[   12.508219]  ? preempt_count_sub+0x50/0x80
[   12.508244]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.508267]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.508290]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.508313]  kthread+0x337/0x6f0
[   12.508332]  ? trace_preempt_on+0x20/0xc0
[   12.508355]  ? __pfx_kthread+0x10/0x10
[   12.508376]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.508397]  ? calculate_sigpending+0x7b/0xa0
[   12.508421]  ? __pfx_kthread+0x10/0x10
[   12.508442]  ret_from_fork+0x116/0x1d0
[   12.508460]  ? __pfx_kthread+0x10/0x10
[   12.508480]  ret_from_fork_asm+0x1a/0x30
[   12.508512]  </TASK>
[   12.508523] 
[   12.522039] Allocated by task 201:
[   12.522515]  kasan_save_stack+0x45/0x70
[   12.522991]  kasan_save_track+0x18/0x40
[   12.523385]  kasan_save_alloc_info+0x3b/0x50
[   12.523852]  __kasan_kmalloc+0xb7/0xc0
[   12.524242]  __kmalloc_cache_noprof+0x189/0x420
[   12.524718]  kmalloc_uaf+0xaa/0x380
[   12.525161]  kunit_try_run_case+0x1a5/0x480
[   12.525590]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.526167]  kthread+0x337/0x6f0
[   12.526513]  ret_from_fork+0x116/0x1d0
[   12.526932]  ret_from_fork_asm+0x1a/0x30
[   12.527421] 
[   12.527605] Freed by task 201:
[   12.527980]  kasan_save_stack+0x45/0x70
[   12.528332]  kasan_save_track+0x18/0x40
[   12.528732]  kasan_save_free_info+0x3f/0x60
[   12.529182]  __kasan_slab_free+0x56/0x70
[   12.529369]  kfree+0x222/0x3f0
[   12.529489]  kmalloc_uaf+0x12c/0x380
[   12.529808]  kunit_try_run_case+0x1a5/0x480
[   12.530291]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.530906]  kthread+0x337/0x6f0
[   12.531243]  ret_from_fork+0x116/0x1d0
[   12.531539]  ret_from_fork_asm+0x1a/0x30
[   12.532009] 
[   12.532124] The buggy address belongs to the object at ffff8881022efca0
[   12.532124]  which belongs to the cache kmalloc-16 of size 16
[   12.532485] The buggy address is located 8 bytes inside of
[   12.532485]  freed 16-byte region [ffff8881022efca0, ffff8881022efcb0)
[   12.533662] 
[   12.533879] The buggy address belongs to the physical page:
[   12.534433] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1022ef
[   12.535378] flags: 0x200000000000000(node=0|zone=2)
[   12.536134] page_type: f5(slab)
[   12.536425] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.536976] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   12.537407] page dumped because: kasan: bad access detected
[   12.537600] 
[   12.537834] Memory state around the buggy address:
[   12.538396]  ffff8881022efb80: 00 04 fc fc 00 04 fc fc 00 01 fc fc 00 01 fc fc
[   12.539067]  ffff8881022efc00: 00 04 fc fc 00 04 fc fc 00 05 fc fc fa fb fc fc
[   12.539695] >ffff8881022efc80: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   12.540335]                                   ^
[   12.540498]  ffff8881022efd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.541152]  ffff8881022efd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.541814] ==================================================================