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

Environment
qemu-arm64
qemu-x86_64

[   20.530899] ==================================================================
[   20.531357] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   20.532182] Free of addr fff00000c6368001 by task kunit_try_catch/211
[   20.532309] 
[   20.532402] CPU: 0 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   20.532610] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.532676] Hardware name: linux,dummy-virt (DT)
[   20.532759] Call trace:
[   20.532819]  show_stack+0x20/0x38 (C)
[   20.532947]  dump_stack_lvl+0x8c/0xd0
[   20.534050]  print_report+0x118/0x608
[   20.534363]  kasan_report_invalid_free+0xc0/0xe8
[   20.534754]  check_slab_allocation+0xfc/0x108
[   20.534936]  __kasan_slab_pre_free+0x2c/0x48
[   20.535423]  kmem_cache_free+0xf0/0x468
[   20.535545]  kmem_cache_invalid_free+0x184/0x3c8
[   20.535646]  kunit_try_run_case+0x170/0x3f0
[   20.535763]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.536423]  kthread+0x328/0x630
[   20.536768]  ret_from_fork+0x10/0x20
[   20.537217] 
[   20.537263] Allocated by task 211:
[   20.537412]  kasan_save_stack+0x3c/0x68
[   20.537503]  kasan_save_track+0x20/0x40
[   20.537640]  kasan_save_alloc_info+0x40/0x58
[   20.537960]  __kasan_slab_alloc+0xa8/0xb0
[   20.538380]  kmem_cache_alloc_noprof+0x10c/0x398
[   20.538767]  kmem_cache_invalid_free+0x12c/0x3c8
[   20.538876]  kunit_try_run_case+0x170/0x3f0
[   20.538970]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.539081]  kthread+0x328/0x630
[   20.539157]  ret_from_fork+0x10/0x20
[   20.539234] 
[   20.539276] The buggy address belongs to the object at fff00000c6368000
[   20.539276]  which belongs to the cache test_cache of size 200
[   20.539414] The buggy address is located 1 bytes inside of
[   20.539414]  200-byte region [fff00000c6368000, fff00000c63680c8)
[   20.539546] 
[   20.539593] The buggy address belongs to the physical page:
[   20.539662] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106368
[   20.539841] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.539956] page_type: f5(slab)
[   20.541178] raw: 0bfffe0000000000 fff00000c6de6280 dead000000000122 0000000000000000
[   20.541519] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   20.541809] page dumped because: kasan: bad access detected
[   20.541951] 
[   20.541993] Memory state around the buggy address:
[   20.542103]  fff00000c6367f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.542194]  fff00000c6367f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.542466] >fff00000c6368000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.543146]                    ^
[   20.543291]  fff00000c6368080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   20.543395]  fff00000c6368100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.543873] ==================================================================

[   12.263904] ==================================================================
[   12.264659] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   12.266163] Free of addr ffff8881039be001 by task kunit_try_catch/228
[   12.266486] 
[   12.266588] CPU: 1 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.266630] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.266641] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.266661] Call Trace:
[   12.266673]  <TASK>
[   12.266688]  dump_stack_lvl+0x73/0xb0
[   12.266718]  print_report+0xd1/0x650
[   12.266740]  ? __virt_addr_valid+0x1db/0x2d0
[   12.266765]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.266785]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.266809]  kasan_report_invalid_free+0x10a/0x130
[   12.266832]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.266857]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.266879]  check_slab_allocation+0x11f/0x130
[   12.266900]  __kasan_slab_pre_free+0x28/0x40
[   12.266920]  kmem_cache_free+0xed/0x420
[   12.266939]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   12.266959]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.266984]  kmem_cache_invalid_free+0x1d8/0x460
[   12.267008]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   12.267030]  ? finish_task_switch.isra.0+0x153/0x700
[   12.267053]  ? __switch_to+0x47/0xf50
[   12.267090]  ? __pfx_read_tsc+0x10/0x10
[   12.267111]  ? ktime_get_ts64+0x86/0x230
[   12.267147]  kunit_try_run_case+0x1a5/0x480
[   12.267171]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.267191]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.267214]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.267235]  ? __kthread_parkme+0x82/0x180
[   12.267255]  ? preempt_count_sub+0x50/0x80
[   12.267276]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.267298]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.267319]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.267340]  kthread+0x337/0x6f0
[   12.267358]  ? trace_preempt_on+0x20/0xc0
[   12.267381]  ? __pfx_kthread+0x10/0x10
[   12.267400]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.267420]  ? calculate_sigpending+0x7b/0xa0
[   12.267443]  ? __pfx_kthread+0x10/0x10
[   12.267463]  ret_from_fork+0x116/0x1d0
[   12.267480]  ? __pfx_kthread+0x10/0x10
[   12.267499]  ret_from_fork_asm+0x1a/0x30
[   12.267529]  </TASK>
[   12.267539] 
[   12.276008] Allocated by task 228:
[   12.276151]  kasan_save_stack+0x45/0x70
[   12.276479]  kasan_save_track+0x18/0x40
[   12.276676]  kasan_save_alloc_info+0x3b/0x50
[   12.276844]  __kasan_slab_alloc+0x91/0xa0
[   12.277045]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.277279]  kmem_cache_invalid_free+0x157/0x460
[   12.277525]  kunit_try_run_case+0x1a5/0x480
[   12.277693]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.277937]  kthread+0x337/0x6f0
[   12.278058]  ret_from_fork+0x116/0x1d0
[   12.278307]  ret_from_fork_asm+0x1a/0x30
[   12.278637] 
[   12.278735] The buggy address belongs to the object at ffff8881039be000
[   12.278735]  which belongs to the cache test_cache of size 200
[   12.279275] The buggy address is located 1 bytes inside of
[   12.279275]  200-byte region [ffff8881039be000, ffff8881039be0c8)
[   12.279725] 
[   12.279813] The buggy address belongs to the physical page:
[   12.280054] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039be
[   12.280621] flags: 0x200000000000000(node=0|zone=2)
[   12.280851] page_type: f5(slab)
[   12.281007] raw: 0200000000000000 ffff8881019c6500 dead000000000122 0000000000000000
[   12.281356] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.281680] page dumped because: kasan: bad access detected
[   12.281852] 
[   12.281922] Memory state around the buggy address:
[   12.282077]  ffff8881039bdf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.282349]  ffff8881039bdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.282674] >ffff8881039be000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.282987]                    ^
[   12.283104]  ffff8881039be080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   12.283327]  ffff8881039be100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.283540] ==================================================================