Hay
Date
July 1, 2025, 11:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   19.112958] ==================================================================
[   19.113066] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   19.113186] Free of addr fff00000c7716001 by task kunit_try_catch/212
[   19.113235] 
[   19.113644] CPU: 1 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   19.114201] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.114312] Hardware name: linux,dummy-virt (DT)
[   19.114466] Call trace:
[   19.114502]  show_stack+0x20/0x38 (C)
[   19.114614]  dump_stack_lvl+0x8c/0xd0
[   19.114696]  print_report+0x118/0x608
[   19.114746]  kasan_report_invalid_free+0xc0/0xe8
[   19.115244]  check_slab_allocation+0xfc/0x108
[   19.115300]  __kasan_slab_pre_free+0x2c/0x48
[   19.115354]  kmem_cache_free+0xf0/0x468
[   19.115419]  kmem_cache_invalid_free+0x184/0x3c8
[   19.115582]  kunit_try_run_case+0x170/0x3f0
[   19.115637]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.115735]  kthread+0x328/0x630
[   19.115785]  ret_from_fork+0x10/0x20
[   19.116026] 
[   19.116050] Allocated by task 212:
[   19.116094]  kasan_save_stack+0x3c/0x68
[   19.116218]  kasan_save_track+0x20/0x40
[   19.116317]  kasan_save_alloc_info+0x40/0x58
[   19.116426]  __kasan_slab_alloc+0xa8/0xb0
[   19.116561]  kmem_cache_alloc_noprof+0x10c/0x398
[   19.116630]  kmem_cache_invalid_free+0x12c/0x3c8
[   19.116723]  kunit_try_run_case+0x170/0x3f0
[   19.116814]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.116885]  kthread+0x328/0x630
[   19.116920]  ret_from_fork+0x10/0x20
[   19.116961] 
[   19.116983] The buggy address belongs to the object at fff00000c7716000
[   19.116983]  which belongs to the cache test_cache of size 200
[   19.117429] The buggy address is located 1 bytes inside of
[   19.117429]  200-byte region [fff00000c7716000, fff00000c77160c8)
[   19.117531] 
[   19.117649] The buggy address belongs to the physical page:
[   19.117687] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107716
[   19.117893] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.117979] page_type: f5(slab)
[   19.118037] raw: 0bfffe0000000000 fff00000c0cacc80 dead000000000122 0000000000000000
[   19.118629] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.118725] page dumped because: kasan: bad access detected
[   19.118762] 
[   19.118781] Memory state around the buggy address:
[   19.118823]  fff00000c7715f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.119315]  fff00000c7715f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   19.119473] >fff00000c7716000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.119559]                    ^
[   19.119592]  fff00000c7716080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   19.119639]  fff00000c7716100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.119708] ==================================================================

[   12.236638] ==================================================================
[   12.237179] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   12.237633] Free of addr ffff888102f0b001 by task kunit_try_catch/228
[   12.237927] 
[   12.238047] CPU: 1 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.238095] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.238106] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.238128] Call Trace:
[   12.238141]  <TASK>
[   12.238160]  dump_stack_lvl+0x73/0xb0
[   12.238192]  print_report+0xd1/0x650
[   12.238214]  ? __virt_addr_valid+0x1db/0x2d0
[   12.238239]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.238259]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.238361]  kasan_report_invalid_free+0x10a/0x130
[   12.238402]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.238427]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.238450]  check_slab_allocation+0x11f/0x130
[   12.238470]  __kasan_slab_pre_free+0x28/0x40
[   12.238489]  kmem_cache_free+0xed/0x420
[   12.238509]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   12.238528]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.238571]  kmem_cache_invalid_free+0x1d8/0x460
[   12.238595]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   12.238617]  ? finish_task_switch.isra.0+0x153/0x700
[   12.238641]  ? __switch_to+0x47/0xf50
[   12.238669]  ? __pfx_read_tsc+0x10/0x10
[   12.238690]  ? ktime_get_ts64+0x86/0x230
[   12.238713]  kunit_try_run_case+0x1a5/0x480
[   12.238738]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.238758]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.238782]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.238803]  ? __kthread_parkme+0x82/0x180
[   12.238823]  ? preempt_count_sub+0x50/0x80
[   12.238844]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.238875]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.238897]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.238977]  kthread+0x337/0x6f0
[   12.238996]  ? trace_preempt_on+0x20/0xc0
[   12.239019]  ? __pfx_kthread+0x10/0x10
[   12.239038]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.239058]  ? calculate_sigpending+0x7b/0xa0
[   12.239082]  ? __pfx_kthread+0x10/0x10
[   12.239102]  ret_from_fork+0x116/0x1d0
[   12.239119]  ? __pfx_kthread+0x10/0x10
[   12.239138]  ret_from_fork_asm+0x1a/0x30
[   12.239167]  </TASK>
[   12.239179] 
[   12.247601] Allocated by task 228:
[   12.247757]  kasan_save_stack+0x45/0x70
[   12.247909]  kasan_save_track+0x18/0x40
[   12.248231]  kasan_save_alloc_info+0x3b/0x50
[   12.248468]  __kasan_slab_alloc+0x91/0xa0
[   12.248715]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.248994]  kmem_cache_invalid_free+0x157/0x460
[   12.249250]  kunit_try_run_case+0x1a5/0x480
[   12.249433]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.249708]  kthread+0x337/0x6f0
[   12.249901]  ret_from_fork+0x116/0x1d0
[   12.250132]  ret_from_fork_asm+0x1a/0x30
[   12.250338] 
[   12.250430] The buggy address belongs to the object at ffff888102f0b000
[   12.250430]  which belongs to the cache test_cache of size 200
[   12.251024] The buggy address is located 1 bytes inside of
[   12.251024]  200-byte region [ffff888102f0b000, ffff888102f0b0c8)
[   12.251511] 
[   12.251619] The buggy address belongs to the physical page:
[   12.251899] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102f0b
[   12.252284] flags: 0x200000000000000(node=0|zone=2)
[   12.252541] page_type: f5(slab)
[   12.252736] raw: 0200000000000000 ffff888101a2c8c0 dead000000000122 0000000000000000
[   12.253147] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.253467] page dumped because: kasan: bad access detected
[   12.253706] 
[   12.253778] Memory state around the buggy address:
[   12.253949]  ffff888102f0af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.254186]  ffff888102f0af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.254610] >ffff888102f0b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.254987]                    ^
[   12.255154]  ffff888102f0b080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   12.255387]  ffff888102f0b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.255671] ==================================================================