Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   20.473916] ==================================================================
[   20.475046] BUG: KASAN: invalid-free in kfree+0x260/0x3b8
[   20.476056] Free of addr fff00000c695c001 by task kunit_try_catch/138
[   20.476560] 
[   20.476915] CPU: 0 UID: 0 PID: 138 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   20.477145] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.477218] Hardware name: linux,dummy-virt (DT)
[   20.477303] Call trace:
[   20.477367]  dump_backtrace+0x9c/0x128
[   20.477483]  show_stack+0x20/0x38
[   20.477585]  dump_stack_lvl+0x8c/0xd0
[   20.477692]  print_report+0x118/0x5f0
[   20.477799]  kasan_report_invalid_free+0xc0/0xe8
[   20.477917]  __kasan_kfree_large+0x5c/0xa8
[   20.478044]  free_large_kmalloc+0x58/0x140
[   20.478164]  kfree+0x260/0x3b8
[   20.478269]  kmalloc_large_invalid_free+0x114/0x290
[   20.478386]  kunit_try_run_case+0x170/0x3f0
[   20.478440]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.478494]  kthread+0x24c/0x2d0
[   20.478541]  ret_from_fork+0x10/0x20
[   20.478589] 
[   20.488463] The buggy address belongs to the physical page:
[   20.489614] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10695c
[   20.490515] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   20.491502] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   20.492711] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   20.493851] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   20.494785] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   20.495823] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   20.496750] head: 0bfffe0000000002 ffffc1ffc31a5701 ffffffffffffffff 0000000000000000
[   20.497470] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   20.498177] page dumped because: kasan: bad access detected
[   20.498794] 
[   20.499120] Memory state around the buggy address:
[   20.499793]  fff00000c695bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.500616]  fff00000c695bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.502020] >fff00000c695c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.502845]                    ^
[   20.503269]  fff00000c695c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.504364]  fff00000c695c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.505324] ==================================================================

[   16.598131] ==================================================================
[   16.599015] BUG: KASAN: invalid-free in kfree+0x271/0x3d0
[   16.599786] Free of addr ffff8881022c4001 by task kunit_try_catch/155
[   16.600758] 
[   16.601108] CPU: 1 UID: 0 PID: 155 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   16.601287] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.601368] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   16.601425] Call Trace:
[   16.601605]  <TASK>
[   16.601710]  dump_stack_lvl+0x73/0xb0
[   16.601862]  print_report+0xd1/0x640
[   16.601948]  ? __virt_addr_valid+0x1db/0x2d0
[   16.602027]  ? kasan_addr_to_slab+0x11/0xa0
[   16.602152]  ? kfree+0x271/0x3d0
[   16.602267]  kasan_report_invalid_free+0xfc/0x120
[   16.602348]  ? kfree+0x271/0x3d0
[   16.602387]  ? kfree+0x271/0x3d0
[   16.602413]  __kasan_kfree_large+0x86/0xd0
[   16.602473]  free_large_kmalloc+0x3b/0xd0
[   16.602586]  kfree+0x271/0x3d0
[   16.602661]  kmalloc_large_invalid_free+0x121/0x2b0
[   16.602700]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   16.602736]  ? __schedule+0xc49/0x27a0
[   16.602766]  ? __pfx_read_tsc+0x10/0x10
[   16.602792]  ? ktime_get_ts64+0x84/0x230
[   16.602877]  kunit_try_run_case+0x1a6/0x480
[   16.602913]  ? __pfx_kunit_try_run_case+0x10/0x10
[   16.602943]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   16.602972]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   16.603008]  ? __kthread_parkme+0x82/0x160
[   16.603036]  ? preempt_count_sub+0x50/0x80
[   16.603066]  ? __pfx_kunit_try_run_case+0x10/0x10
[   16.603094]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   16.603130]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   16.603167]  kthread+0x257/0x310
[   16.603192]  ? __pfx_kthread+0x10/0x10
[   16.603246]  ret_from_fork+0x41/0x80
[   16.603290]  ? __pfx_kthread+0x10/0x10
[   16.603317]  ret_from_fork_asm+0x1a/0x30
[   16.603361]  </TASK>
[   16.603376] 
[   16.622508] The buggy address belongs to the physical page:
[   16.623697] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1022c4
[   16.624513] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   16.625257] flags: 0x200000000000040(head|node=0|zone=2)
[   16.625479] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   16.625725] raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   16.626864] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   16.627493] head: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
[   16.628741] head: 0200000000000002 ffffea000408b101 ffffffffffffffff 0000000000000000
[   16.629858] head: 0000000000000004 0000000000000000 00000000ffffffff 0000000000000000
[   16.630418] page dumped because: kasan: bad access detected
[   16.631237] 
[   16.631478] Memory state around the buggy address:
[   16.632238]  ffff8881022c3f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.633267]  ffff8881022c3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.634110] >ffff8881022c4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.634815]                    ^
[   16.635348]  ffff8881022c4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.636122]  ffff8881022c4100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.636737] ==================================================================