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

Environment
qemu-arm64
qemu-x86_64

[   34.116563] ==================================================================
[   34.116700] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   34.116846] Free of addr fff00000c6469001 by task kunit_try_catch/223
[   34.116947] 
[   34.117435] CPU: 1 UID: 0 PID: 223 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT 
[   34.118175] Tainted: [B]=BAD_PAGE, [N]=TEST
[   34.118252] Hardware name: linux,dummy-virt (DT)
[   34.118343] Call trace:
[   34.118404]  show_stack+0x20/0x38 (C)
[   34.119426]  dump_stack_lvl+0x8c/0xd0
[   34.119722]  print_report+0x118/0x608
[   34.119863]  kasan_report_invalid_free+0xc0/0xe8
[   34.120250]  check_slab_allocation+0xfc/0x108
[   34.120388]  __kasan_slab_pre_free+0x2c/0x48
[   34.120640]  kmem_cache_free+0xf0/0x468
[   34.120994]  kmem_cache_invalid_free+0x184/0x3c8
[   34.121173]  kunit_try_run_case+0x170/0x3f0
[   34.121508]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.121639]  kthread+0x328/0x630
[   34.121753]  ret_from_fork+0x10/0x20
[   34.121871] 
[   34.121966] Allocated by task 223:
[   34.122063]  kasan_save_stack+0x3c/0x68
[   34.122183]  kasan_save_track+0x20/0x40
[   34.122367]  kasan_save_alloc_info+0x40/0x58
[   34.122544]  __kasan_slab_alloc+0xa8/0xb0
[   34.122962]  kmem_cache_alloc_noprof+0x10c/0x398
[   34.123512]  kmem_cache_invalid_free+0x12c/0x3c8
[   34.123644]  kunit_try_run_case+0x170/0x3f0
[   34.123759]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.123881]  kthread+0x328/0x630
[   34.123977]  ret_from_fork+0x10/0x20
[   34.124095] 
[   34.124143] The buggy address belongs to the object at fff00000c6469000
[   34.124143]  which belongs to the cache test_cache of size 200
[   34.125010] The buggy address is located 1 bytes inside of
[   34.125010]  200-byte region [fff00000c6469000, fff00000c64690c8)
[   34.125267] 
[   34.125420] The buggy address belongs to the physical page:
[   34.125519] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106469
[   34.125782] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   34.125973] page_type: f5(slab)
[   34.126100] raw: 0bfffe0000000000 fff00000c56418c0 dead000000000122 0000000000000000
[   34.126702] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   34.126984] page dumped because: kasan: bad access detected
[   34.127529] 
[   34.127728] Memory state around the buggy address:
[   34.127852]  fff00000c6468f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   34.128097]  fff00000c6468f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   34.128487] >fff00000c6469000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   34.128587]                    ^
[   34.128864]  fff00000c6469080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   34.128997]  fff00000c6469100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.129113] ==================================================================

[   22.570766] ==================================================================
[   22.571920] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   22.572490] Free of addr ffff888102c0f001 by task kunit_try_catch/240
[   22.573061] 
[   22.573410] CPU: 1 UID: 0 PID: 240 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT(voluntary) 
[   22.573504] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.573524] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.573559] Call Trace:
[   22.573585]  <TASK>
[   22.573620]  dump_stack_lvl+0x73/0xb0
[   22.573683]  print_report+0xd1/0x650
[   22.573721]  ? __virt_addr_valid+0x1db/0x2d0
[   22.573760]  ? kasan_complete_mode_report_info+0x2a/0x200
[   22.573781]  ? kmem_cache_invalid_free+0x1d8/0x460
[   22.573802]  kasan_report_invalid_free+0x10a/0x130
[   22.573822]  ? kmem_cache_invalid_free+0x1d8/0x460
[   22.573866]  ? kmem_cache_invalid_free+0x1d8/0x460
[   22.573890]  check_slab_allocation+0x11f/0x130
[   22.573909]  __kasan_slab_pre_free+0x28/0x40
[   22.573926]  kmem_cache_free+0xed/0x420
[   22.573943]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   22.573963]  ? kmem_cache_invalid_free+0x1d8/0x460
[   22.573985]  kmem_cache_invalid_free+0x1d8/0x460
[   22.574006]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   22.574038]  ? finish_task_switch.isra.0+0x153/0x700
[   22.574059]  ? __switch_to+0x47/0xf50
[   22.574116]  ? __pfx_read_tsc+0x10/0x10
[   22.574158]  ? ktime_get_ts64+0x86/0x230
[   22.574199]  kunit_try_run_case+0x1a5/0x480
[   22.574236]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.574269]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.574304]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.574336]  ? __kthread_parkme+0x82/0x180
[   22.574366]  ? preempt_count_sub+0x50/0x80
[   22.574418]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.574453]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.574487]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.574520]  kthread+0x337/0x6f0
[   22.574542]  ? trace_preempt_on+0x20/0xc0
[   22.574566]  ? __pfx_kthread+0x10/0x10
[   22.574584]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.574603]  ? calculate_sigpending+0x7b/0xa0
[   22.574625]  ? __pfx_kthread+0x10/0x10
[   22.574644]  ret_from_fork+0x116/0x1d0
[   22.574662]  ? __pfx_kthread+0x10/0x10
[   22.574680]  ret_from_fork_asm+0x1a/0x30
[   22.574709]  </TASK>
[   22.574722] 
[   22.586750] Allocated by task 240:
[   22.587063]  kasan_save_stack+0x45/0x70
[   22.587611]  kasan_save_track+0x18/0x40
[   22.587901]  kasan_save_alloc_info+0x3b/0x50
[   22.588318]  __kasan_slab_alloc+0x91/0xa0
[   22.588576]  kmem_cache_alloc_noprof+0x123/0x3f0
[   22.588868]  kmem_cache_invalid_free+0x157/0x460
[   22.589475]  kunit_try_run_case+0x1a5/0x480
[   22.589724]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.590204]  kthread+0x337/0x6f0
[   22.590366]  ret_from_fork+0x116/0x1d0
[   22.590518]  ret_from_fork_asm+0x1a/0x30
[   22.590660] 
[   22.590742] The buggy address belongs to the object at ffff888102c0f000
[   22.590742]  which belongs to the cache test_cache of size 200
[   22.591653] The buggy address is located 1 bytes inside of
[   22.591653]  200-byte region [ffff888102c0f000, ffff888102c0f0c8)
[   22.592255] 
[   22.592428] The buggy address belongs to the physical page:
[   22.593107] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102c0f
[   22.593644] flags: 0x200000000000000(node=0|zone=2)
[   22.594040] page_type: f5(slab)
[   22.594692] raw: 0200000000000000 ffff888101ba5c80 dead000000000122 0000000000000000
[   22.595065] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   22.595693] page dumped because: kasan: bad access detected
[   22.596064] 
[   22.596501] Memory state around the buggy address:
[   22.596746]  ffff888102c0ef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.597435]  ffff888102c0ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.598153] >ffff888102c0f000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.598469]                    ^
[   22.598725]  ffff888102c0f080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   22.599947]  ffff888102c0f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.600354] ==================================================================