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

Environment
qemu-arm64
qemu-x86_64

[   31.198799] ==================================================================
[   31.199079] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   31.199152] Free of addr fff00000c9a59001 by task kunit_try_catch/242
[   31.199197] 
[   31.199412] CPU: 0 UID: 0 PID: 242 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT 
[   31.199588] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.199625] Hardware name: linux,dummy-virt (DT)
[   31.199684] Call trace:
[   31.199709]  show_stack+0x20/0x38 (C)
[   31.199836]  dump_stack_lvl+0x8c/0xd0
[   31.199893]  print_report+0x118/0x5d0
[   31.199936]  kasan_report_invalid_free+0xc0/0xe8
[   31.199984]  check_slab_allocation+0xfc/0x108
[   31.200035]  __kasan_slab_pre_free+0x2c/0x48
[   31.200373]  kmem_cache_free+0xf0/0x468
[   31.200521]  kmem_cache_invalid_free+0x184/0x3c8
[   31.200606]  kunit_try_run_case+0x170/0x3f0
[   31.200722]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.200811]  kthread+0x328/0x630
[   31.200909]  ret_from_fork+0x10/0x20
[   31.200990] 
[   31.201008] Allocated by task 242:
[   31.201037]  kasan_save_stack+0x3c/0x68
[   31.201118]  kasan_save_track+0x20/0x40
[   31.201673]  kasan_save_alloc_info+0x40/0x58
[   31.201714]  __kasan_slab_alloc+0xa8/0xb0
[   31.201751]  kmem_cache_alloc_noprof+0x10c/0x398
[   31.203954]  kmem_cache_invalid_free+0x12c/0x3c8
[   31.204025]  kunit_try_run_case+0x170/0x3f0
[   31.205428]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.207790]  kthread+0x328/0x630
[   31.207853]  ret_from_fork+0x10/0x20
[   31.207892] 
[   31.207912] The buggy address belongs to the object at fff00000c9a59000
[   31.207912]  which belongs to the cache test_cache of size 200
[   31.207974] The buggy address is located 1 bytes inside of
[   31.207974]  200-byte region [fff00000c9a59000, fff00000c9a590c8)
[   31.208035] 
[   31.208058] The buggy address belongs to the physical page:
[   31.208092] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109a59
[   31.208150] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.208201] page_type: f5(slab)
[   31.208240] raw: 0bfffe0000000000 fff00000c56a1a00 dead000000000122 0000000000000000
[   31.208291] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   31.208333] page dumped because: kasan: bad access detected
[   31.208366] 
[   31.208383] Memory state around the buggy address:
[   31.208415]  fff00000c9a58f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.208461]  fff00000c9a58f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.208522] >fff00000c9a59000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.208563]                    ^
[   31.208589]  fff00000c9a59080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   31.208632]  fff00000c9a59100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.209405] ==================================================================

[   24.032429] ==================================================================
[   24.033029] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   24.033436] Free of addr ffff888106089001 by task kunit_try_catch/260
[   24.033725] 
[   24.033820] CPU: 1 UID: 0 PID: 260 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250716 #1 PREEMPT(voluntary) 
[   24.033874] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.033886] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.033908] Call Trace:
[   24.033922]  <TASK>
[   24.033942]  dump_stack_lvl+0x73/0xb0
[   24.033975]  print_report+0xd1/0x610
[   24.033998]  ? __virt_addr_valid+0x1db/0x2d0
[   24.034024]  ? kasan_complete_mode_report_info+0x2a/0x200
[   24.034049]  ? kmem_cache_invalid_free+0x1d8/0x460
[   24.034074]  kasan_report_invalid_free+0x10a/0x130
[   24.034097]  ? kmem_cache_invalid_free+0x1d8/0x460
[   24.034367]  ? kmem_cache_invalid_free+0x1d8/0x460
[   24.034391]  check_slab_allocation+0x11f/0x130
[   24.034413]  __kasan_slab_pre_free+0x28/0x40
[   24.034433]  kmem_cache_free+0xed/0x420
[   24.034454]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   24.034478]  ? kmem_cache_invalid_free+0x1d8/0x460
[   24.034504]  kmem_cache_invalid_free+0x1d8/0x460
[   24.034527]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   24.034550]  ? finish_task_switch.isra.0+0x153/0x700
[   24.034573]  ? __switch_to+0x47/0xf80
[   24.034602]  ? __pfx_read_tsc+0x10/0x10
[   24.034624]  ? ktime_get_ts64+0x86/0x230
[   24.034654]  kunit_try_run_case+0x1a5/0x480
[   24.034680]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.034701]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   24.034725]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.034747]  ? __kthread_parkme+0x82/0x180
[   24.034768]  ? preempt_count_sub+0x50/0x80
[   24.034789]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.034812]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.034839]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.034865]  kthread+0x337/0x6f0
[   24.034941]  ? trace_preempt_on+0x20/0xc0
[   24.034966]  ? __pfx_kthread+0x10/0x10
[   24.034986]  ? _raw_spin_unlock_irq+0x47/0x80
[   24.035007]  ? calculate_sigpending+0x7b/0xa0
[   24.035031]  ? __pfx_kthread+0x10/0x10
[   24.035052]  ret_from_fork+0x116/0x1d0
[   24.035071]  ? __pfx_kthread+0x10/0x10
[   24.035092]  ret_from_fork_asm+0x1a/0x30
[   24.035123]  </TASK>
[   24.035134] 
[   24.043233] Allocated by task 260:
[   24.043431]  kasan_save_stack+0x45/0x70
[   24.043638]  kasan_save_track+0x18/0x40
[   24.044088]  kasan_save_alloc_info+0x3b/0x50
[   24.044322]  __kasan_slab_alloc+0x91/0xa0
[   24.044460]  kmem_cache_alloc_noprof+0x123/0x3f0
[   24.044615]  kmem_cache_invalid_free+0x157/0x460
[   24.044771]  kunit_try_run_case+0x1a5/0x480
[   24.044972]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.045220]  kthread+0x337/0x6f0
[   24.045426]  ret_from_fork+0x116/0x1d0
[   24.045624]  ret_from_fork_asm+0x1a/0x30
[   24.045831] 
[   24.045898] The buggy address belongs to the object at ffff888106089000
[   24.045898]  which belongs to the cache test_cache of size 200
[   24.046247] The buggy address is located 1 bytes inside of
[   24.046247]  200-byte region [ffff888106089000, ffff8881060890c8)
[   24.047023] 
[   24.047137] The buggy address belongs to the physical page:
[   24.047650] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106089
[   24.048038] flags: 0x200000000000000(node=0|zone=2)
[   24.048261] page_type: f5(slab)
[   24.048444] raw: 0200000000000000 ffff888106085140 dead000000000122 0000000000000000
[   24.048775] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   24.049158] page dumped because: kasan: bad access detected
[   24.049390] 
[   24.049455] Memory state around the buggy address:
[   24.049641]  ffff888106088f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.050179]  ffff888106088f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.050479] >ffff888106089000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   24.050802]                    ^
[   24.051173]  ffff888106089080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   24.051412]  ffff888106089100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.051868] ==================================================================