Hay
Date
June 16, 2025, 7:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   20.359476] ==================================================================
[   20.359573] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   20.359663] Free of addr fff00000c6e21001 by task kunit_try_catch/220
[   20.359713] 
[   20.359776] CPU: 0 UID: 0 PID: 220 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT 
[   20.360416] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.360490] Hardware name: linux,dummy-virt (DT)
[   20.360577] Call trace:
[   20.360683]  show_stack+0x20/0x38 (C)
[   20.360936]  dump_stack_lvl+0x8c/0xd0
[   20.361021]  print_report+0x118/0x608
[   20.361091]  kasan_report_invalid_free+0xc0/0xe8
[   20.361447]  check_slab_allocation+0xfc/0x108
[   20.361538]  __kasan_slab_pre_free+0x2c/0x48
[   20.361598]  kmem_cache_free+0xf0/0x468
[   20.362132]  kmem_cache_invalid_free+0x184/0x3c8
[   20.362226]  kunit_try_run_case+0x170/0x3f0
[   20.362354]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.362452]  kthread+0x328/0x630
[   20.362511]  ret_from_fork+0x10/0x20
[   20.362870] 
[   20.362910] Allocated by task 220:
[   20.363166]  kasan_save_stack+0x3c/0x68
[   20.363439]  kasan_save_track+0x20/0x40
[   20.363688]  kasan_save_alloc_info+0x40/0x58
[   20.363962]  __kasan_slab_alloc+0xa8/0xb0
[   20.364025]  kmem_cache_alloc_noprof+0x10c/0x398
[   20.364101]  kmem_cache_invalid_free+0x12c/0x3c8
[   20.364149]  kunit_try_run_case+0x170/0x3f0
[   20.364772]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.365185]  kthread+0x328/0x630
[   20.365477]  ret_from_fork+0x10/0x20
[   20.365525] 
[   20.365551] The buggy address belongs to the object at fff00000c6e21000
[   20.365551]  which belongs to the cache test_cache of size 200
[   20.365726] The buggy address is located 1 bytes inside of
[   20.365726]  200-byte region [fff00000c6e21000, fff00000c6e210c8)
[   20.366098] 
[   20.366495] The buggy address belongs to the physical page:
[   20.366903] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106e21
[   20.367000] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.367067] page_type: f5(slab)
[   20.367121] raw: 0bfffe0000000000 fff00000c10dda00 dead000000000122 0000000000000000
[   20.367183] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   20.367233] page dumped because: kasan: bad access detected
[   20.367270] 
[   20.367294] Memory state around the buggy address:
[   20.367333]  fff00000c6e20f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.367388]  fff00000c6e20f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.367439] >fff00000c6e21000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.367484]                    ^
[   20.367517]  fff00000c6e21080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   20.369339]  fff00000c6e21100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.369414] ==================================================================

[   12.212290] ==================================================================
[   12.213500] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   12.214045] Free of addr ffff888102a2f001 by task kunit_try_catch/236
[   12.214753] 
[   12.214953] CPU: 0 UID: 0 PID: 236 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250616 #1 PREEMPT(voluntary) 
[   12.215005] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.215018] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.215039] Call Trace:
[   12.215053]  <TASK>
[   12.215096]  dump_stack_lvl+0x73/0xb0
[   12.215132]  print_report+0xd1/0x650
[   12.215156]  ? __virt_addr_valid+0x1db/0x2d0
[   12.215182]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.215204]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.215229]  kasan_report_invalid_free+0x10a/0x130
[   12.215253]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.215278]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.215300]  check_slab_allocation+0x11f/0x130
[   12.215321]  __kasan_slab_pre_free+0x28/0x40
[   12.215340]  kmem_cache_free+0xed/0x420
[   12.215359]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   12.215378]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.215415]  kmem_cache_invalid_free+0x1d8/0x460
[   12.215438]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   12.215460]  ? finish_task_switch.isra.0+0x153/0x700
[   12.215483]  ? __switch_to+0x47/0xf50
[   12.215512]  ? __pfx_read_tsc+0x10/0x10
[   12.215533]  ? ktime_get_ts64+0x86/0x230
[   12.215558]  kunit_try_run_case+0x1a5/0x480
[   12.215583]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.215604]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.215626]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.215647]  ? __kthread_parkme+0x82/0x180
[   12.215667]  ? preempt_count_sub+0x50/0x80
[   12.215689]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.215712]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.215733]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.215754]  kthread+0x337/0x6f0
[   12.215773]  ? trace_preempt_on+0x20/0xc0
[   12.215797]  ? __pfx_kthread+0x10/0x10
[   12.215817]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.215836]  ? calculate_sigpending+0x7b/0xa0
[   12.215860]  ? __pfx_kthread+0x10/0x10
[   12.215880]  ret_from_fork+0x116/0x1d0
[   12.215898]  ? __pfx_kthread+0x10/0x10
[   12.215917]  ret_from_fork_asm+0x1a/0x30
[   12.215958]  </TASK>
[   12.215970] 
[   12.228217] Allocated by task 236:
[   12.228349]  kasan_save_stack+0x45/0x70
[   12.228675]  kasan_save_track+0x18/0x40
[   12.229025]  kasan_save_alloc_info+0x3b/0x50
[   12.229391]  __kasan_slab_alloc+0x91/0xa0
[   12.229804]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.230214]  kmem_cache_invalid_free+0x157/0x460
[   12.230759]  kunit_try_run_case+0x1a5/0x480
[   12.231079]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.231242]  kthread+0x337/0x6f0
[   12.231355]  ret_from_fork+0x116/0x1d0
[   12.231546]  ret_from_fork_asm+0x1a/0x30
[   12.231892] 
[   12.232058] The buggy address belongs to the object at ffff888102a2f000
[   12.232058]  which belongs to the cache test_cache of size 200
[   12.233137] The buggy address is located 1 bytes inside of
[   12.233137]  200-byte region [ffff888102a2f000, ffff888102a2f0c8)
[   12.234066] 
[   12.234140] The buggy address belongs to the physical page:
[   12.234299] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a2f
[   12.235063] flags: 0x200000000000000(node=0|zone=2)
[   12.235487] page_type: f5(slab)
[   12.235879] raw: 0200000000000000 ffff888101d34640 dead000000000122 0000000000000000
[   12.236631] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.236976] page dumped because: kasan: bad access detected
[   12.237137] 
[   12.237199] Memory state around the buggy address:
[   12.237342]  ffff888102a2ef00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
[   12.237568]  ffff888102a2ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.238043] >ffff888102a2f000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.238295]                    ^
[   12.238491]  ffff888102a2f080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   12.238832]  ffff888102a2f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.239086] ==================================================================