Hay
Date
July 8, 2025, 7:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.067030] ==================================================================
[   19.067220] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   19.067343] Free of addr fff00000c7814001 by task kunit_try_catch/150
[   19.067427] 
[   19.067472] CPU: 1 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   19.067761] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.067940] Hardware name: linux,dummy-virt (DT)
[   19.067975] Call trace:
[   19.067997]  show_stack+0x20/0x38 (C)
[   19.068046]  dump_stack_lvl+0x8c/0xd0
[   19.068260]  print_report+0x118/0x608
[   19.068481]  kasan_report_invalid_free+0xc0/0xe8
[   19.068629]  __kasan_kfree_large+0x5c/0xa8
[   19.068755]  free_large_kmalloc+0x64/0x190
[   19.068808]  kfree+0x270/0x3c8
[   19.068847]  kmalloc_large_invalid_free+0x108/0x270
[   19.068902]  kunit_try_run_case+0x170/0x3f0
[   19.068955]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.069010]  kthread+0x328/0x630
[   19.069054]  ret_from_fork+0x10/0x20
[   19.069101] 
[   19.069135] The buggy address belongs to the physical page:
[   19.069166] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107814
[   19.069217] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   19.069271] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   19.069328] page_type: f8(unknown)
[   19.069365] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   19.069422] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   19.069486] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   19.069533] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   19.069579] head: 0bfffe0000000002 ffffc1ffc31e0501 00000000ffffffff 00000000ffffffff
[   19.069626] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   19.069665] page dumped because: kasan: bad access detected
[   19.069694] 
[   19.069721] Memory state around the buggy address:
[   19.069972]  fff00000c7813f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.070392]  fff00000c7813f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.070857] >fff00000c7814000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.070995]                    ^
[   19.071104]  fff00000c7814080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.071267]  fff00000c7814100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.071384] ==================================================================

[   12.358386] ==================================================================
[   12.359534] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   12.360002] Free of addr ffff888102b68001 by task kunit_try_catch/167
[   12.360600] 
[   12.360794] CPU: 0 UID: 0 PID: 167 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.360840] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.360852] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.360873] Call Trace:
[   12.360885]  <TASK>
[   12.360903]  dump_stack_lvl+0x73/0xb0
[   12.360935]  print_report+0xd1/0x650
[   12.360958]  ? __virt_addr_valid+0x1db/0x2d0
[   12.360981]  ? kasan_addr_to_slab+0x11/0xa0
[   12.361000]  ? kfree+0x274/0x3f0
[   12.361021]  kasan_report_invalid_free+0x10a/0x130
[   12.361057]  ? kfree+0x274/0x3f0
[   12.361080]  ? kfree+0x274/0x3f0
[   12.361099]  __kasan_kfree_large+0x86/0xd0
[   12.361119]  free_large_kmalloc+0x4b/0x110
[   12.361141]  kfree+0x274/0x3f0
[   12.361166]  kmalloc_large_invalid_free+0x120/0x2b0
[   12.361189]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   12.361211]  ? __schedule+0x10cc/0x2b60
[   12.361233]  ? __pfx_read_tsc+0x10/0x10
[   12.361253]  ? ktime_get_ts64+0x86/0x230
[   12.361277]  kunit_try_run_case+0x1a5/0x480
[   12.361301]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.361322]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.361345]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.361367]  ? __kthread_parkme+0x82/0x180
[   12.361387]  ? preempt_count_sub+0x50/0x80
[   12.361409]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.361431]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.361453]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.361475]  kthread+0x337/0x6f0
[   12.361493]  ? trace_preempt_on+0x20/0xc0
[   12.361515]  ? __pfx_kthread+0x10/0x10
[   12.361534]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.361562]  ? calculate_sigpending+0x7b/0xa0
[   12.361586]  ? __pfx_kthread+0x10/0x10
[   12.361606]  ret_from_fork+0x116/0x1d0
[   12.361623]  ? __pfx_kthread+0x10/0x10
[   12.361643]  ret_from_fork_asm+0x1a/0x30
[   12.361674]  </TASK>
[   12.361686] 
[   12.374028] The buggy address belongs to the physical page:
[   12.374683] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102b68
[   12.375521] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   12.376263] flags: 0x200000000000040(head|node=0|zone=2)
[   12.376859] page_type: f8(unknown)
[   12.377134] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.377370] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.377729] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.378534] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.379383] head: 0200000000000002 ffffea00040ada01 00000000ffffffff 00000000ffffffff
[   12.380297] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   12.380874] page dumped because: kasan: bad access detected
[   12.381366] 
[   12.381477] Memory state around the buggy address:
[   12.381670]  ffff888102b67f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.382305]  ffff888102b67f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.383014] >ffff888102b68000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.383696]                    ^
[   12.383822]  ffff888102b68080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.384053]  ffff888102b68100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.384299] ==================================================================