Hay
Date
July 9, 2025, 12:11 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.378102] ==================================================================
[   19.378317] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   19.378445] Free of addr fff00000c76b4001 by task kunit_try_catch/151
[   19.378490] 
[   19.378520] CPU: 1 UID: 0 PID: 151 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.378601] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.378627] Hardware name: linux,dummy-virt (DT)
[   19.378658] Call trace:
[   19.378680]  show_stack+0x20/0x38 (C)
[   19.378727]  dump_stack_lvl+0x8c/0xd0
[   19.378783]  print_report+0x118/0x608
[   19.378830]  kasan_report_invalid_free+0xc0/0xe8
[   19.378917]  __kasan_kfree_large+0x5c/0xa8
[   19.378971]  free_large_kmalloc+0x64/0x190
[   19.379044]  kfree+0x270/0x3c8
[   19.379093]  kmalloc_large_invalid_free+0x108/0x270
[   19.379177]  kunit_try_run_case+0x170/0x3f0
[   19.379331]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.379393]  kthread+0x328/0x630
[   19.379453]  ret_from_fork+0x10/0x20
[   19.379624] 
[   19.379652] The buggy address belongs to the physical page:
[   19.379733] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1076b4
[   19.379787] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   19.379838] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   19.380078] page_type: f8(unknown)
[   19.380119] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   19.380208] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   19.380259] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   19.380332] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   19.380386] head: 0bfffe0000000002 ffffc1ffc31dad01 00000000ffffffff 00000000ffffffff
[   19.380443] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   19.380507] page dumped because: kasan: bad access detected
[   19.380538] 
[   19.380556] Memory state around the buggy address:
[   19.380589]  fff00000c76b3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.380630]  fff00000c76b3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.380672] >fff00000c76b4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.380710]                    ^
[   19.380737]  fff00000c76b4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.380777]  fff00000c76b4100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.380959] ==================================================================

[   12.164553] ==================================================================
[   12.165086] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   12.165390] Free of addr ffff88810a5d8001 by task kunit_try_catch/167
[   12.165822] 
[   12.165941] CPU: 1 UID: 0 PID: 167 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.165987] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.165998] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.166018] Call Trace:
[   12.166033]  <TASK>
[   12.166050]  dump_stack_lvl+0x73/0xb0
[   12.166083]  print_report+0xd1/0x650
[   12.166106]  ? __virt_addr_valid+0x1db/0x2d0
[   12.166131]  ? kasan_addr_to_slab+0x11/0xa0
[   12.166151]  ? kfree+0x274/0x3f0
[   12.166172]  kasan_report_invalid_free+0x10a/0x130
[   12.166197]  ? kfree+0x274/0x3f0
[   12.166219]  ? kfree+0x274/0x3f0
[   12.166238]  __kasan_kfree_large+0x86/0xd0
[   12.166332]  free_large_kmalloc+0x4b/0x110
[   12.166357]  kfree+0x274/0x3f0
[   12.166381]  kmalloc_large_invalid_free+0x120/0x2b0
[   12.166404]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   12.166429]  ? __schedule+0x10cc/0x2b60
[   12.166451]  ? __pfx_read_tsc+0x10/0x10
[   12.166472]  ? ktime_get_ts64+0x86/0x230
[   12.166497]  kunit_try_run_case+0x1a5/0x480
[   12.166521]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.166544]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.166569]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.166592]  ? __kthread_parkme+0x82/0x180
[   12.166613]  ? preempt_count_sub+0x50/0x80
[   12.166637]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.166661]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.166685]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.166717]  kthread+0x337/0x6f0
[   12.166735]  ? trace_preempt_on+0x20/0xc0
[   12.166759]  ? __pfx_kthread+0x10/0x10
[   12.166779]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.166801]  ? calculate_sigpending+0x7b/0xa0
[   12.166826]  ? __pfx_kthread+0x10/0x10
[   12.166846]  ret_from_fork+0x116/0x1d0
[   12.166865]  ? __pfx_kthread+0x10/0x10
[   12.166885]  ret_from_fork_asm+0x1a/0x30
[   12.166915]  </TASK>
[   12.166937] 
[   12.174776] The buggy address belongs to the physical page:
[   12.174976] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10a5d8
[   12.175796] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   12.176102] flags: 0x200000000000040(head|node=0|zone=2)
[   12.176406] page_type: f8(unknown)
[   12.176577] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.176835] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.177444] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.177706] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.177963] head: 0200000000000002 ffffea0004297601 00000000ffffffff 00000000ffffffff
[   12.178306] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   12.178636] page dumped because: kasan: bad access detected
[   12.178891] 
[   12.179040] Memory state around the buggy address:
[   12.179212]  ffff88810a5d7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.179529]  ffff88810a5d7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.179795] >ffff88810a5d8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.180017]                    ^
[   12.180134]  ffff88810a5d8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.180406]  ffff88810a5d8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.181200] ==================================================================