Hay
Date
March 19, 2025, 10:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   33.598337] ==================================================================
[   33.598572] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   33.598749] Free of addr fff00000c7748001 by task kunit_try_catch/152
[   33.598887] 
[   33.598988] CPU: 1 UID: 0 PID: 152 Comm: kunit_try_catch Tainted: G    B            N  6.14.0-rc7-next-20250319 #1 PREEMPT 
[   33.599564] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.599684] Hardware name: linux,dummy-virt (DT)
[   33.599792] Call trace:
[   33.599905]  show_stack+0x20/0x38 (C)
[   33.600099]  dump_stack_lvl+0x8c/0xd0
[   33.600248]  print_report+0x118/0x5f0
[   33.600393]  kasan_report_invalid_free+0xb0/0xd8
[   33.600611]  __kasan_kfree_large+0x5c/0xa8
[   33.600766]  free_large_kmalloc+0x64/0x190
[   33.600927]  kfree+0x270/0x3c8
[   33.601119]  kmalloc_large_invalid_free+0x108/0x270
[   33.601684]  kunit_try_run_case+0x14c/0x3d0
[   33.601930]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.602147]  kthread+0x318/0x618
[   33.602296]  ret_from_fork+0x10/0x20
[   33.602785] 
[   33.603043] The buggy address belongs to the physical page:
[   33.603320] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107748
[   33.603816] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   33.604223] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   33.604417] page_type: f8(unknown)
[   33.604538] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   33.604753] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   33.604921] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   33.605088] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   33.605270] head: 0bfffe0000000002 ffffc1ffc31dd201 00000000ffffffff 00000000ffffffff
[   33.605506] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   33.605722] page dumped because: kasan: bad access detected
[   33.605883] 
[   33.605977] Memory state around the buggy address:
[   33.606151]  fff00000c7747f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   33.606372]  fff00000c7747f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   33.606619] >fff00000c7748000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   33.607029]                    ^
[   33.607143]  fff00000c7748080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   33.607615]  fff00000c7748100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   33.608160] ==================================================================

[   20.762954] ==================================================================
[   20.765185] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   20.765868] Free of addr ffff888102690001 by task kunit_try_catch/171
[   20.766235] 
[   20.766474] CPU: 1 UID: 0 PID: 171 Comm: kunit_try_catch Tainted: G    B            N  6.14.0-rc7-next-20250319 #1 PREEMPT(voluntary) 
[   20.766599] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.766635] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   20.766675] Call Trace:
[   20.766696]  <TASK>
[   20.766729]  dump_stack_lvl+0x73/0xb0
[   20.766775]  print_report+0xd1/0x660
[   20.766828]  ? __virt_addr_valid+0x1db/0x2d0
[   20.766904]  ? kasan_addr_to_slab+0x11/0xa0
[   20.766936]  ? kfree+0x274/0x3f0
[   20.766962]  kasan_report_invalid_free+0xce/0x100
[   20.766998]  ? kfree+0x274/0x3f0
[   20.767029]  ? kfree+0x274/0x3f0
[   20.767056]  __kasan_kfree_large+0x86/0xd0
[   20.767087]  free_large_kmalloc+0x4b/0x130
[   20.767165]  kfree+0x274/0x3f0
[   20.767225]  kmalloc_large_invalid_free+0x120/0x2b0
[   20.767288]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   20.767352]  ? __schedule+0xd46/0x29c0
[   20.767415]  ? __pfx_read_tsc+0x10/0x10
[   20.767475]  ? ktime_get_ts64+0x86/0x240
[   20.767636]  kunit_try_run_case+0x1b2/0x490
[   20.767697]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.768450]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   20.768493]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   20.768527]  ? __kthread_parkme+0x82/0x160
[   20.768560]  ? preempt_count_sub+0x50/0x80
[   20.768597]  ? __pfx_kunit_try_run_case+0x10/0x10
[   20.768631]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   20.768666]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   20.768765]  kthread+0x323/0x710
[   20.768833]  ? trace_preempt_on+0x20/0xc0
[   20.768896]  ? __pfx_kthread+0x10/0x10
[   20.768930]  ? _raw_spin_unlock_irq+0x47/0x80
[   20.768960]  ? calculate_sigpending+0x7b/0xa0
[   20.768992]  ? __pfx_kthread+0x10/0x10
[   20.769024]  ret_from_fork+0x41/0x80
[   20.769056]  ? __pfx_kthread+0x10/0x10
[   20.769088]  ret_from_fork_asm+0x1a/0x30
[   20.769159]  </TASK>
[   20.769176] 
[   20.789984] The buggy address belongs to the physical page:
[   20.790803] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102690
[   20.791224] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   20.791559] flags: 0x200000000000040(head|node=0|zone=2)
[   20.791789] page_type: f8(unknown)
[   20.791942] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   20.793416] raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   20.794439] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   20.795286] head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000
[   20.795700] head: 0200000000000002 ffffea000409a401 00000000ffffffff 00000000ffffffff
[   20.797193] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   20.797840] page dumped because: kasan: bad access detected
[   20.799330] 
[   20.799488] Memory state around the buggy address:
[   20.799885]  ffff88810268ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.801089]  ffff88810268ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.801562] >ffff888102690000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.802574]                    ^
[   20.803455]  ffff888102690080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.803931]  ffff888102690100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.805505] ==================================================================