Hay
Date
July 20, 2025, 11:12 a.m.

Environment
qemu-arm64
qemu-x86_64

[   15.906328] ==================================================================
[   15.906400] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   15.906605] Free of addr fff00000c701a001 by task kunit_try_catch/211
[   15.906659] 
[   15.906942] CPU: 0 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   15.907466] Tainted: [B]=BAD_PAGE, [N]=TEST
[   15.907650] Hardware name: linux,dummy-virt (DT)
[   15.907716] Call trace:
[   15.907825]  show_stack+0x20/0x38 (C)
[   15.907913]  dump_stack_lvl+0x8c/0xd0
[   15.907970]  print_report+0x118/0x5d0
[   15.908016]  kasan_report_invalid_free+0xc0/0xe8
[   15.908098]  check_slab_allocation+0xfc/0x108
[   15.908148]  __kasan_slab_pre_free+0x2c/0x48
[   15.908214]  kmem_cache_free+0xf0/0x468
[   15.908263]  kmem_cache_invalid_free+0x184/0x3c8
[   15.908311]  kunit_try_run_case+0x170/0x3f0
[   15.908362]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.908460]  kthread+0x328/0x630
[   15.908502]  ret_from_fork+0x10/0x20
[   15.908559] 
[   15.908579] Allocated by task 211:
[   15.908607]  kasan_save_stack+0x3c/0x68
[   15.908649]  kasan_save_track+0x20/0x40
[   15.908706]  kasan_save_alloc_info+0x40/0x58
[   15.908746]  __kasan_slab_alloc+0xa8/0xb0
[   15.908788]  kmem_cache_alloc_noprof+0x10c/0x398
[   15.908843]  kmem_cache_invalid_free+0x12c/0x3c8
[   15.908891]  kunit_try_run_case+0x170/0x3f0
[   15.908929]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   15.908970]  kthread+0x328/0x630
[   15.909003]  ret_from_fork+0x10/0x20
[   15.909037] 
[   15.909057] The buggy address belongs to the object at fff00000c701a000
[   15.909057]  which belongs to the cache test_cache of size 200
[   15.909114] The buggy address is located 1 bytes inside of
[   15.909114]  200-byte region [fff00000c701a000, fff00000c701a0c8)
[   15.909174] 
[   15.909205] The buggy address belongs to the physical page:
[   15.909249] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10701a
[   15.909313] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   15.909363] page_type: f5(slab)
[   15.909420] raw: 0bfffe0000000000 fff00000c700b140 dead000000000122 0000000000000000
[   15.909475] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   15.909524] page dumped because: kasan: bad access detected
[   15.909555] 
[   15.909578] Memory state around the buggy address:
[   15.909611]  fff00000c7019f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   15.910064]  fff00000c7019f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   15.910404] >fff00000c701a000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   15.910470]                    ^
[   15.910539]  fff00000c701a080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   15.910654]  fff00000c701a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   15.910943] ==================================================================

[   13.042216] ==================================================================
[   13.043166] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.043444] Free of addr ffff888102ae3001 by task kunit_try_catch/228
[   13.043807] 
[   13.044425] CPU: 0 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.044476] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.044487] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.044509] Call Trace:
[   13.044521]  <TASK>
[   13.044539]  dump_stack_lvl+0x73/0xb0
[   13.044571]  print_report+0xd1/0x610
[   13.044593]  ? __virt_addr_valid+0x1db/0x2d0
[   13.044616]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.044636]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.044660]  kasan_report_invalid_free+0x10a/0x130
[   13.044811]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.044841]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.044865]  check_slab_allocation+0x11f/0x130
[   13.044885]  __kasan_slab_pre_free+0x28/0x40
[   13.044913]  kmem_cache_free+0xed/0x420
[   13.044933]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.044952]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.044978]  kmem_cache_invalid_free+0x1d8/0x460
[   13.045000]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.045022]  ? finish_task_switch.isra.0+0x153/0x700
[   13.045044]  ? __switch_to+0x47/0xf50
[   13.045072]  ? __pfx_read_tsc+0x10/0x10
[   13.045092]  ? ktime_get_ts64+0x86/0x230
[   13.045116]  kunit_try_run_case+0x1a5/0x480
[   13.045139]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.045160]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.045183]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.045205]  ? __kthread_parkme+0x82/0x180
[   13.045224]  ? preempt_count_sub+0x50/0x80
[   13.045245]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.045268]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.045290]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.045311]  kthread+0x337/0x6f0
[   13.045329]  ? trace_preempt_on+0x20/0xc0
[   13.045415]  ? __pfx_kthread+0x10/0x10
[   13.045436]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.045456]  ? calculate_sigpending+0x7b/0xa0
[   13.045480]  ? __pfx_kthread+0x10/0x10
[   13.045500]  ret_from_fork+0x116/0x1d0
[   13.045518]  ? __pfx_kthread+0x10/0x10
[   13.045537]  ret_from_fork_asm+0x1a/0x30
[   13.045567]  </TASK>
[   13.045577] 
[   13.060846] Allocated by task 228:
[   13.061231]  kasan_save_stack+0x45/0x70
[   13.061704]  kasan_save_track+0x18/0x40
[   13.061848]  kasan_save_alloc_info+0x3b/0x50
[   13.062241]  __kasan_slab_alloc+0x91/0xa0
[   13.062733]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.063131]  kmem_cache_invalid_free+0x157/0x460
[   13.063293]  kunit_try_run_case+0x1a5/0x480
[   13.063620]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.064184]  kthread+0x337/0x6f0
[   13.064631]  ret_from_fork+0x116/0x1d0
[   13.065010]  ret_from_fork_asm+0x1a/0x30
[   13.065231] 
[   13.065301] The buggy address belongs to the object at ffff888102ae3000
[   13.065301]  which belongs to the cache test_cache of size 200
[   13.066315] The buggy address is located 1 bytes inside of
[   13.066315]  200-byte region [ffff888102ae3000, ffff888102ae30c8)
[   13.066885] 
[   13.066970] The buggy address belongs to the physical page:
[   13.067152] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102ae3
[   13.067456] flags: 0x200000000000000(node=0|zone=2)
[   13.067630] page_type: f5(slab)
[   13.067804] raw: 0200000000000000 ffff8881015ac640 dead000000000122 0000000000000000
[   13.068059] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.068286] page dumped because: kasan: bad access detected
[   13.068677] 
[   13.068831] Memory state around the buggy address:
[   13.069251]  ffff888102ae2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.070072]  ffff888102ae2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.070698] >ffff888102ae3000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.070925]                    ^
[   13.071043]  ffff888102ae3080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.071262]  ffff888102ae3100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.071503] ==================================================================