Hay
Date
July 6, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.857241] ==================================================================
[   17.857322] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   17.857378] Free of addr fff00000c65e4001 by task kunit_try_catch/150
[   17.857688] 
[   17.857746] CPU: 1 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   17.857836] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.857862] Hardware name: linux,dummy-virt (DT)
[   17.857911] Call trace:
[   17.857957]  show_stack+0x20/0x38 (C)
[   17.858032]  dump_stack_lvl+0x8c/0xd0
[   17.858204]  print_report+0x118/0x608
[   17.858313]  kasan_report_invalid_free+0xc0/0xe8
[   17.858458]  __kasan_kfree_large+0x5c/0xa8
[   17.858572]  free_large_kmalloc+0x64/0x190
[   17.858619]  kfree+0x270/0x3c8
[   17.858797]  kmalloc_large_invalid_free+0x108/0x270
[   17.859035]  kunit_try_run_case+0x170/0x3f0
[   17.859154]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.859318]  kthread+0x328/0x630
[   17.859398]  ret_from_fork+0x10/0x20
[   17.859444] 
[   17.859607] The buggy address belongs to the physical page:
[   17.859686] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1065e4
[   17.859826] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   17.859942] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   17.860028] page_type: f8(unknown)
[   17.860140] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   17.860188] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   17.860263] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   17.860447] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   17.860621] head: 0bfffe0000000002 ffffc1ffc3197901 00000000ffffffff 00000000ffffffff
[   17.860774] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   17.860882] page dumped because: kasan: bad access detected
[   17.860932] 
[   17.860951] Memory state around the buggy address:
[   17.861089]  fff00000c65e3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.861155]  fff00000c65e3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.861421] >fff00000c65e4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.861581]                    ^
[   17.861659]  fff00000c65e4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.861739]  fff00000c65e4100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.861837] ==================================================================

[   11.114229] ==================================================================
[   11.114799] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   11.115083] Free of addr ffff888102954001 by task kunit_try_catch/167
[   11.115473] 
[   11.115614] CPU: 1 UID: 0 PID: 167 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   11.115671] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.115684] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.115705] Call Trace:
[   11.115729]  <TASK>
[   11.115745]  dump_stack_lvl+0x73/0xb0
[   11.115773]  print_report+0xd1/0x650
[   11.115795]  ? __virt_addr_valid+0x1db/0x2d0
[   11.115819]  ? kasan_addr_to_slab+0x11/0xa0
[   11.115839]  ? kfree+0x274/0x3f0
[   11.115860]  kasan_report_invalid_free+0x10a/0x130
[   11.115892]  ? kfree+0x274/0x3f0
[   11.115915]  ? kfree+0x274/0x3f0
[   11.115950]  __kasan_kfree_large+0x86/0xd0
[   11.115971]  free_large_kmalloc+0x4b/0x110
[   11.116002]  kfree+0x274/0x3f0
[   11.116027]  kmalloc_large_invalid_free+0x120/0x2b0
[   11.116049]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   11.116082]  ? __schedule+0x10cc/0x2b60
[   11.116104]  ? __pfx_read_tsc+0x10/0x10
[   11.116124]  ? ktime_get_ts64+0x86/0x230
[   11.116148]  kunit_try_run_case+0x1a5/0x480
[   11.116171]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.116193]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.116215]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.116237]  ? __kthread_parkme+0x82/0x180
[   11.116266]  ? preempt_count_sub+0x50/0x80
[   11.116289]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.116312]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.116344]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.116366]  kthread+0x337/0x6f0
[   11.116385]  ? trace_preempt_on+0x20/0xc0
[   11.116408]  ? __pfx_kthread+0x10/0x10
[   11.116428]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.116448]  ? calculate_sigpending+0x7b/0xa0
[   11.116471]  ? __pfx_kthread+0x10/0x10
[   11.116492]  ret_from_fork+0x116/0x1d0
[   11.116509]  ? __pfx_kthread+0x10/0x10
[   11.116529]  ret_from_fork_asm+0x1a/0x30
[   11.116577]  </TASK>
[   11.116589] 
[   11.124626] The buggy address belongs to the physical page:
[   11.124876] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102954
[   11.125455] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   11.125877] flags: 0x200000000000040(head|node=0|zone=2)
[   11.126176] page_type: f8(unknown)
[   11.126331] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   11.126707] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   11.126985] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   11.127252] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   11.127699] head: 0200000000000002 ffffea00040a5501 00000000ffffffff 00000000ffffffff
[   11.128238] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   11.128498] page dumped because: kasan: bad access detected
[   11.128754] 
[   11.128876] Memory state around the buggy address:
[   11.129182]  ffff888102953f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.129667]  ffff888102953f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.129948] >ffff888102954000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.130393]                    ^
[   11.130688]  ffff888102954080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.130963]  ffff888102954100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.131279] ==================================================================