Hay
Date
June 17, 2025, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   16.655476] ==================================================================
[   16.655593] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   16.655793] Free of addr fff00000c177c001 by task kunit_try_catch/159
[   16.655952] 
[   16.655998] CPU: 1 UID: 0 PID: 159 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT 
[   16.656090] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.656116] Hardware name: linux,dummy-virt (DT)
[   16.656325] Call trace:
[   16.656374]  show_stack+0x20/0x38 (C)
[   16.656449]  dump_stack_lvl+0x8c/0xd0
[   16.656500]  print_report+0x118/0x608
[   16.656569]  kasan_report_invalid_free+0xc0/0xe8
[   16.656624]  __kasan_kfree_large+0x5c/0xa8
[   16.656688]  free_large_kmalloc+0x64/0x190
[   16.656755]  kfree+0x270/0x3c8
[   16.656808]  kmalloc_large_invalid_free+0x108/0x270
[   16.656857]  kunit_try_run_case+0x170/0x3f0
[   16.656915]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.656984]  kthread+0x328/0x630
[   16.657025]  ret_from_fork+0x10/0x20
[   16.657074] 
[   16.657121] The buggy address belongs to the physical page:
[   16.657359] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10177c
[   16.657427] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   16.657473] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   16.657527] page_type: f8(unknown)
[   16.657697] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   16.657822] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   16.657982] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   16.658086] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   16.658176] head: 0bfffe0000000002 ffffc1ffc305df01 00000000ffffffff 00000000ffffffff
[   16.658225] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   16.658286] page dumped because: kasan: bad access detected
[   16.658318] 
[   16.658336] Memory state around the buggy address:
[   16.658368]  fff00000c177bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.658539]  fff00000c177bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.658658] >fff00000c177c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.658770]                    ^
[   16.658835]  fff00000c177c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.658923]  fff00000c177c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.659001] ==================================================================

[   17.040930] ==================================================================
[   17.042238] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   17.043037] Free of addr ffff888102a88001 by task kunit_try_catch/177
[   17.043709] 
[   17.043979] CPU: 1 UID: 0 PID: 177 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT(voluntary) 
[   17.044102] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.044499] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   17.044557] Call Trace:
[   17.044594]  <TASK>
[   17.044631]  dump_stack_lvl+0x73/0xb0
[   17.044675]  print_report+0xd1/0x650
[   17.044709]  ? __virt_addr_valid+0x1db/0x2d0
[   17.044744]  ? kasan_addr_to_slab+0x11/0xa0
[   17.044773]  ? kfree+0x274/0x3f0
[   17.044803]  kasan_report_invalid_free+0x10a/0x130
[   17.044867]  ? kfree+0x274/0x3f0
[   17.044904]  ? kfree+0x274/0x3f0
[   17.044934]  __kasan_kfree_large+0x86/0xd0
[   17.044965]  free_large_kmalloc+0x4b/0x110
[   17.044997]  kfree+0x274/0x3f0
[   17.045032]  kmalloc_large_invalid_free+0x120/0x2b0
[   17.045064]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   17.045096]  ? __schedule+0x10cc/0x2b60
[   17.045125]  ? __pfx_read_tsc+0x10/0x10
[   17.045155]  ? ktime_get_ts64+0x86/0x230
[   17.045189]  kunit_try_run_case+0x1a5/0x480
[   17.045247]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.045320]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   17.045391]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   17.045432]  ? __kthread_parkme+0x82/0x180
[   17.045463]  ? preempt_count_sub+0x50/0x80
[   17.045495]  ? __pfx_kunit_try_run_case+0x10/0x10
[   17.045528]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   17.045561]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   17.045593]  kthread+0x337/0x6f0
[   17.045620]  ? trace_preempt_on+0x20/0xc0
[   17.045652]  ? __pfx_kthread+0x10/0x10
[   17.045680]  ? _raw_spin_unlock_irq+0x47/0x80
[   17.045712]  ? calculate_sigpending+0x7b/0xa0
[   17.045747]  ? __pfx_kthread+0x10/0x10
[   17.045776]  ret_from_fork+0x116/0x1d0
[   17.045800]  ? __pfx_kthread+0x10/0x10
[   17.045828]  ret_from_fork_asm+0x1a/0x30
[   17.045898]  </TASK>
[   17.045914] 
[   17.063079] The buggy address belongs to the physical page:
[   17.063738] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a88
[   17.064500] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   17.064951] flags: 0x200000000000040(head|node=0|zone=2)
[   17.065614] page_type: f8(unknown)
[   17.065990] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   17.066959] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   17.067721] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   17.068392] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   17.069049] head: 0200000000000002 ffffea00040aa201 00000000ffffffff 00000000ffffffff
[   17.069870] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   17.070754] page dumped because: kasan: bad access detected
[   17.071188] 
[   17.071395] Memory state around the buggy address:
[   17.071712]  ffff888102a87f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.072476]  ffff888102a87f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.073063] >ffff888102a88000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.073782]                    ^
[   17.074111]  ffff888102a88080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.075004]  ffff888102a88100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.075676] ==================================================================