Hay
Date
July 10, 2025, 11:10 p.m.

Environment
qemu-arm64
qemu-x86_64

[   16.748990] ==================================================================
[   16.749122] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   16.749204] Free of addr fff00000c641b001 by task kunit_try_catch/211
[   16.749248] 
[   16.749565] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   16.749661] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.749992] Hardware name: linux,dummy-virt (DT)
[   16.750115] Call trace:
[   16.750179]  show_stack+0x20/0x38 (C)
[   16.750240]  dump_stack_lvl+0x8c/0xd0
[   16.750322]  print_report+0x118/0x608
[   16.750372]  kasan_report_invalid_free+0xc0/0xe8
[   16.750566]  check_slab_allocation+0xfc/0x108
[   16.750814]  __kasan_slab_pre_free+0x2c/0x48
[   16.750867]  kmem_cache_free+0xf0/0x468
[   16.751241]  kmem_cache_invalid_free+0x184/0x3c8
[   16.751374]  kunit_try_run_case+0x170/0x3f0
[   16.751432]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.751791]  kthread+0x328/0x630
[   16.751920]  ret_from_fork+0x10/0x20
[   16.751979] 
[   16.752022] Allocated by task 211:
[   16.752239]  kasan_save_stack+0x3c/0x68
[   16.752412]  kasan_save_track+0x20/0x40
[   16.752488]  kasan_save_alloc_info+0x40/0x58
[   16.752572]  __kasan_slab_alloc+0xa8/0xb0
[   16.752755]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.752932]  kmem_cache_invalid_free+0x12c/0x3c8
[   16.753011]  kunit_try_run_case+0x170/0x3f0
[   16.753137]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.753225]  kthread+0x328/0x630
[   16.753666]  ret_from_fork+0x10/0x20
[   16.753788] 
[   16.753842] The buggy address belongs to the object at fff00000c641b000
[   16.753842]  which belongs to the cache test_cache of size 200
[   16.753947] The buggy address is located 1 bytes inside of
[   16.753947]  200-byte region [fff00000c641b000, fff00000c641b0c8)
[   16.754129] 
[   16.754383] The buggy address belongs to the physical page:
[   16.754475] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10641b
[   16.754539] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.754816] page_type: f5(slab)
[   16.755550] raw: 0bfffe0000000000 fff00000c5696500 dead000000000122 0000000000000000
[   16.755782] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.755881] page dumped because: kasan: bad access detected
[   16.756228] 
[   16.756357] Memory state around the buggy address:
[   16.756430]  fff00000c641af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.756668]  fff00000c641af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.756880] >fff00000c641b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.756959]                    ^
[   16.756988]  fff00000c641b080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   16.757182]  fff00000c641b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.757326] ==================================================================

[   13.425080] ==================================================================
[   13.425922] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.426228] Free of addr ffff8881027ba001 by task kunit_try_catch/228
[   13.427078] 
[   13.427194] CPU: 0 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.427483] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.427502] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.427524] Call Trace:
[   13.427537]  <TASK>
[   13.427553]  dump_stack_lvl+0x73/0xb0
[   13.427588]  print_report+0xd1/0x650
[   13.427610]  ? __virt_addr_valid+0x1db/0x2d0
[   13.427635]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.427658]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.427684]  kasan_report_invalid_free+0x10a/0x130
[   13.427708]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.427735]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.427760]  check_slab_allocation+0x11f/0x130
[   13.427781]  __kasan_slab_pre_free+0x28/0x40
[   13.427802]  kmem_cache_free+0xed/0x420
[   13.427822]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.427842]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.427870]  kmem_cache_invalid_free+0x1d8/0x460
[   13.427895]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.427919]  ? finish_task_switch.isra.0+0x153/0x700
[   13.427943]  ? __switch_to+0x47/0xf50
[   13.427971]  ? __pfx_read_tsc+0x10/0x10
[   13.427992]  ? ktime_get_ts64+0x86/0x230
[   13.428017]  kunit_try_run_case+0x1a5/0x480
[   13.428041]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.428064]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.428088]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.428111]  ? __kthread_parkme+0x82/0x180
[   13.428132]  ? preempt_count_sub+0x50/0x80
[   13.428155]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.428187]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.428211]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.428236]  kthread+0x337/0x6f0
[   13.428254]  ? trace_preempt_on+0x20/0xc0
[   13.428278]  ? __pfx_kthread+0x10/0x10
[   13.428298]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.428319]  ? calculate_sigpending+0x7b/0xa0
[   13.428344]  ? __pfx_kthread+0x10/0x10
[   13.428413]  ret_from_fork+0x116/0x1d0
[   13.428445]  ? __pfx_kthread+0x10/0x10
[   13.428466]  ret_from_fork_asm+0x1a/0x30
[   13.428498]  </TASK>
[   13.428509] 
[   13.439327] Allocated by task 228:
[   13.439568]  kasan_save_stack+0x45/0x70
[   13.439726]  kasan_save_track+0x18/0x40
[   13.440072]  kasan_save_alloc_info+0x3b/0x50
[   13.440325]  __kasan_slab_alloc+0x91/0xa0
[   13.441660]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.441842]  kmem_cache_invalid_free+0x157/0x460
[   13.442009]  kunit_try_run_case+0x1a5/0x480
[   13.442165]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.443468]  kthread+0x337/0x6f0
[   13.443687]  ret_from_fork+0x116/0x1d0
[   13.443877]  ret_from_fork_asm+0x1a/0x30
[   13.444122] 
[   13.444253] The buggy address belongs to the object at ffff8881027ba000
[   13.444253]  which belongs to the cache test_cache of size 200
[   13.444838] The buggy address is located 1 bytes inside of
[   13.444838]  200-byte region [ffff8881027ba000, ffff8881027ba0c8)
[   13.445295] 
[   13.445735] The buggy address belongs to the physical page:
[   13.445913] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1027ba
[   13.446150] flags: 0x200000000000000(node=0|zone=2)
[   13.446335] page_type: f5(slab)
[   13.446517] raw: 0200000000000000 ffff8881027b7000 dead000000000122 0000000000000000
[   13.446827] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.447046] page dumped because: kasan: bad access detected
[   13.447266] 
[   13.448882] Memory state around the buggy address:
[   13.449078]  ffff8881027b9f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.449299]  ffff8881027b9f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.449549] >ffff8881027ba000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.449763]                    ^
[   13.449880]  ffff8881027ba080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.450092]  ffff8881027ba100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.450302] ==================================================================