Hay
Date
July 9, 2025, 11:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.452469] ==================================================================
[   16.452557] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   16.452622] Free of addr fff00000c7718001 by task kunit_try_catch/150
[   16.452667] 
[   16.452702] CPU: 1 UID: 0 PID: 150 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.452784] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.452810] Hardware name: linux,dummy-virt (DT)
[   16.452841] Call trace:
[   16.452863]  show_stack+0x20/0x38 (C)
[   16.452912]  dump_stack_lvl+0x8c/0xd0
[   16.452960]  print_report+0x118/0x608
[   16.453005]  kasan_report_invalid_free+0xc0/0xe8
[   16.453052]  __kasan_kfree_large+0x5c/0xa8
[   16.453158]  free_large_kmalloc+0x64/0x190
[   16.453210]  kfree+0x270/0x3c8
[   16.453278]  kmalloc_large_invalid_free+0x108/0x270
[   16.453335]  kunit_try_run_case+0x170/0x3f0
[   16.453383]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.453433]  kthread+0x328/0x630
[   16.453474]  ret_from_fork+0x10/0x20
[   16.453529] 
[   16.453550] The buggy address belongs to the physical page:
[   16.453581] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107718
[   16.453632] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   16.453678] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   16.453731] page_type: f8(unknown)
[   16.453770] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   16.453817] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   16.453864] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   16.453911] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   16.453958] head: 0bfffe0000000002 ffffc1ffc31dc601 00000000ffffffff 00000000ffffffff
[   16.454004] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   16.454042] page dumped because: kasan: bad access detected
[   16.454071] 
[   16.454088] Memory state around the buggy address:
[   16.455074]  fff00000c7717f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.455536]  fff00000c7717f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.455595] >fff00000c7718000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.455648]                    ^
[   16.455892]  fff00000c7718080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.456231]  fff00000c7718100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.456455] ==================================================================

[   12.126861] ==================================================================
[   12.127850] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   12.128084] Free of addr ffff8881028c8001 by task kunit_try_catch/167
[   12.128290] 
[   12.128389] CPU: 0 UID: 0 PID: 167 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   12.128432] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.128443] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.128463] Call Trace:
[   12.128476]  <TASK>
[   12.128492]  dump_stack_lvl+0x73/0xb0
[   12.128523]  print_report+0xd1/0x650
[   12.128545]  ? __virt_addr_valid+0x1db/0x2d0
[   12.128570]  ? kasan_addr_to_slab+0x11/0xa0
[   12.128590]  ? kfree+0x274/0x3f0
[   12.128611]  kasan_report_invalid_free+0x10a/0x130
[   12.128635]  ? kfree+0x274/0x3f0
[   12.128657]  ? kfree+0x274/0x3f0
[   12.128676]  __kasan_kfree_large+0x86/0xd0
[   12.128697]  free_large_kmalloc+0x4b/0x110
[   12.128732]  kfree+0x274/0x3f0
[   12.128756]  kmalloc_large_invalid_free+0x120/0x2b0
[   12.128779]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   12.128803]  ? __schedule+0x10cc/0x2b60
[   12.128825]  ? __pfx_read_tsc+0x10/0x10
[   12.128847]  ? ktime_get_ts64+0x86/0x230
[   12.128872]  kunit_try_run_case+0x1a5/0x480
[   12.128897]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.128919]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.128943]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.128966]  ? __kthread_parkme+0x82/0x180
[   12.128987]  ? preempt_count_sub+0x50/0x80
[   12.129012]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.129036]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.129060]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.129085]  kthread+0x337/0x6f0
[   12.129103]  ? trace_preempt_on+0x20/0xc0
[   12.129126]  ? __pfx_kthread+0x10/0x10
[   12.129146]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.129167]  ? calculate_sigpending+0x7b/0xa0
[   12.129191]  ? __pfx_kthread+0x10/0x10
[   12.129211]  ret_from_fork+0x116/0x1d0
[   12.129229]  ? __pfx_kthread+0x10/0x10
[   12.129249]  ret_from_fork_asm+0x1a/0x30
[   12.129279]  </TASK>
[   12.129289] 
[   12.138460] The buggy address belongs to the physical page:
[   12.138647] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1028c8
[   12.139006] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   12.139469] flags: 0x200000000000040(head|node=0|zone=2)
[   12.139746] page_type: f8(unknown)
[   12.139926] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.140737] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.141359] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   12.141721] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   12.142064] head: 0200000000000002 ffffea00040a3201 00000000ffffffff 00000000ffffffff
[   12.142526] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   12.142880] page dumped because: kasan: bad access detected
[   12.143170] 
[   12.143350] Memory state around the buggy address:
[   12.143623]  ffff8881028c7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.143968]  ffff8881028c7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.144558] >ffff8881028c8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.144887]                    ^
[   12.145058]  ffff8881028c8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.145429]  ffff8881028c8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.145986] ==================================================================