Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.801723] ==================================================================
[   17.801868] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2cc/0x2f8
[   17.802117] Read of size 1 at addr fff00000c67ec000 by task kunit_try_catch/148
[   17.802275] 
[   17.802305] CPU: 1 UID: 0 PID: 148 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   17.802471] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.802543] Hardware name: linux,dummy-virt (DT)
[   17.802579] Call trace:
[   17.802678]  show_stack+0x20/0x38 (C)
[   17.802763]  dump_stack_lvl+0x8c/0xd0
[   17.802808]  print_report+0x118/0x608
[   17.802872]  kasan_report+0xdc/0x128
[   17.802916]  __asan_report_load1_noabort+0x20/0x30
[   17.802965]  kmalloc_large_uaf+0x2cc/0x2f8
[   17.803008]  kunit_try_run_case+0x170/0x3f0
[   17.803317]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.803382]  kthread+0x328/0x630
[   17.803586]  ret_from_fork+0x10/0x20
[   17.803637] 
[   17.803676] The buggy address belongs to the physical page:
[   17.803705] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1067ec
[   17.803776] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.803898] raw: 0bfffe0000000000 fff00000da478c00 fff00000da478c00 0000000000000000
[   17.804023] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   17.804133] page dumped because: kasan: bad access detected
[   17.804206] 
[   17.804224] Memory state around the buggy address:
[   17.804254]  fff00000c67ebf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.804304]  fff00000c67ebf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.804448] >fff00000c67ec000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.804541]                    ^
[   17.804596]  fff00000c67ec080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.804635]  fff00000c67ec100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.804671] ==================================================================


[   13.470442] ==================================================================
[   13.470975] BUG: KASAN: use-after-free in kmalloc_large_uaf+0x2f1/0x340
[   13.471275] Read of size 1 at addr ffff88810298c000 by task kunit_try_catch/166
[   13.471607] 
[   13.471753] CPU: 0 UID: 0 PID: 166 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   13.471833] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.471852] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.471885] Call Trace:
[   13.471908]  <TASK>
[   13.471941]  dump_stack_lvl+0x73/0xb0
[   13.472000]  print_report+0xd1/0x650
[   13.472045]  ? __virt_addr_valid+0x1db/0x2d0
[   13.472092]  ? kmalloc_large_uaf+0x2f1/0x340
[   13.472120]  ? kasan_addr_to_slab+0x11/0xa0
[   13.472141]  ? kmalloc_large_uaf+0x2f1/0x340
[   13.472161]  kasan_report+0x141/0x180
[   13.472182]  ? kmalloc_large_uaf+0x2f1/0x340
[   13.472207]  __asan_report_load1_noabort+0x18/0x20
[   13.472282]  kmalloc_large_uaf+0x2f1/0x340
[   13.472314]  ? __pfx_kmalloc_large_uaf+0x10/0x10
[   13.472347]  ? __schedule+0x10cc/0x2b60
[   13.472383]  ? __pfx_read_tsc+0x10/0x10
[   13.472420]  ? ktime_get_ts64+0x86/0x230
[   13.472463]  kunit_try_run_case+0x1a5/0x480
[   13.472923]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.472971]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.473008]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.473031]  ? __kthread_parkme+0x82/0x180
[   13.473053]  ? preempt_count_sub+0x50/0x80
[   13.473077]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.473099]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.473121]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.473142]  kthread+0x337/0x6f0
[   13.473160]  ? trace_preempt_on+0x20/0xc0
[   13.473183]  ? __pfx_kthread+0x10/0x10
[   13.473202]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.473243]  ? calculate_sigpending+0x7b/0xa0
[   13.473271]  ? __pfx_kthread+0x10/0x10
[   13.473292]  ret_from_fork+0x116/0x1d0
[   13.473311]  ? __pfx_kthread+0x10/0x10
[   13.473331]  ret_from_fork_asm+0x1a/0x30
[   13.473362]  </TASK>
[   13.473374] 
[   13.484388] The buggy address belongs to the physical page:
[   13.485195] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10298c
[   13.485915] flags: 0x200000000000000(node=0|zone=2)
[   13.486286] raw: 0200000000000000 ffffea00040a6408 ffff88815b039f80 0000000000000000
[   13.486960] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
[   13.487408] page dumped because: kasan: bad access detected
[   13.487900] 
[   13.488064] Memory state around the buggy address:
[   13.488257]  ffff88810298bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.488669]  ffff88810298bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.489050] >ffff88810298c000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.489726]                    ^
[   13.489894]  ffff88810298c080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.490237]  ffff88810298c100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   13.490679] ==================================================================