Hay
Date
July 2, 2025, 11:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.951433] ==================================================================
[   18.951505] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   18.951601] Free of addr fff00000c707c001 by task kunit_try_catch/211
[   18.951647] 
[   18.951688] CPU: 0 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.951775] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.951812] Hardware name: linux,dummy-virt (DT)
[   18.951854] Call trace:
[   18.951879]  show_stack+0x20/0x38 (C)
[   18.951934]  dump_stack_lvl+0x8c/0xd0
[   18.951986]  print_report+0x118/0x608
[   18.952034]  kasan_report_invalid_free+0xc0/0xe8
[   18.952085]  check_slab_allocation+0xfc/0x108
[   18.952132]  __kasan_slab_pre_free+0x2c/0x48
[   18.952181]  kmem_cache_free+0xf0/0x468
[   18.952229]  kmem_cache_invalid_free+0x184/0x3c8
[   18.952277]  kunit_try_run_case+0x170/0x3f0
[   18.952326]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.952388]  kthread+0x328/0x630
[   18.952433]  ret_from_fork+0x10/0x20
[   18.952483] 
[   18.952501] Allocated by task 211:
[   18.952542]  kasan_save_stack+0x3c/0x68
[   18.952593]  kasan_save_track+0x20/0x40
[   18.952630]  kasan_save_alloc_info+0x40/0x58
[   18.952670]  __kasan_slab_alloc+0xa8/0xb0
[   18.953404]  kmem_cache_alloc_noprof+0x10c/0x398
[   18.953590]  kmem_cache_invalid_free+0x12c/0x3c8
[   18.953727]  kunit_try_run_case+0x170/0x3f0
[   18.953771]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.953826]  kthread+0x328/0x630
[   18.954217]  ret_from_fork+0x10/0x20
[   18.954287] 
[   18.954367] The buggy address belongs to the object at fff00000c707c000
[   18.954367]  which belongs to the cache test_cache of size 200
[   18.954616] The buggy address is located 1 bytes inside of
[   18.954616]  200-byte region [fff00000c707c000, fff00000c707c0c8)
[   18.954869] 
[   18.954978] The buggy address belongs to the physical page:
[   18.955055] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10707c
[   18.955319] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.955462] page_type: f5(slab)
[   18.955551] raw: 0bfffe0000000000 fff00000c5834c80 dead000000000122 0000000000000000
[   18.955681] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.955743] page dumped because: kasan: bad access detected
[   18.956102] 
[   18.956164] Memory state around the buggy address:
[   18.956351]  fff00000c707bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.956463]  fff00000c707bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.956604] >fff00000c707c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.956872]                    ^
[   18.956939]  fff00000c707c080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   18.957030]  fff00000c707c100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.957073] ==================================================================

[   12.132881] ==================================================================
[   12.133421] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   12.133790] Free of addr ffff88810397e001 by task kunit_try_catch/230
[   12.134144] 
[   12.134264] CPU: 1 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.134311] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.134322] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.134342] Call Trace:
[   12.134355]  <TASK>
[   12.134384]  dump_stack_lvl+0x73/0xb0
[   12.134414]  print_report+0xd1/0x650
[   12.134436]  ? __virt_addr_valid+0x1db/0x2d0
[   12.134461]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.134482]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.134507]  kasan_report_invalid_free+0x10a/0x130
[   12.134530]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.134555]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.134578]  check_slab_allocation+0x11f/0x130
[   12.134598]  __kasan_slab_pre_free+0x28/0x40
[   12.134617]  kmem_cache_free+0xed/0x420
[   12.134637]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   12.134655]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.134680]  kmem_cache_invalid_free+0x1d8/0x460
[   12.134715]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   12.134737]  ? finish_task_switch.isra.0+0x153/0x700
[   12.134760]  ? __switch_to+0x47/0xf50
[   12.134799]  ? __pfx_read_tsc+0x10/0x10
[   12.134819]  ? ktime_get_ts64+0x86/0x230
[   12.134843]  kunit_try_run_case+0x1a5/0x480
[   12.134867]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.134888]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.134910]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.134931]  ? __kthread_parkme+0x82/0x180
[   12.134951]  ? preempt_count_sub+0x50/0x80
[   12.134972]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.135003]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.135025]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.135046]  kthread+0x337/0x6f0
[   12.135064]  ? trace_preempt_on+0x20/0xc0
[   12.135087]  ? __pfx_kthread+0x10/0x10
[   12.135107]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.135127]  ? calculate_sigpending+0x7b/0xa0
[   12.135150]  ? __pfx_kthread+0x10/0x10
[   12.135170]  ret_from_fork+0x116/0x1d0
[   12.135187]  ? __pfx_kthread+0x10/0x10
[   12.135206]  ret_from_fork_asm+0x1a/0x30
[   12.135235]  </TASK>
[   12.135246] 
[   12.145560] Allocated by task 230:
[   12.145727]  kasan_save_stack+0x45/0x70
[   12.145936]  kasan_save_track+0x18/0x40
[   12.146130]  kasan_save_alloc_info+0x3b/0x50
[   12.146340]  __kasan_slab_alloc+0x91/0xa0
[   12.146992]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.147173]  kmem_cache_invalid_free+0x157/0x460
[   12.147545]  kunit_try_run_case+0x1a5/0x480
[   12.147849]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.148092]  kthread+0x337/0x6f0
[   12.148419]  ret_from_fork+0x116/0x1d0
[   12.148615]  ret_from_fork_asm+0x1a/0x30
[   12.148948] 
[   12.149049] The buggy address belongs to the object at ffff88810397e000
[   12.149049]  which belongs to the cache test_cache of size 200
[   12.149742] The buggy address is located 1 bytes inside of
[   12.149742]  200-byte region [ffff88810397e000, ffff88810397e0c8)
[   12.150313] 
[   12.150400] The buggy address belongs to the physical page:
[   12.150787] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10397e
[   12.151258] flags: 0x200000000000000(node=0|zone=2)
[   12.151575] page_type: f5(slab)
[   12.151711] raw: 0200000000000000 ffff888100fae780 dead000000000122 0000000000000000
[   12.152277] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.152700] page dumped because: kasan: bad access detected
[   12.152933] 
[   12.153029] Memory state around the buggy address:
[   12.153332]  ffff88810397df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.153649]  ffff88810397df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.154118] >ffff88810397e000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.154504]                    ^
[   12.154754]  ffff88810397e080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   12.155011]  ffff88810397e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.155443] ==================================================================