Hay
Date
Nov. 22, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.520031] ==================================================================
[   32.522250] BUG: KASAN: use-after-free in page_alloc_uaf+0x328/0x350
[   32.524062] Read of size 1 at addr fff00000c6a30000 by task kunit_try_catch/143
[   32.525660] 
[   32.526048] CPU: 0 UID: 0 PID: 143 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241122 #1
[   32.527285] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.528319] Hardware name: linux,dummy-virt (DT)
[   32.529407] Call trace:
[   32.529755]  show_stack+0x20/0x38 (C)
[   32.530525]  dump_stack_lvl+0x8c/0xd0
[   32.531468]  print_report+0x118/0x5e0
[   32.531989]  kasan_report+0xc8/0x118
[   32.532608]  __asan_report_load1_noabort+0x20/0x30
[   32.533209]  page_alloc_uaf+0x328/0x350
[   32.533911]  kunit_try_run_case+0x14c/0x3d0
[   32.534514]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.535301]  kthread+0x24c/0x2d0
[   32.535913]  ret_from_fork+0x10/0x20
[   32.536342] 
[   32.536698] The buggy address belongs to the physical page:
[   32.538782] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106a30
[   32.539644] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.541783] page_type: f0(buddy)
[   32.542417] raw: 0bfffe0000000000 fff00000ff6150e0 fff00000ff6150e0 0000000000000000
[   32.543093] raw: 0000000000000000 0000000000000004 00000000f0000000 0000000000000000
[   32.543775] page dumped because: kasan: bad access detected
[   32.545004] 
[   32.545588] Memory state around the buggy address:
[   32.548037]  fff00000c6a2ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.550731]  fff00000c6a2ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.552589] >fff00000c6a30000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.553600]                    ^
[   32.554001]  fff00000c6a30080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.556943]  fff00000c6a30100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.558148] ==================================================================

[   24.156703] ==================================================================
[   24.158711] BUG: KASAN: use-after-free in page_alloc_uaf+0x358/0x3d0
[   24.159260] Read of size 1 at addr ffff888102cb0000 by task kunit_try_catch/162
[   24.160169] 
[   24.160745] CPU: 1 UID: 0 PID: 162 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241122 #1
[   24.161922] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.162389] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.163649] Call Trace:
[   24.163895]  <TASK>
[   24.164084]  dump_stack_lvl+0x73/0xb0
[   24.164765]  print_report+0xd1/0x640
[   24.165132]  ? __virt_addr_valid+0x1db/0x2d0
[   24.166113]  ? kasan_addr_to_slab+0x11/0xa0
[   24.166483]  kasan_report+0x102/0x140
[   24.167076]  ? page_alloc_uaf+0x358/0x3d0
[   24.167573]  ? page_alloc_uaf+0x358/0x3d0
[   24.168169]  __asan_report_load1_noabort+0x18/0x20
[   24.168706]  page_alloc_uaf+0x358/0x3d0
[   24.169117]  ? __pfx_page_alloc_uaf+0x10/0x10
[   24.169494]  ? __schedule+0xc3e/0x2790
[   24.169998]  ? __pfx_read_tsc+0x10/0x10
[   24.170463]  ? ktime_get_ts64+0x84/0x230
[   24.170958]  kunit_try_run_case+0x1b3/0x490
[   24.171447]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.171983]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   24.172477]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.172840]  ? __kthread_parkme+0x82/0x160
[   24.173125]  ? preempt_count_sub+0x50/0x80
[   24.173572]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.174156]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.174787]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.175284]  kthread+0x257/0x310
[   24.175734]  ? __pfx_kthread+0x10/0x10
[   24.176168]  ret_from_fork+0x41/0x80
[   24.176621]  ? __pfx_kthread+0x10/0x10
[   24.177093]  ret_from_fork_asm+0x1a/0x30
[   24.177556]  </TASK>
[   24.177884] 
[   24.178145] The buggy address belongs to the physical page:
[   24.178640] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102cb0
[   24.179183] flags: 0x200000000000000(node=0|zone=2)
[   24.179740] page_type: f0(buddy)
[   24.180109] raw: 0200000000000000 ffff88817fffc4a0 ffff88817fffc4a0 0000000000000000
[   24.180608] raw: 0000000000000000 0000000000000004 00000000f0000000 0000000000000000
[   24.181362] page dumped because: kasan: bad access detected
[   24.181815] 
[   24.181998] Memory state around the buggy address:
[   24.182527]  ffff888102caff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.183212]  ffff888102caff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.183725] >ffff888102cb0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.184374]                    ^
[   24.184765]  ffff888102cb0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.185392]  ffff888102cb0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   24.186072] ==================================================================