Hay
Date
June 18, 2025, 6:43 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.906824] ==================================================================
[   19.907117] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   19.907337] Free of addr fff00000c76cc001 by task kunit_try_catch/160
[   19.907463] 
[   19.907557] CPU: 0 UID: 0 PID: 160 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250618 #1 PREEMPT 
[   19.907772] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.907824] Hardware name: linux,dummy-virt (DT)
[   19.907881] Call trace:
[   19.907928]  show_stack+0x20/0x38 (C)
[   19.908037]  dump_stack_lvl+0x8c/0xd0
[   19.908169]  print_report+0x118/0x608
[   19.908264]  kasan_report_invalid_free+0xc0/0xe8
[   19.908356]  __kasan_kfree_large+0x5c/0xa8
[   19.908447]  free_large_kmalloc+0x68/0x150
[   19.908551]  kfree+0x270/0x3c8
[   19.908649]  kmalloc_large_invalid_free+0x108/0x270
[   19.909052]  kunit_try_run_case+0x170/0x3f0
[   19.909176]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.909474]  kthread+0x328/0x630
[   19.909585]  ret_from_fork+0x10/0x20
[   19.909712] 
[   19.909821] The buggy address belongs to the physical page:
[   19.909891] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1076cc
[   19.910478] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   19.910594] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   19.910716] page_type: f8(unknown)
[   19.910807] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   19.910909] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   19.910995] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   19.911088] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   19.911181] head: 0bfffe0000000002 ffffc1ffc31db301 00000000ffffffff 00000000ffffffff
[   19.911277] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   19.911367] page dumped because: kasan: bad access detected
[   19.911431] 
[   19.911466] Memory state around the buggy address:
[   19.911542]  fff00000c76cbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.911632]  fff00000c76cbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.911726] >fff00000c76cc000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.911808]                    ^
[   19.911874]  fff00000c76cc080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.911984]  fff00000c76cc100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.912107] ==================================================================

[   10.691384] ==================================================================
[   10.692116] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   10.693055] Free of addr ffff888103ab0001 by task kunit_try_catch/176
[   10.693749] 
[   10.694079] CPU: 1 UID: 0 PID: 176 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250618 #1 PREEMPT(voluntary) 
[   10.694131] Tainted: [B]=BAD_PAGE, [N]=TEST
[   10.694143] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   10.694163] Call Trace:
[   10.694295]  <TASK>
[   10.694312]  dump_stack_lvl+0x73/0xb0
[   10.694343]  print_report+0xd1/0x650
[   10.694364]  ? __virt_addr_valid+0x1db/0x2d0
[   10.694386]  ? kasan_addr_to_slab+0x11/0xa0
[   10.694404]  ? kfree+0x274/0x3f0
[   10.694433]  kasan_report_invalid_free+0x10a/0x130
[   10.694455]  ? kfree+0x274/0x3f0
[   10.694476]  ? kfree+0x274/0x3f0
[   10.694495]  __kasan_kfree_large+0x86/0xd0
[   10.694515]  free_large_kmalloc+0x52/0x110
[   10.694536]  kfree+0x274/0x3f0
[   10.694559]  kmalloc_large_invalid_free+0x120/0x2b0
[   10.694580]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   10.694602]  ? __schedule+0x10cc/0x2b60
[   10.694622]  ? __pfx_read_tsc+0x10/0x10
[   10.694642]  ? ktime_get_ts64+0x86/0x230
[   10.694714]  kunit_try_run_case+0x1a5/0x480
[   10.694739]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.694759]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   10.694781]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   10.694801]  ? __kthread_parkme+0x82/0x180
[   10.694821]  ? preempt_count_sub+0x50/0x80
[   10.694843]  ? __pfx_kunit_try_run_case+0x10/0x10
[   10.694864]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   10.694885]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   10.694907]  kthread+0x337/0x6f0
[   10.694925]  ? trace_preempt_on+0x20/0xc0
[   10.694947]  ? __pfx_kthread+0x10/0x10
[   10.694966]  ? _raw_spin_unlock_irq+0x47/0x80
[   10.694984]  ? calculate_sigpending+0x7b/0xa0
[   10.695007]  ? __pfx_kthread+0x10/0x10
[   10.695027]  ret_from_fork+0x116/0x1d0
[   10.695044]  ? __pfx_kthread+0x10/0x10
[   10.695063]  ret_from_fork_asm+0x1a/0x30
[   10.695092]  </TASK>
[   10.695102] 
[   10.707119] The buggy address belongs to the physical page:
[   10.707653] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103ab0
[   10.708098] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   10.708628] flags: 0x200000000000040(head|node=0|zone=2)
[   10.709152] page_type: f8(unknown)
[   10.709536] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   10.709917] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   10.710142] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   10.710851] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   10.711659] head: 0200000000000002 ffffea00040eac01 00000000ffffffff 00000000ffffffff
[   10.712395] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   10.712922] page dumped because: kasan: bad access detected
[   10.713094] 
[   10.713157] Memory state around the buggy address:
[   10.713365]  ffff888103aaff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.713722]  ffff888103aaff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   10.713986] >ffff888103ab0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.714383]                    ^
[   10.714498]  ffff888103ab0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.714738]  ffff888103ab0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   10.715068] ==================================================================