Hay
Date
Dec. 6, 2024, 3:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   30.234832] ==================================================================
[   30.236390] BUG: KASAN: use-after-free in page_alloc_uaf+0x328/0x350
[   30.237142] Read of size 1 at addr fff00000c6a90000 by task kunit_try_catch/143
[   30.237793] 
[   30.239262] CPU: 1 UID: 0 PID: 143 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   30.240339] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.240848] Hardware name: linux,dummy-virt (DT)
[   30.241482] Call trace:
[   30.241965]  show_stack+0x20/0x38 (C)
[   30.242943]  dump_stack_lvl+0x8c/0xd0
[   30.243455]  print_report+0x118/0x5e0
[   30.244110]  kasan_report+0xc8/0x118
[   30.244742]  __asan_report_load1_noabort+0x20/0x30
[   30.245637]  page_alloc_uaf+0x328/0x350
[   30.246414]  kunit_try_run_case+0x14c/0x3d0
[   30.247098]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.247832]  kthread+0x24c/0x2d0
[   30.248420]  ret_from_fork+0x10/0x20
[   30.249250] 
[   30.249609] The buggy address belongs to the physical page:
[   30.250495] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106a90
[   30.251461] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.252254] page_type: f0(buddy)
[   30.252731] raw: 0bfffe0000000000 fff00000ff6150e0 fff00000ff6150e0 0000000000000000
[   30.253713] raw: 0000000000000000 0000000000000004 00000000f0000000 0000000000000000
[   30.254843] page dumped because: kasan: bad access detected
[   30.255543] 
[   30.255908] Memory state around the buggy address:
[   30.256454]  fff00000c6a8ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   30.258045]  fff00000c6a8ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   30.259230] >fff00000c6a90000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   30.259979]                    ^
[   30.260533]  fff00000c6a90080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   30.261343]  fff00000c6a90100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   30.262145] ==================================================================

[   22.406214] ==================================================================
[   22.408286] BUG: KASAN: use-after-free in page_alloc_uaf+0x358/0x3d0
[   22.409384] Read of size 1 at addr ffff888102b30000 by task kunit_try_catch/162
[   22.410082] 
[   22.410396] CPU: 0 UID: 0 PID: 162 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241206 #1
[   22.411776] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.412345] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.413239] Call Trace:
[   22.413588]  <TASK>
[   22.414236]  dump_stack_lvl+0x73/0xb0
[   22.414749]  print_report+0xd1/0x640
[   22.415256]  ? __virt_addr_valid+0x1db/0x2d0
[   22.416175]  ? kasan_addr_to_slab+0x11/0xa0
[   22.416649]  kasan_report+0x102/0x140
[   22.417259]  ? page_alloc_uaf+0x358/0x3d0
[   22.417774]  ? page_alloc_uaf+0x358/0x3d0
[   22.419152]  __asan_report_load1_noabort+0x18/0x20
[   22.419980]  page_alloc_uaf+0x358/0x3d0
[   22.420554]  ? __pfx_page_alloc_uaf+0x10/0x10
[   22.420992]  ? __schedule+0xc70/0x27e0
[   22.421444]  ? __pfx_read_tsc+0x10/0x10
[   22.421881]  ? ktime_get_ts64+0x86/0x230
[   22.423247]  kunit_try_run_case+0x1b3/0x490
[   22.424106]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.424560]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   22.425080]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.426520]  ? __kthread_parkme+0x82/0x160
[   22.427469]  ? preempt_count_sub+0x50/0x80
[   22.428255]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.429222]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.430063]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.431607]  kthread+0x257/0x310
[   22.431918]  ? __pfx_kthread+0x10/0x10
[   22.433149]  ret_from_fork+0x41/0x80
[   22.433562]  ? __pfx_kthread+0x10/0x10
[   22.434608]  ret_from_fork_asm+0x1a/0x30
[   22.435025]  </TASK>
[   22.436034] 
[   22.436390] The buggy address belongs to the physical page:
[   22.437263] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b30
[   22.438129] flags: 0x200000000000000(node=0|zone=2)
[   22.438753] page_type: f0(buddy)
[   22.439065] raw: 0200000000000000 ffff88817fffb4a0 ffff88817fffb4a0 0000000000000000
[   22.440643] raw: 0000000000000000 0000000000000004 00000000f0000000 0000000000000000
[   22.441645] page dumped because: kasan: bad access detected
[   22.442672] 
[   22.442855] Memory state around the buggy address:
[   22.443222]  ffff888102b2ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.444830]  ffff888102b2ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.445313] >ffff888102b30000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.446634]                    ^
[   22.447033]  ffff888102b30080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.448172]  ffff888102b30100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.449237] ==================================================================