Hay
Date
July 12, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   17.386194] ==================================================================
[   17.386362] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   17.386557] Free of addr fff00000c78b0001 by task kunit_try_catch/211
[   17.386635] 
[   17.386672] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   17.386772] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.386835] Hardware name: linux,dummy-virt (DT)
[   17.386894] Call trace:
[   17.386933]  show_stack+0x20/0x38 (C)
[   17.387004]  dump_stack_lvl+0x8c/0xd0
[   17.387064]  print_report+0x118/0x5d0
[   17.387130]  kasan_report_invalid_free+0xc0/0xe8
[   17.387229]  check_slab_allocation+0xfc/0x108
[   17.387291]  __kasan_slab_pre_free+0x2c/0x48
[   17.387403]  kmem_cache_free+0xf0/0x468
[   17.387452]  kmem_cache_invalid_free+0x184/0x3c8
[   17.387678]  kunit_try_run_case+0x170/0x3f0
[   17.387913]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.388055]  kthread+0x328/0x630
[   17.388197]  ret_from_fork+0x10/0x20
[   17.388303] 
[   17.388396] Allocated by task 211:
[   17.388474]  kasan_save_stack+0x3c/0x68
[   17.388544]  kasan_save_track+0x20/0x40
[   17.388639]  kasan_save_alloc_info+0x40/0x58
[   17.388709]  __kasan_slab_alloc+0xa8/0xb0
[   17.388822]  kmem_cache_alloc_noprof+0x10c/0x398
[   17.388951]  kmem_cache_invalid_free+0x12c/0x3c8
[   17.388992]  kunit_try_run_case+0x170/0x3f0
[   17.389316]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.389469]  kthread+0x328/0x630
[   17.389583]  ret_from_fork+0x10/0x20
[   17.389676] 
[   17.389792] The buggy address belongs to the object at fff00000c78b0000
[   17.389792]  which belongs to the cache test_cache of size 200
[   17.389898] The buggy address is located 1 bytes inside of
[   17.389898]  200-byte region [fff00000c78b0000, fff00000c78b00c8)
[   17.390197] 
[   17.390257] The buggy address belongs to the physical page:
[   17.390291] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1078b0
[   17.390353] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.390404] page_type: f5(slab)
[   17.390487] raw: 0bfffe0000000000 fff00000c4715b40 dead000000000122 0000000000000000
[   17.390582] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   17.390625] page dumped because: kasan: bad access detected
[   17.390666] 
[   17.390685] Memory state around the buggy address:
[   17.390753]  fff00000c78aff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.390800]  fff00000c78aff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   17.390844] >fff00000c78b0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.390937]                    ^
[   17.391072]  fff00000c78b0080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   17.391194]  fff00000c78b0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.391233] ==================================================================

[   13.725247] ==================================================================
[   13.725706] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.726050] Free of addr ffff888102a03001 by task kunit_try_catch/228
[   13.726951] 
[   13.727070] CPU: 1 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.727113] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.727124] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.727144] Call Trace:
[   13.727155]  <TASK>
[   13.727171]  dump_stack_lvl+0x73/0xb0
[   13.727203]  print_report+0xd1/0x610
[   13.727225]  ? __virt_addr_valid+0x1db/0x2d0
[   13.727250]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.727286]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.727312]  kasan_report_invalid_free+0x10a/0x130
[   13.727337]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.727364]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.727388]  check_slab_allocation+0x11f/0x130
[   13.727410]  __kasan_slab_pre_free+0x28/0x40
[   13.727431]  kmem_cache_free+0xed/0x420
[   13.727450]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.727471]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.727499]  kmem_cache_invalid_free+0x1d8/0x460
[   13.727523]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.727548]  ? finish_task_switch.isra.0+0x153/0x700
[   13.727572]  ? __switch_to+0x47/0xf50
[   13.727600]  ? __pfx_read_tsc+0x10/0x10
[   13.727690]  ? ktime_get_ts64+0x86/0x230
[   13.727718]  kunit_try_run_case+0x1a5/0x480
[   13.727743]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.727766]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.727791]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.727814]  ? __kthread_parkme+0x82/0x180
[   13.727834]  ? preempt_count_sub+0x50/0x80
[   13.727857]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.727881]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.727905]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.727930]  kthread+0x337/0x6f0
[   13.727949]  ? trace_preempt_on+0x20/0xc0
[   13.727973]  ? __pfx_kthread+0x10/0x10
[   13.727994]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.728015]  ? calculate_sigpending+0x7b/0xa0
[   13.728040]  ? __pfx_kthread+0x10/0x10
[   13.728060]  ret_from_fork+0x116/0x1d0
[   13.728079]  ? __pfx_kthread+0x10/0x10
[   13.728099]  ret_from_fork_asm+0x1a/0x30
[   13.728129]  </TASK>
[   13.728140] 
[   13.736842] Allocated by task 228:
[   13.737009]  kasan_save_stack+0x45/0x70
[   13.737201]  kasan_save_track+0x18/0x40
[   13.738084]  kasan_save_alloc_info+0x3b/0x50
[   13.738314]  __kasan_slab_alloc+0x91/0xa0
[   13.738677]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.739152]  kmem_cache_invalid_free+0x157/0x460
[   13.739679]  kunit_try_run_case+0x1a5/0x480
[   13.739881]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.740442]  kthread+0x337/0x6f0
[   13.740657]  ret_from_fork+0x116/0x1d0
[   13.740963]  ret_from_fork_asm+0x1a/0x30
[   13.741369] 
[   13.741649] The buggy address belongs to the object at ffff888102a03000
[   13.741649]  which belongs to the cache test_cache of size 200
[   13.742415] The buggy address is located 1 bytes inside of
[   13.742415]  200-byte region [ffff888102a03000, ffff888102a030c8)
[   13.742874] 
[   13.742966] The buggy address belongs to the physical page:
[   13.743581] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a03
[   13.744402] flags: 0x200000000000000(node=0|zone=2)
[   13.744779] page_type: f5(slab)
[   13.744944] raw: 0200000000000000 ffff888101cdda00 dead000000000122 0000000000000000
[   13.745653] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.746337] page dumped because: kasan: bad access detected
[   13.746566] 
[   13.746651] Memory state around the buggy address:
[   13.746865]  ffff888102a02f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.747499]  ffff888102a02f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.747799] >ffff888102a03000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.748316]                    ^
[   13.748494]  ffff888102a03080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.748780]  ffff888102a03100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.749579] ==================================================================