Hay
Date
July 22, 2025, 5:13 a.m.

Environment
qemu-arm64
qemu-x86_64

[   30.104316] ==================================================================
[   30.104396] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   30.104458] Free of addr fff00000c9ae4001 by task kunit_try_catch/181
[   30.104502] 
[   30.104532] CPU: 1 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250722 #1 PREEMPT 
[   30.104617] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   30.104646] Hardware name: linux,dummy-virt (DT)
[   30.104676] Call trace:
[   30.104696]  show_stack+0x20/0x38 (C)
[   30.104743]  dump_stack_lvl+0x8c/0xd0
[   30.104787]  print_report+0x118/0x5e8
[   30.104875]  kasan_report_invalid_free+0xc0/0xe8
[   30.105026]  __kasan_kfree_large+0x5c/0xa8
[   30.105150]  free_large_kmalloc+0x68/0x150
[   30.105337]  kfree+0x270/0x3c8
[   30.105446]  kmalloc_large_invalid_free+0x108/0x270
[   30.105515]  kunit_try_run_case+0x170/0x3f0
[   30.105561]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.105631]  kthread+0x328/0x630
[   30.105672]  ret_from_fork+0x10/0x20
[   30.105717] 
[   30.105736] The buggy address belongs to the physical page:
[   30.105769] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109ae4
[   30.105829] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   30.105873] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   30.106141] page_type: f8(unknown)
[   30.106192] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   30.106240] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   30.106293] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   30.106350] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   30.106396] head: 0bfffe0000000002 ffffc1ffc326b901 00000000ffffffff 00000000ffffffff
[   30.106443] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   30.106481] page dumped because: kasan: bad access detected
[   30.106517] 
[   30.106596] Memory state around the buggy address:
[   30.106638]  fff00000c9ae3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.106680]  fff00000c9ae3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.106722] >fff00000c9ae4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.106757]                    ^
[   30.106792]  fff00000c9ae4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.106843]  fff00000c9ae4100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.107193] ==================================================================

[   24.678536] ==================================================================
[   24.679162] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   24.679442] Free of addr ffff888104ab8001 by task kunit_try_catch/198
[   24.679766] 
[   24.679888] CPU: 1 UID: 0 PID: 198 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250722 #1 PREEMPT(voluntary) 
[   24.679935] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.679948] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.679968] Call Trace:
[   24.679980]  <TASK>
[   24.679994]  dump_stack_lvl+0x73/0xb0
[   24.680023]  print_report+0xd1/0x640
[   24.680046]  ? __virt_addr_valid+0x1db/0x2d0
[   24.680070]  ? kasan_addr_to_slab+0x11/0xa0
[   24.680090]  ? kfree+0x274/0x3f0
[   24.680114]  kasan_report_invalid_free+0x10a/0x130
[   24.680138]  ? kfree+0x274/0x3f0
[   24.680162]  ? kfree+0x274/0x3f0
[   24.680183]  __kasan_kfree_large+0x86/0xd0
[   24.680205]  free_large_kmalloc+0x52/0x110
[   24.680229]  kfree+0x274/0x3f0
[   24.680254]  kmalloc_large_invalid_free+0x120/0x2b0
[   24.680277]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   24.680300]  ? __schedule+0x10da/0x2b60
[   24.680327]  ? __pfx_read_tsc+0x10/0x10
[   24.680348]  ? ktime_get_ts64+0x86/0x230
[   24.680372]  kunit_try_run_case+0x1a5/0x480
[   24.680397]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.680419]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   24.680444]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.680483]  ? __kthread_parkme+0x82/0x180
[   24.680503]  ? preempt_count_sub+0x50/0x80
[   24.680526]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.680550]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.680574]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.680597]  kthread+0x337/0x6f0
[   24.680617]  ? trace_preempt_on+0x20/0xc0
[   24.680641]  ? __pfx_kthread+0x10/0x10
[   24.680661]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.680685]  ? calculate_sigpending+0x7b/0xa0
[   24.680708]  ? __pfx_kthread+0x10/0x10
[   24.680730]  ret_from_fork+0x116/0x1d0
[   24.680750]  ? __pfx_kthread+0x10/0x10
[   24.680771]  ret_from_fork_asm+0x1a/0x30
[   24.680802]  </TASK>
[   24.680814] 
[   24.688633] The buggy address belongs to the physical page:
[   24.688908] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104ab8
[   24.689284] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   24.689686] flags: 0x200000000000040(head|node=0|zone=2)
[   24.689907] page_type: f8(unknown)
[   24.690083] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   24.690507] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   24.690768] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   24.691155] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   24.691431] head: 0200000000000002 ffffea000412ae01 00000000ffffffff 00000000ffffffff
[   24.691665] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   24.691903] page dumped because: kasan: bad access detected
[   24.692073] 
[   24.692138] Memory state around the buggy address:
[   24.692292]  ffff888104ab7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.692507]  ffff888104ab7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.692737] >ffff888104ab8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.693067]                    ^
[   24.693277]  ffff888104ab8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.693631]  ffff888104ab8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.693947] ==================================================================