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

Environment
qemu-arm64
qemu-x86_64

[   20.176647] ==================================================================
[   20.177490] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x30c/0x340
[   20.178249] Read of size 1 at addr fff00000c6451428 by task kunit_try_catch/171
[   20.178745] 
[   20.179074] CPU: 1 UID: 0 PID: 171 Comm: kunit_try_catch Tainted: G    B            N 6.12.32-rc1 #1
[   20.179295] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.179352] Hardware name: linux,dummy-virt (DT)
[   20.179418] Call trace:
[   20.179460]  dump_backtrace+0x9c/0x128
[   20.179570]  show_stack+0x20/0x38
[   20.179659]  dump_stack_lvl+0x8c/0xd0
[   20.179763]  print_report+0x118/0x5f0
[   20.179861]  kasan_report+0xdc/0x128
[   20.179954]  __asan_report_load1_noabort+0x20/0x30
[   20.180062]  kmalloc_uaf+0x30c/0x340
[   20.180182]  kunit_try_run_case+0x170/0x3f0
[   20.180420]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.180480]  kthread+0x24c/0x2d0
[   20.180526]  ret_from_fork+0x10/0x20
[   20.180576] 
[   20.185386] Allocated by task 171:
[   20.185874]  kasan_save_stack+0x3c/0x68
[   20.186142]  kasan_save_track+0x20/0x40
[   20.186644]  kasan_save_alloc_info+0x40/0x58
[   20.187506]  __kasan_kmalloc+0xd4/0xd8
[   20.188190]  __kmalloc_cache_noprof+0x154/0x320
[   20.188724]  kmalloc_uaf+0xb8/0x340
[   20.189703]  kunit_try_run_case+0x170/0x3f0
[   20.190144]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.190767]  kthread+0x24c/0x2d0
[   20.191260]  ret_from_fork+0x10/0x20
[   20.191882] 
[   20.192059] Freed by task 171:
[   20.192699]  kasan_save_stack+0x3c/0x68
[   20.193226]  kasan_save_track+0x20/0x40
[   20.193681]  kasan_save_free_info+0x4c/0x78
[   20.194201]  __kasan_slab_free+0x6c/0x98
[   20.194563]  kfree+0x110/0x3b8
[   20.194996]  kmalloc_uaf+0x120/0x340
[   20.195702]  kunit_try_run_case+0x170/0x3f0
[   20.196103]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.196727]  kthread+0x24c/0x2d0
[   20.197105]  ret_from_fork+0x10/0x20
[   20.197587] 
[   20.197858] The buggy address belongs to the object at fff00000c6451420
[   20.197858]  which belongs to the cache kmalloc-16 of size 16
[   20.198815] The buggy address is located 8 bytes inside of
[   20.198815]  freed 16-byte region [fff00000c6451420, fff00000c6451430)
[   20.200349] 
[   20.200874] The buggy address belongs to the physical page:
[   20.201636] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106451
[   20.202063] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.202781] page_type: f5(slab)
[   20.203100] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   20.204119] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   20.204847] page dumped because: kasan: bad access detected
[   20.205345] 
[   20.205507] Memory state around the buggy address:
[   20.205777]  fff00000c6451300: 00 02 fc fc 00 02 fc fc 00 06 fc fc 00 06 fc fc
[   20.206538]  fff00000c6451380: fa fb fc fc 00 05 fc fc fa fb fc fc fa fb fc fc
[   20.207556] >fff00000c6451400: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   20.207907]                                   ^
[   20.208462]  fff00000c6451480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.209183]  fff00000c6451500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.209780] ==================================================================

[   12.325004] ==================================================================
[   12.325598] BUG: KASAN: slab-use-after-free in kmalloc_uaf+0x322/0x380
[   12.326030] Read of size 1 at addr ffff8881024e41a8 by task kunit_try_catch/189
[   12.326370] 
[   12.326804] CPU: 0 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G    B            N 6.12.32-rc1 #1
[   12.326888] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.326903] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.326932] Call Trace:
[   12.326949]  <TASK>
[   12.326967]  dump_stack_lvl+0x73/0xb0
[   12.326999]  print_report+0xd1/0x640
[   12.327029]  ? __virt_addr_valid+0x1db/0x2d0
[   12.327063]  ? kmalloc_uaf+0x322/0x380
[   12.327486]  ? kasan_complete_mode_report_info+0x64/0x200
[   12.327530]  ? kmalloc_uaf+0x322/0x380
[   12.327562]  kasan_report+0x140/0x180
[   12.327588]  ? kmalloc_uaf+0x322/0x380
[   12.327612]  __asan_report_load1_noabort+0x18/0x20
[   12.327632]  kmalloc_uaf+0x322/0x380
[   12.327652]  ? __pfx_kmalloc_uaf+0x10/0x10
[   12.327696]  ? __schedule+0xc49/0x27a0
[   12.327718]  ? __pfx_read_tsc+0x10/0x10
[   12.327738]  ? ktime_get_ts64+0x84/0x230
[   12.327763]  kunit_try_run_case+0x1a6/0x480
[   12.327786]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.327804]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   12.327824]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.327846]  ? __kthread_parkme+0x82/0x160
[   12.327865]  ? preempt_count_sub+0x50/0x80
[   12.327887]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.327906]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.327929]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.327953]  kthread+0x257/0x310
[   12.327970]  ? __pfx_kthread+0x10/0x10
[   12.327987]  ret_from_fork+0x41/0x80
[   12.328006]  ? __pfx_kthread+0x10/0x10
[   12.328023]  ret_from_fork_asm+0x1a/0x30
[   12.328067]  </TASK>
[   12.328150] 
[   12.336211] Allocated by task 189:
[   12.336473]  kasan_save_stack+0x45/0x70
[   12.336689]  kasan_save_track+0x18/0x40
[   12.336947]  kasan_save_alloc_info+0x3b/0x50
[   12.337335]  __kasan_kmalloc+0xb7/0xc0
[   12.337516]  __kmalloc_cache_noprof+0x168/0x350
[   12.337710]  kmalloc_uaf+0xab/0x380
[   12.337861]  kunit_try_run_case+0x1a6/0x480
[   12.338576]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.338993]  kthread+0x257/0x310
[   12.339253]  ret_from_fork+0x41/0x80
[   12.339649]  ret_from_fork_asm+0x1a/0x30
[   12.339963] 
[   12.340092] Freed by task 189:
[   12.340259]  kasan_save_stack+0x45/0x70
[   12.340480]  kasan_save_track+0x18/0x40
[   12.340715]  kasan_save_free_info+0x3f/0x60
[   12.341008]  __kasan_slab_free+0x56/0x70
[   12.341229]  kfree+0x123/0x3d0
[   12.341389]  kmalloc_uaf+0x12d/0x380
[   12.341627]  kunit_try_run_case+0x1a6/0x480
[   12.342022]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.342406]  kthread+0x257/0x310
[   12.342609]  ret_from_fork+0x41/0x80
[   12.342823]  ret_from_fork_asm+0x1a/0x30
[   12.342997] 
[   12.343227] The buggy address belongs to the object at ffff8881024e41a0
[   12.343227]  which belongs to the cache kmalloc-16 of size 16
[   12.343975] The buggy address is located 8 bytes inside of
[   12.343975]  freed 16-byte region [ffff8881024e41a0, ffff8881024e41b0)
[   12.345095] 
[   12.345267] The buggy address belongs to the physical page:
[   12.345755] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1024e4
[   12.346127] flags: 0x200000000000000(node=0|zone=2)
[   12.346546] page_type: f5(slab)
[   12.346818] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   12.347098] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   12.347466] page dumped because: kasan: bad access detected
[   12.347828] 
[   12.347966] Memory state around the buggy address:
[   12.348420]  ffff8881024e4080: fa fb fc fc 00 03 fc fc 00 03 fc fc 00 05 fc fc
[   12.348881]  ffff8881024e4100: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   12.349734] >ffff8881024e4180: fa fb fc fc fa fb fc fc fc fc fc fc fc fc fc fc
[   12.350071]                                   ^
[   12.350530]  ffff8881024e4200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.350817]  ffff8881024e4280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.351355] ==================================================================