Hay
Date
Dec. 4, 2024, 3:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.031381] ==================================================================
[   31.032966] BUG: KASAN: use-after-free in page_alloc_uaf+0x328/0x350
[   31.033613] Read of size 1 at addr fff00000c5e30000 by task kunit_try_catch/142
[   31.035923] 
[   31.036372] CPU: 0 UID: 0 PID: 142 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   31.037767] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.038322] Hardware name: linux,dummy-virt (DT)
[   31.039495] Call trace:
[   31.039971]  show_stack+0x20/0x38 (C)
[   31.040521]  dump_stack_lvl+0x8c/0xd0
[   31.041102]  print_report+0x118/0x5e0
[   31.041811]  kasan_report+0xc8/0x118
[   31.042609]  __asan_report_load1_noabort+0x20/0x30
[   31.043472]  page_alloc_uaf+0x328/0x350
[   31.044089]  kunit_try_run_case+0x14c/0x3d0
[   31.044844]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.045494]  kthread+0x24c/0x2d0
[   31.046348]  ret_from_fork+0x10/0x20
[   31.047007] 
[   31.047357] The buggy address belongs to the physical page:
[   31.048052] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105e30
[   31.049034] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.049906] page_type: f0(buddy)
[   31.050462] raw: 0bfffe0000000000 fff00000ff6150e0 fff00000ff6150e0 0000000000000000
[   31.051364] raw: 0000000000000000 0000000000000004 00000000f0000000 0000000000000000
[   31.052717] page dumped because: kasan: bad access detected
[   31.053649] 
[   31.054928] Memory state around the buggy address:
[   31.055527]  fff00000c5e2ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.056427]  fff00000c5e2ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.057364] >fff00000c5e30000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.058679]                    ^
[   31.059120]  fff00000c5e30080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.060080]  fff00000c5e30100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.060882] ==================================================================

[   21.740468] ==================================================================
[   21.741821] BUG: KASAN: use-after-free in page_alloc_uaf+0x358/0x3d0
[   21.743187] Read of size 1 at addr ffff888102cb0000 by task kunit_try_catch/162
[   21.744465] 
[   21.744991] CPU: 0 UID: 0 PID: 162 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   21.746043] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.746660] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.747724] Call Trace:
[   21.748043]  <TASK>
[   21.748892]  dump_stack_lvl+0x73/0xb0
[   21.749691]  print_report+0xd1/0x640
[   21.750098]  ? __virt_addr_valid+0x1db/0x2d0
[   21.751630]  ? kasan_addr_to_slab+0x11/0xa0
[   21.752486]  kasan_report+0x102/0x140
[   21.753123]  ? page_alloc_uaf+0x358/0x3d0
[   21.754003]  ? page_alloc_uaf+0x358/0x3d0
[   21.755161]  __asan_report_load1_noabort+0x18/0x20
[   21.756228]  page_alloc_uaf+0x358/0x3d0
[   21.757048]  ? __pfx_page_alloc_uaf+0x10/0x10
[   21.757736]  ? __schedule+0xc3e/0x2790
[   21.758221]  ? __pfx_read_tsc+0x10/0x10
[   21.759047]  ? ktime_get_ts64+0x86/0x230
[   21.759621]  kunit_try_run_case+0x1b3/0x490
[   21.760406]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.760918]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   21.761247]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.761997]  ? __kthread_parkme+0x82/0x160
[   21.762366]  ? preempt_count_sub+0x50/0x80
[   21.763042]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.763371]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.764085]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.764718]  kthread+0x257/0x310
[   21.764973]  ? __pfx_kthread+0x10/0x10
[   21.765656]  ret_from_fork+0x41/0x80
[   21.765944]  ? __pfx_kthread+0x10/0x10
[   21.766213]  ret_from_fork_asm+0x1a/0x30
[   21.767085]  </TASK>
[   21.767425] 
[   21.767580] The buggy address belongs to the physical page:
[   21.768819] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102cb0
[   21.769547] flags: 0x200000000000000(node=0|zone=2)
[   21.770891] page_type: f0(buddy)
[   21.771592] raw: 0200000000000000 ffff88817fffd4a0 ffff88817fffd4a0 0000000000000000
[   21.772321] raw: 0000000000000000 0000000000000004 00000000f0000000 0000000000000000
[   21.773481] page dumped because: kasan: bad access detected
[   21.774136] 
[   21.774586] Memory state around the buggy address:
[   21.775008]  ffff888102caff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.776115]  ffff888102caff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.777768] >ffff888102cb0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.779235]                    ^
[   21.779727]  ffff888102cb0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.781440]  ffff888102cb0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   21.781728] ==================================================================