Hay
Date
July 8, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   30.923440] ==================================================================
[   30.923525] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   30.923588] Free of addr fff00000c9a24001 by task kunit_try_catch/181
[   30.923631] 
[   30.923661] CPU: 0 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT 
[   30.923783] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.923943] Hardware name: linux,dummy-virt (DT)
[   30.923993] Call trace:
[   30.924045]  show_stack+0x20/0x38 (C)
[   30.924126]  dump_stack_lvl+0x8c/0xd0
[   30.924174]  print_report+0x118/0x5d0
[   30.924242]  kasan_report_invalid_free+0xc0/0xe8
[   30.924293]  __kasan_kfree_large+0x5c/0xa8
[   30.924340]  free_large_kmalloc+0x68/0x150
[   30.924386]  kfree+0x270/0x3c8
[   30.924428]  kmalloc_large_invalid_free+0x108/0x270
[   30.924476]  kunit_try_run_case+0x170/0x3f0
[   30.924525]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.924595]  kthread+0x328/0x630
[   30.924637]  ret_from_fork+0x10/0x20
[   30.924787] 
[   30.924839] The buggy address belongs to the physical page:
[   30.924933] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a24
[   30.925013] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   30.925127] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   30.925223] page_type: f8(unknown)
[   30.925262] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   30.925335] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   30.925603] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   30.925658] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   30.925705] head: 0bfffe0000000002 ffffc1ffc3268901 00000000ffffffff 00000000ffffffff
[   30.925752] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   30.925790] page dumped because: kasan: bad access detected
[   30.925820] 
[   30.925837] Memory state around the buggy address:
[   30.925867]  fff00000c9a23f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.925943]  fff00000c9a23f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.926003] >fff00000c9a24000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.926071]                    ^
[   30.926099]  fff00000c9a24080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.926146]  fff00000c9a24100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.926235] ==================================================================

[   22.902379] ==================================================================
[   22.903035] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   22.903352] Free of addr ffff888106314001 by task kunit_try_catch/198
[   22.903629] 
[   22.903742] CPU: 0 UID: 0 PID: 198 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT(voluntary) 
[   22.904133] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.904150] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.904175] Call Trace:
[   22.904191]  <TASK>
[   22.904211]  dump_stack_lvl+0x73/0xb0
[   22.904281]  print_report+0xd1/0x610
[   22.904307]  ? __virt_addr_valid+0x1db/0x2d0
[   22.904334]  ? kasan_addr_to_slab+0x11/0xa0
[   22.904353]  ? kfree+0x274/0x3f0
[   22.904377]  kasan_report_invalid_free+0x10a/0x130
[   22.904402]  ? kfree+0x274/0x3f0
[   22.904427]  ? kfree+0x274/0x3f0
[   22.904450]  __kasan_kfree_large+0x86/0xd0
[   22.904471]  free_large_kmalloc+0x52/0x110
[   22.904496]  kfree+0x274/0x3f0
[   22.904523]  kmalloc_large_invalid_free+0x120/0x2b0
[   22.904546]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   22.904571]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   22.904597]  kunit_try_run_case+0x1a5/0x480
[   22.904620]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.904641]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.904663]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.904692]  ? __kthread_parkme+0x82/0x180
[   22.904713]  ? preempt_count_sub+0x50/0x80
[   22.904737]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.905054]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.905085]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.905113]  kthread+0x337/0x6f0
[   22.905135]  ? trace_preempt_on+0x20/0xc0
[   22.905161]  ? __pfx_kthread+0x10/0x10
[   22.905184]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.905220]  ? calculate_sigpending+0x7b/0xa0
[   22.905261]  ? __pfx_kthread+0x10/0x10
[   22.905284]  ret_from_fork+0x116/0x1d0
[   22.905306]  ? __pfx_kthread+0x10/0x10
[   22.905328]  ret_from_fork_asm+0x1a/0x30
[   22.905363]  </TASK>
[   22.905374] 
[   22.917269] The buggy address belongs to the physical page:
[   22.917484] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106314
[   22.917954] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   22.918264] flags: 0x200000000000040(head|node=0|zone=2)
[   22.919071] page_type: f8(unknown)
[   22.919372] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   22.919854] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   22.920338] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   22.920740] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   22.921268] head: 0200000000000002 ffffea000418c501 00000000ffffffff 00000000ffffffff
[   22.921598] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   22.921996] page dumped because: kasan: bad access detected
[   22.922327] 
[   22.922393] Memory state around the buggy address:
[   22.923230]  ffff888106313f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.923543]  ffff888106313f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.924138] >ffff888106314000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.924534]                    ^
[   22.924797]  ffff888106314080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.925327]  ffff888106314100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.925815] ==================================================================