Hay
Date
May 29, 2025, 7:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   21.115981] ==================================================================
[   21.116209] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   21.116374] Free of addr fff00000c7894001 by task kunit_try_catch/150
[   21.117230] 
[   21.117510] CPU: 0 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   21.118197] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.118319] Hardware name: linux,dummy-virt (DT)
[   21.118489] Call trace:
[   21.118609]  show_stack+0x20/0x38 (C)
[   21.118944]  dump_stack_lvl+0x8c/0xd0
[   21.119074]  print_report+0x118/0x608
[   21.119174]  kasan_report_invalid_free+0xc0/0xe8
[   21.119266]  __kasan_kfree_large+0x5c/0xa8
[   21.119361]  free_large_kmalloc+0x64/0x190
[   21.119475]  kfree+0x270/0x3c8
[   21.119573]  kmalloc_large_invalid_free+0x108/0x270
[   21.119693]  kunit_try_run_case+0x170/0x3f0
[   21.119811]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   21.120373]  kthread+0x328/0x630
[   21.120629]  ret_from_fork+0x10/0x20
[   21.120832] 
[   21.121192] The buggy address belongs to the physical page:
[   21.121275] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107894
[   21.121715] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   21.121986] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   21.122384] page_type: f8(unknown)
[   21.122586] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   21.122716] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   21.122904] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   21.123075] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   21.123250] head: 0bfffe0000000002 ffffc1ffc31e2501 00000000ffffffff 00000000ffffffff
[   21.123422] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   21.123509] page dumped because: kasan: bad access detected
[   21.123571] 
[   21.123606] Memory state around the buggy address:
[   21.123696]  fff00000c7893f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.123794]  fff00000c7893f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.124191] >fff00000c7894000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   21.124355]                    ^
[   21.124600]  fff00000c7894080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   21.124718]  fff00000c7894100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   21.124864] ==================================================================


[   10.447341] ==================================================================
[   10.447849] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   10.448099] Free of addr ffff888102a70001 by task kunit_try_catch/167
[   10.448372] 
[   10.448483] CPU: 1 UID: 0 PID: 167 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   10.448526] Tainted: [B]=BAD_PAGE, [N]=TEST
[   10.448538] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   10.448560] Call Trace:
[   10.448573]  <TASK>
[   10.448589]  dump_stack_lvl+0x73/0xb0
[   10.448628]  print_report+0xd1/0x650
[   10.448650]  ? __virt_addr_valid+0x1db/0x2d0
[   10.448674]  ? kasan_addr_to_slab+0x11/0xa0
[   10.448694]  ? kfree+0x274/0x3f0
[   10.448712]  kasan_report_invalid_free+0x10a/0x130
[   10.448736]  ? kfree+0x274/0x3f0
[   10.448755]  ? kfree+0x274/0x3f0
[   10.448772]  __kasan_kfree_large+0x86/0xd0
[   10.448793]  free_large_kmalloc+0x4b/0x110
[   10.448817]  kfree+0x274/0x3f0
[   10.448838]  kmalloc_large_invalid_free+0x120/0x2b0
[   10.448861]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   10.448884]  ? __schedule+0x10cc/0x2b60
[   10.448907]  ? __pfx_read_tsc+0x10/0x10
[   10.448928]  ? ktime_get_ts64+0x86/0x230
[   10.448952]  kunit_try_run_case+0x1a5/0x480
[   10.448974]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.448992]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   10.449016]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   10.449039]  ? __kthread_parkme+0x82/0x180
[   10.449059]  ? preempt_count_sub+0x50/0x80
[   10.449082]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.449102]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.449125]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   10.449149]  kthread+0x337/0x6f0
[   10.449167]  ? trace_preempt_on+0x20/0xc0
[   10.449190]  ? __pfx_kthread+0x10/0x10
[   10.449210]  ? _raw_spin_unlock_irq+0x47/0x80
[   10.449231]  ? calculate_sigpending+0x7b/0xa0
[   10.449254]  ? __pfx_kthread+0x10/0x10
[   10.449275]  ret_from_fork+0x116/0x1d0
[   10.449292]  ? __pfx_kthread+0x10/0x10
[   10.449312]  ret_from_fork_asm+0x1a/0x30
[   10.449342]  </TASK>
[   10.449351] 
[   10.458682] The buggy address belongs to the physical page:
[   10.459023] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a70
[   10.459359] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   10.459876] flags: 0x200000000000040(head|node=0|zone=2)
[   10.460082] page_type: f8(unknown)
[   10.460221] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   10.460587] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   10.460935] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   10.461432] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   10.461848] head: 0200000000000002 ffffea00040a9c01 00000000ffffffff 00000000ffffffff
[   10.462145] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   10.462484] page dumped because: kasan: bad access detected
[   10.462901] 
[   10.463005] Memory state around the buggy address:
[   10.463197]  ffff888102a6ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.463519]  ffff888102a6ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.463748] >ffff888102a70000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.463979]                    ^
[   10.464316]  ffff888102a70080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.464749]  ffff888102a70100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.465558] ==================================================================