Hay
Date
July 17, 2025, 10:12 a.m.

Environment
qemu-arm64
qemu-x86_64

[   29.344508] ==================================================================
[   29.344823] BUG: KASAN: invalid-free in kfree+0x270/0x3c8
[   29.344891] Free of addr fff00000c9190001 by task kunit_try_catch/181
[   29.345305] 
[   29.345354] CPU: 1 UID: 0 PID: 181 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250717 #1 PREEMPT 
[   29.345512] Tainted: [B]=BAD_PAGE, [N]=TEST
[   29.345602] Hardware name: linux,dummy-virt (DT)
[   29.345757] Call trace:
[   29.345838]  show_stack+0x20/0x38 (C)
[   29.346298]  dump_stack_lvl+0x8c/0xd0
[   29.346392]  print_report+0x118/0x5d0
[   29.346464]  kasan_report_invalid_free+0xc0/0xe8
[   29.346818]  __kasan_kfree_large+0x5c/0xa8
[   29.346874]  free_large_kmalloc+0x68/0x150
[   29.347085]  kfree+0x270/0x3c8
[   29.347267]  kmalloc_large_invalid_free+0x108/0x270
[   29.347400]  kunit_try_run_case+0x170/0x3f0
[   29.347672]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   29.347775]  kthread+0x328/0x630
[   29.347996]  ret_from_fork+0x10/0x20
[   29.348445] 
[   29.348652] The buggy address belongs to the physical page:
[   29.348770] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109190
[   29.348856] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   29.348979] flags: 0xbfffe0000000040(head|node=0|zone=2|lastcpupid=0x1ffff)
[   29.349138] page_type: f8(unknown)
[   29.349233] raw: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   29.349350] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   29.349401] head: 0bfffe0000000040 0000000000000000 dead000000000122 0000000000000000
[   29.349448] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   29.349952] head: 0bfffe0000000002 ffffc1ffc3246401 00000000ffffffff 00000000ffffffff
[   29.350097] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   29.350180] page dumped because: kasan: bad access detected
[   29.350388] 
[   29.350555] Memory state around the buggy address:
[   29.350604]  fff00000c918ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.350873]  fff00000c918ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.351145] >fff00000c9190000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.351360]                    ^
[   29.351449]  fff00000c9190080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.351540]  fff00000c9190100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.351636] ==================================================================

[   25.247278] ==================================================================
[   25.249424] BUG: KASAN: invalid-free in kfree+0x274/0x3f0
[   25.250367] Free of addr ffff888105f54001 by task kunit_try_catch/199
[   25.250582] 
[   25.250665] CPU: 1 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250717 #1 PREEMPT(voluntary) 
[   25.250715] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.250726] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.250746] Call Trace:
[   25.250759]  <TASK>
[   25.250774]  dump_stack_lvl+0x73/0xb0
[   25.250803]  print_report+0xd1/0x610
[   25.250860]  ? __virt_addr_valid+0x1db/0x2d0
[   25.250884]  ? kasan_addr_to_slab+0x11/0xa0
[   25.250903]  ? kfree+0x274/0x3f0
[   25.250923]  kasan_report_invalid_free+0x10a/0x130
[   25.250946]  ? kfree+0x274/0x3f0
[   25.250969]  ? kfree+0x274/0x3f0
[   25.250988]  __kasan_kfree_large+0x86/0xd0
[   25.251009]  free_large_kmalloc+0x52/0x110
[   25.251032]  kfree+0x274/0x3f0
[   25.251069]  kmalloc_large_invalid_free+0x120/0x2b0
[   25.251102]  ? __pfx_kmalloc_large_invalid_free+0x10/0x10
[   25.251125]  ? __schedule+0x10c6/0x2b60
[   25.251968]  ? __pfx_read_tsc+0x10/0x10
[   25.252186]  ? ktime_get_ts64+0x86/0x230
[   25.252217]  kunit_try_run_case+0x1a5/0x480
[   25.252257]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.252289]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.253552]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.253578]  ? __kthread_parkme+0x82/0x180
[   25.253602]  ? preempt_count_sub+0x50/0x80
[   25.253625]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.253647]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.253670]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.253692]  kthread+0x337/0x6f0
[   25.253710]  ? trace_preempt_on+0x20/0xc0
[   25.253733]  ? __pfx_kthread+0x10/0x10
[   25.253752]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.253772]  ? calculate_sigpending+0x7b/0xa0
[   25.253794]  ? __pfx_kthread+0x10/0x10
[   25.253814]  ret_from_fork+0x116/0x1d0
[   25.253832]  ? __pfx_kthread+0x10/0x10
[   25.253851]  ret_from_fork_asm+0x1a/0x30
[   25.253881]  </TASK>
[   25.253891] 
[   25.265060] The buggy address belongs to the physical page:
[   25.265242] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105f54
[   25.265600] head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
[   25.266139] flags: 0x200000000000040(head|node=0|zone=2)
[   25.266769] page_type: f8(unknown)
[   25.267213] raw: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   25.267595] raw: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   25.267838] head: 0200000000000040 0000000000000000 dead000000000122 0000000000000000
[   25.268095] head: 0000000000000000 0000000000000000 00000000f8000000 0000000000000000
[   25.268815] head: 0200000000000002 ffffea000417d501 00000000ffffffff 00000000ffffffff
[   25.269176] head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004
[   25.269618] page dumped because: kasan: bad access detected
[   25.269823] 
[   25.269887] Memory state around the buggy address:
[   25.270120]  ffff888105f53f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.270968]  ffff888105f53f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.271247] >ffff888105f54000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.271822]                    ^
[   25.271984]  ffff888105f54080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.272277]  ffff888105f54100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.272835] ==================================================================