Hay
Date
July 24, 2025, 4:41 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.259409] ==================================================================
[   32.259873] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   32.260289] Free of addr fff00000c99a0001 by task kunit_try_catch/181
[   32.260386] 
[   32.260431] CPU: 0 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250724 #1 PREEMPT 
[   32.260525] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.260553] Hardware name: linux,dummy-virt (DT)
[   32.260822] Call trace:
[   32.260966]  show_stack+0x20/0x38 (C)
[   32.261031]  dump_stack_lvl+0x8c/0xd0
[   32.261079]  print_report+0x118/0x5e8
[   32.261293]  kasan_report_invalid_free+0xc0/0xe8
[   32.261563]  __kasan_kfree_large+0x5c/0xa8
[   32.261818]  free_large_kmalloc+0x68/0x150
[   32.262081]  kfree+0x270/0x3c8
[   32.262150]  kmalloc_large_invalid_free+0x108/0x270
[   32.262200]  kunit_try_run_case+0x170/0x3f0
[   32.262588]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.262732]  kthread+0x328/0x630
[   32.262795]  ret_from_fork+0x10/0x20
[   32.262922] 
[   32.263013] The buggy address belongs to the physical page:
[   32.263453] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1099a0
[   32.263542] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   32.263812] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   32.264040] page_type: f8(unknown)
[   32.264104] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   32.264286] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   32.264362] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   32.264489] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   32.264584] head: 0bfffe0000000002 ffffc1ffc3266801 00000000ffffffff 00000000ffffffff
[   32.264853] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   32.265216] page dumped because: kasan: bad access detected
[   32.265282] 
[   32.265397] Memory state around the buggy address:
[   32.265434]  fff00000c999ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   32.265788]  fff00000c999ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   32.266050] >fff00000c99a0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   32.266226]                    ^
[   32.266333]  fff00000c99a0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   32.266388]  fff00000c99a0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   32.266772] ==================================================================

[   26.371739] ==================================================================
[   26.372497] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   26.372790] Free of addr ffff888104970001 by task kunit_try_catch/198
[   26.373075] 
[   26.373190] CPU: 0 UID: 0 PID: 198 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250724 #1 PREEMPT(voluntary) 
[   26.373267] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   26.373280] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   26.373303] Call Trace:
[   26.373316]  <TASK>
[   26.373335]  dump_stack_lvl+0x73/0xb0
[   26.373365]  print_report+0xd1/0x640
[   26.373388]  ? __virt_addr_valid+0x1db/0x2d0
[   26.373413]  ? kasan_addr_to_slab+0x11/0xa0
[   26.373445]  ? kfree+0x274/0x3f0
[   26.373469]  kasan_report_invalid_free+0x10a/0x130
[   26.373506]  ? kfree+0x274/0x3f0
[   26.373530]  ? kfree+0x274/0x3f0
[   26.373549]  __kasan_kfree_large+0x86/0xd0
[   26.373570]  free_large_kmalloc+0x52/0x110
[   26.373605]  kfree+0x274/0x3f0
[   26.373630]  kmalloc_large_invalid_free+0x120/0x2b0
[   26.373661]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   26.373683]  ? __schedule+0x10da/0x2b60
[   26.373707]  ? __pfx_read_tsc+0x10/0x10
[   26.373742]  ? ktime_get_ts64+0x86/0x230
[   26.373766]  kunit_try_run_case+0x1a5/0x480
[   26.373792]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.373813]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   26.373876]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   26.373902]  ? __kthread_parkme+0x82/0x180
[   26.373923]  ? preempt_count_sub+0x50/0x80
[   26.373952]  ? __pfx_kunit_try_run_case+0x10/0x10
[   26.374028]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   26.374051]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   26.374074]  kthread+0x337/0x6f0
[   26.374094]  ? trace_preempt_on+0x20/0xc0
[   26.374118]  ? __pfx_kthread+0x10/0x10
[   26.374138]  ? _raw_spin_unlock_irq+0x47/0x80
[   26.374160]  ? calculate_sigpending+0x7b/0xa0
[   26.374183]  ? __pfx_kthread+0x10/0x10
[   26.374204]  ret_from_fork+0x116/0x1d0
[   26.374233]  ? __pfx_kthread+0x10/0x10
[   26.374253]  ret_from_fork_asm+0x1a/0x30
[   26.374285]  </TASK>
[   26.374306] 
[   26.381974] The buggy address belongs to the physical page:
[   26.382313] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104970
[   26.382792] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   26.383320] flags: 0x200000000000040(head|node=0|zone=2)
[   26.383622] page_type: f8(unknown)
[   26.383857] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   26.384493] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   26.384777] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   26.385354] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   26.385713] head: 0200000000000002 ffffea0004125c01 00000000ffffffff 00000000ffffffff
[   26.386267] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   26.386607] page dumped because: kasan: bad access detected
[   26.386844] 
[   26.387002] Memory state around the buggy address:
[   26.387257]  ffff88810496ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.387586]  ffff88810496ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.388011] >ffff888104970000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   26.388325]                    ^
[   26.388459]  ffff888104970080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   26.388891]  ffff888104970100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   26.389436] ==================================================================