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

Environment
qemu-arm64
qemu-x86_64

[   17.811626] ==================================================================
[   17.811714] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   17.811771] Free of addr fff00000c67ec001 by task kunit_try_catch/150
[   17.811825] 
[   17.811943] CPU: 1 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   17.812183] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.812208] Hardware name: linux,dummy-virt (DT)
[   17.812237] Call trace:
[   17.812823]  show_stack+0x20/0x38 (C)
[   17.812952]  dump_stack_lvl+0x8c/0xd0
[   17.813023]  print_report+0x118/0x608
[   17.813095]  kasan_report_invalid_free+0xc0/0xe8
[   17.814198]  __kasan_kfree_large+0x5c/0xa8
[   17.814285]  free_large_kmalloc+0x64/0x190
[   17.814332]  kfree+0x270/0x3c8
[   17.814373]  kmalloc_large_invalid_free+0x108/0x270
[   17.814421]  kunit_try_run_case+0x170/0x3f0
[   17.814470]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.814522]  kthread+0x328/0x630
[   17.814569]  ret_from_fork+0x10/0x20
[   17.814617] 
[   17.814638] The buggy address belongs to the physical page:
[   17.814668] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1067ec
[   17.814718] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   17.814767] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   17.815212] page_type: f8(unknown)
[   17.815252] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   17.815299] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   17.815941] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   17.815997] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   17.816044] head: 0bfffe0000000002 ffffc1ffc319fb01 00000000ffffffff 00000000ffffffff
[   17.816090] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   17.816130] page dumped because: kasan: bad access detected
[   17.816176] 
[   17.816194] Memory state around the buggy address:
[   17.816224]  fff00000c67ebf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.816264]  fff00000c67ebf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.816364] >fff00000c67ec000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.816404]                    ^
[   17.816432]  fff00000c67ec080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.816473]  fff00000c67ec100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.816522] ==================================================================


[   13.496113] ==================================================================
[   13.496695] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   13.497343] Free of addr ffff88810298c001 by task kunit_try_catch/168
[   13.498124] 
[   13.498283] CPU: 0 UID: 0 PID: 168 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   13.498351] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.498365] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.498389] Call Trace:
[   13.498405]  <TASK>
[   13.498424]  dump_stack_lvl+0x73/0xb0
[   13.498465]  print_report+0xd1/0x650
[   13.498732]  ? __virt_addr_valid+0x1db/0x2d0
[   13.498785]  ? kasan_addr_to_slab+0x11/0xa0
[   13.498826]  ? kfree+0x274/0x3f0
[   13.498870]  kasan_report_invalid_free+0x10a/0x130
[   13.498913]  ? kfree+0x274/0x3f0
[   13.498946]  ? kfree+0x274/0x3f0
[   13.498976]  __kasan_kfree_large+0x86/0xd0
[   13.499017]  free_large_kmalloc+0x4b/0x110
[   13.499065]  kfree+0x274/0x3f0
[   13.499105]  kmalloc_large_invalid_free+0x120/0x2b0
[   13.499144]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   13.499189]  ? __schedule+0x10cc/0x2b60
[   13.499242]  ? __pfx_read_tsc+0x10/0x10
[   13.499287]  ? ktime_get_ts64+0x86/0x230
[   13.499338]  kunit_try_run_case+0x1a5/0x480
[   13.499376]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.499398]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.499421]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.499443]  ? __kthread_parkme+0x82/0x180
[   13.499487]  ? preempt_count_sub+0x50/0x80
[   13.499524]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.499558]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.499592]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.499640]  kthread+0x337/0x6f0
[   13.499663]  ? trace_preempt_on+0x20/0xc0
[   13.499688]  ? __pfx_kthread+0x10/0x10
[   13.499708]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.499728]  ? calculate_sigpending+0x7b/0xa0
[   13.499752]  ? __pfx_kthread+0x10/0x10
[   13.499773]  ret_from_fork+0x116/0x1d0
[   13.499792]  ? __pfx_kthread+0x10/0x10
[   13.499812]  ret_from_fork_asm+0x1a/0x30
[   13.499844]  </TASK>
[   13.499856] 
[   13.512153] The buggy address belongs to the physical page:
[   13.512481] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10298c
[   13.512878] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   13.513190] flags: 0x200000000000040(head|node=0|zone=2)
[   13.513454] page_type: f8(unknown)
[   13.513712] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   13.514027] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   13.515198] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   13.515655] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   13.516133] head: 0200000000000002 ffffea00040a6301 00000000ffffffff 00000000ffffffff
[   13.516723] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   13.516949] page dumped because: kasan: bad access detected
[   13.517111] 
[   13.517191] Memory state around the buggy address:
[   13.517352]  ffff88810298bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.518240]  ffff88810298bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.518780] >ffff88810298c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.519160]                    ^
[   13.519318]  ffff88810298c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.519661]  ffff88810298c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.520302] ==================================================================