Hay
Date
Feb. 5, 2025, 2:09 p.m.

Environment
qemu-armv7
qemu-x86_64

[  144.524339] ==================================================================
[  144.526095] BUG: KASAN: use-after-free in pagealloc_uaf+0xc8/0x1cc
[  144.526985] Read of size 1 at addr c8f40000 by task kunit_try_catch/125
[  144.527519] 
[  144.527735] CPU: 0 PID: 125 Comm: kunit_try_catch Tainted: G    B            N 6.6.76-rc1 #1
[  144.529318] Hardware name: Generic DT based system
[  144.530379]  unwind_backtrace from show_stack+0x18/0x1c
[  144.531227]  show_stack from dump_stack_lvl+0x58/0x70
[  144.531943]  dump_stack_lvl from print_report+0x164/0x51c
[  144.532836]  print_report from kasan_report+0xc8/0x104
[  144.533598]  kasan_report from pagealloc_uaf+0xc8/0x1cc
[  144.534476]  pagealloc_uaf from kunit_try_run_case+0x11c/0x2e4
[  144.535521]  kunit_try_run_case from kunit_generic_run_threadfn_adapter+0x2c/0x48
[  144.536904]  kunit_generic_run_threadfn_adapter from kthread+0x184/0x1a8
[  144.537725]  kthread from ret_from_fork+0x14/0x30
[  144.538330] Exception stack(0xf9ef3fb0 to 0xf9ef3ff8)
[  144.538932] 3fa0:                                     00000000 00000000 00000000 00000000
[  144.539780] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  144.540618] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[  144.541381] 
[  144.541631] The buggy address belongs to the physical page:
[  144.542124] page:255cd0fe refcount:0 mapcount:0 mapping:00000000 index:0x0 pfn:0x48f40
[  144.543188] flags: 0x0(zone=0)
[  144.543542] page_type: 0xffffff7f(buddy)
[  144.544264] raw: 00000000 c40f8ef8 c40f8ef8 00000000 00000000 00000006 ffffff7f 00000000
[  144.545081] raw: 00000000
[  144.545439] page dumped because: kasan: bad access detected
[  144.546194] 
[  144.546481] Memory state around the buggy address:
[  144.547301]  c8f3ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  144.548175]  c8f3ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[  144.548837] >c8f40000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[  144.549626]            ^
[  144.549934]  c8f40080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[  144.550770]  c8f40100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[  144.551494] ==================================================================


[   46.988664] ==================================================================
[   46.990167] BUG: KASAN: use-after-free in pagealloc_uaf+0xe9/0x1f0
[   46.990866] Read of size 1 at addr ffff888102a30000 by task kunit_try_catch/148
[   46.991724] 
[   46.992046] CPU: 0 PID: 148 Comm: kunit_try_catch Tainted: G    B            N 6.6.76-rc1 #1
[   46.992836] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   46.993824] Call Trace:
[   46.994228]  <TASK>
[   46.994590]  dump_stack_lvl+0x4e/0x90
[   46.995083]  print_report+0xd2/0x660
[   46.995680]  ? __virt_addr_valid+0x156/0x1e0
[   46.996356]  ? kasan_addr_to_slab+0x11/0xb0
[   46.996868]  kasan_report+0xff/0x140
[   46.997453]  ? pagealloc_uaf+0xe9/0x1f0
[   46.998146]  ? pagealloc_uaf+0xe9/0x1f0
[   46.998634]  __asan_load1+0x66/0x70
[   46.999269]  pagealloc_uaf+0xe9/0x1f0
[   46.999877]  ? __pfx_pagealloc_uaf+0x10/0x10
[   47.000340]  ? __pfx_pagealloc_uaf+0x10/0x10
[   47.000990]  ? kunit_try_run_case+0x11b/0x290
[   47.001638]  kunit_try_run_case+0x126/0x290
[   47.002221]  ? __pfx_kunit_try_run_case+0x10/0x10
[   47.002925]  ? __kasan_check_write+0x18/0x20
[   47.003445]  ? trace_preempt_on+0x20/0xa0
[   47.004068]  ? __kthread_parkme+0x4f/0xd0
[   47.004679]  ? preempt_count_sub+0x50/0x80
[   47.005162]  ? __pfx_kunit_try_run_case+0x10/0x10
[   47.005902]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   47.006659]  kunit_generic_run_threadfn_adapter+0x33/0x50
[   47.007450]  kthread+0x19e/0x1e0
[   47.007952]  ? __pfx_kthread+0x10/0x10
[   47.008590]  ret_from_fork+0x41/0x70
[   47.009128]  ? __pfx_kthread+0x10/0x10
[   47.009701]  ret_from_fork_asm+0x1b/0x30
[   47.010318]  </TASK>
[   47.010628] 
[   47.011005] The buggy address belongs to the physical page:
[   47.011620] page:(____ptrval____) refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a30
[   47.012448] flags: 0x200000000000000(node=0|zone=2)
[   47.013096] page_type: 0xffffff7f(buddy)
[   47.013684] raw: 0200000000000000 ffff88817fffab60 ffff88817fffab60 0000000000000000
[   47.014511] raw: 0000000000000000 0000000000000004 00000000ffffff7f 0000000000000000
[   47.015270] page dumped because: kasan: bad access detected
[   47.015917] 
[   47.016235] Memory state around the buggy address:
[   47.016710]  ffff888102a2ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   47.017480]  ffff888102a2ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   47.018332] >ffff888102a30000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   47.018926]                    ^
[   47.019376]  ffff888102a30080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   47.020164]  ffff888102a30100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   47.020777] ==================================================================