Hay
Date
July 5, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   20.061784] ==================================================================
[   20.061957] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   20.062120] Free of addr fff00000c7931001 by task kunit_try_catch/212
[   20.062249] 
[   20.062416] CPU: 0 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   20.062658] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.062721] Hardware name: linux,dummy-virt (DT)
[   20.062821] Call trace:
[   20.062873]  show_stack+0x20/0x38 (C)
[   20.062984]  dump_stack_lvl+0x8c/0xd0
[   20.063088]  print_report+0x118/0x608
[   20.063177]  kasan_report_invalid_free+0xc0/0xe8
[   20.063282]  check_slab_allocation+0xfc/0x108
[   20.063397]  __kasan_slab_pre_free+0x2c/0x48
[   20.063548]  kmem_cache_free+0xf0/0x468
[   20.063657]  kmem_cache_invalid_free+0x184/0x3c8
[   20.063755]  kunit_try_run_case+0x170/0x3f0
[   20.063843]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.063945]  kthread+0x328/0x630
[   20.064027]  ret_from_fork+0x10/0x20
[   20.064126] 
[   20.064162] Allocated by task 212:
[   20.064239]  kasan_save_stack+0x3c/0x68
[   20.064347]  kasan_save_track+0x20/0x40
[   20.064446]  kasan_save_alloc_info+0x40/0x58
[   20.064544]  __kasan_slab_alloc+0xa8/0xb0
[   20.064652]  kmem_cache_alloc_noprof+0x10c/0x398
[   20.064741]  kmem_cache_invalid_free+0x12c/0x3c8
[   20.064853]  kunit_try_run_case+0x170/0x3f0
[   20.064986]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.065109]  kthread+0x328/0x630
[   20.065197]  ret_from_fork+0x10/0x20
[   20.065269] 
[   20.065310] The buggy address belongs to the object at fff00000c7931000
[   20.065310]  which belongs to the cache test_cache of size 200
[   20.065433] The buggy address is located 1 bytes inside of
[   20.065433]  200-byte region [fff00000c7931000, fff00000c79310c8)
[   20.065584] 
[   20.065648] The buggy address belongs to the physical page:
[   20.065716] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107931
[   20.065830] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.065933] page_type: f5(slab)
[   20.066009] raw: 0bfffe0000000000 fff00000c1afab40 dead000000000122 0000000000000000
[   20.066109] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   20.066192] page dumped because: kasan: bad access detected
[   20.066288] 
[   20.066341] Memory state around the buggy address:
[   20.066425]  fff00000c7930f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.066553]  fff00000c7930f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.066693] >fff00000c7931000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.066818]                    ^
[   20.066902]  fff00000c7931080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   20.067040]  fff00000c7931100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.067159] ==================================================================

[   14.458891] ==================================================================
[   14.459433] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   14.459755] Free of addr ffff8881038df001 by task kunit_try_catch/228
[   14.460278] 
[   14.460575] CPU: 0 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   14.460637] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.460663] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.460692] Call Trace:
[   14.460709]  <TASK>
[   14.460734]  dump_stack_lvl+0x73/0xb0
[   14.460775]  print_report+0xd1/0x650
[   14.461317]  ? __virt_addr_valid+0x1db/0x2d0
[   14.461356]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.461383]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.461412]  kasan_report_invalid_free+0x10a/0x130
[   14.461441]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.461472]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.461501]  check_slab_allocation+0x11f/0x130
[   14.461526]  __kasan_slab_pre_free+0x28/0x40
[   14.461550]  kmem_cache_free+0xed/0x420
[   14.461574]  ? kasan_save_track+0x18/0x40
[   14.461597]  ? kasan_save_stack+0x45/0x70
[   14.461619]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.461663]  ? kmem_cache_invalid_free+0x157/0x460
[   14.461694]  kmem_cache_invalid_free+0x1d8/0x460
[   14.461722]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   14.461750]  ? finish_task_switch.isra.0+0x153/0x700
[   14.461790]  ? __switch_to+0x47/0xf50
[   14.461827]  ? __pfx_read_tsc+0x10/0x10
[   14.461853]  ? ktime_get_ts64+0x86/0x230
[   14.461883]  kunit_try_run_case+0x1a5/0x480
[   14.461914]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.461940]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.461970]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.461997]  ? __kthread_parkme+0x82/0x180
[   14.462022]  ? preempt_count_sub+0x50/0x80
[   14.462049]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.462076]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.462103]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.462130]  kthread+0x337/0x6f0
[   14.462153]  ? trace_preempt_on+0x20/0xc0
[   14.462181]  ? __pfx_kthread+0x10/0x10
[   14.462205]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.462229]  ? calculate_sigpending+0x7b/0xa0
[   14.462258]  ? __pfx_kthread+0x10/0x10
[   14.462283]  ret_from_fork+0x116/0x1d0
[   14.462306]  ? __pfx_kthread+0x10/0x10
[   14.462330]  ret_from_fork_asm+0x1a/0x30
[   14.462367]  </TASK>
[   14.462382] 
[   14.474870] Allocated by task 228:
[   14.475326]  kasan_save_stack+0x45/0x70
[   14.475558]  kasan_save_track+0x18/0x40
[   14.475735]  kasan_save_alloc_info+0x3b/0x50
[   14.476233]  __kasan_slab_alloc+0x91/0xa0
[   14.476591]  kmem_cache_alloc_noprof+0x123/0x3f0
[   14.476838]  kmem_cache_invalid_free+0x157/0x460
[   14.477184]  kunit_try_run_case+0x1a5/0x480
[   14.477367]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.477580]  kthread+0x337/0x6f0
[   14.477743]  ret_from_fork+0x116/0x1d0
[   14.477934]  ret_from_fork_asm+0x1a/0x30
[   14.478263] 
[   14.478412] The buggy address belongs to the object at ffff8881038df000
[   14.478412]  which belongs to the cache test_cache of size 200
[   14.479167] The buggy address is located 1 bytes inside of
[   14.479167]  200-byte region [ffff8881038df000, ffff8881038df0c8)
[   14.480220] 
[   14.480359] The buggy address belongs to the physical page:
[   14.480634] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038df
[   14.480946] flags: 0x200000000000000(node=0|zone=2)
[   14.481194] page_type: f5(slab)
[   14.481476] raw: 0200000000000000 ffff888101b9bb40 dead000000000122 0000000000000000
[   14.482449] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   14.482981] page dumped because: kasan: bad access detected
[   14.483267] 
[   14.483353] Memory state around the buggy address:
[   14.483579]  ffff8881038def00: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc
[   14.484016]  ffff8881038def80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.484416] >ffff8881038df000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.484724]                    ^
[   14.485185]  ffff8881038df080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   14.485506]  ffff8881038df100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.485926] ==================================================================