Hay
Date
July 10, 2025, 9:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   30.288574] ==================================================================
[   30.288665] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   30.288738] Free of addr fff00000c9978001 by task kunit_try_catch/242
[   30.288792] 
[   30.288832] CPU: 1 UID: 0 PID: 242 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250710 #1 PREEMPT 
[   30.288948] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.288979] Hardware name: linux,dummy-virt (DT)
[   30.289021] Call trace:
[   30.289046]  show_stack+0x20/0x38 (C)
[   30.289101]  dump_stack_lvl+0x8c/0xd0
[   30.289169]  print_report+0x118/0x5d0
[   30.289216]  kasan_report_invalid_free+0xc0/0xe8
[   30.289310]  check_slab_allocation+0xfc/0x108
[   30.289395]  __kasan_slab_pre_free+0x2c/0x48
[   30.289919]  kmem_cache_free+0xf0/0x468
[   30.290007]  kmem_cache_invalid_free+0x184/0x3c8
[   30.290066]  kunit_try_run_case+0x170/0x3f0
[   30.290161]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.290227]  kthread+0x328/0x630
[   30.290272]  ret_from_fork+0x10/0x20
[   30.290325] 
[   30.290343] Allocated by task 242:
[   30.290375]  kasan_save_stack+0x3c/0x68
[   30.290422]  kasan_save_track+0x20/0x40
[   30.290602]  kasan_save_alloc_info+0x40/0x58
[   30.290654]  __kasan_slab_alloc+0xa8/0xb0
[   30.290708]  kmem_cache_alloc_noprof+0x10c/0x398
[   30.290794]  kmem_cache_invalid_free+0x12c/0x3c8
[   30.290879]  kunit_try_run_case+0x170/0x3f0
[   30.290946]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.291011]  kthread+0x328/0x630
[   30.291070]  ret_from_fork+0x10/0x20
[   30.291117] 
[   30.291147] The buggy address belongs to the object at fff00000c9978000
[   30.291147]  which belongs to the cache test_cache of size 200
[   30.291350] The buggy address is located 1 bytes inside of
[   30.291350]  200-byte region [fff00000c9978000, fff00000c99780c8)
[   30.291436] 
[   30.291458] The buggy address belongs to the physical page:
[   30.291506] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109978
[   30.291579] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.291642] page_type: f5(slab)
[   30.291742] raw: 0bfffe0000000000 fff00000c3e373c0 dead000000000122 0000000000000000
[   30.291872] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   30.291983] page dumped because: kasan: bad access detected
[   30.292094] 
[   30.292162] Memory state around the buggy address:
[   30.292271]  fff00000c9977f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   30.292329]  fff00000c9977f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   30.292634] >fff00000c9978000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   30.292748]                    ^
[   30.292849]  fff00000c9978080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   30.292939]  fff00000c9978100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.293044] ==================================================================

[   25.813270] ==================================================================
[   25.813757] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   25.814437] Free of addr ffff888105852001 by task kunit_try_catch/259
[   25.815044] 
[   25.815245] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250710 #1 PREEMPT(voluntary) 
[   25.815305] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.815317] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.815341] Call Trace:
[   25.815354]  <TASK>
[   25.815376]  dump_stack_lvl+0x73/0xb0
[   25.815408]  print_report+0xd1/0x610
[   25.815432]  ? __virt_addr_valid+0x1db/0x2d0
[   25.815458]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.815483]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.815507]  kasan_report_invalid_free+0x10a/0x130
[   25.815540]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.815566]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.815589]  check_slab_allocation+0x11f/0x130
[   25.815611]  __kasan_slab_pre_free+0x28/0x40
[   25.815631]  kmem_cache_free+0xed/0x420
[   25.815655]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   25.815678]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.815715]  kmem_cache_invalid_free+0x1d8/0x460
[   25.815739]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   25.815762]  ? finish_task_switch.isra.0+0x153/0x700
[   25.815795]  ? __switch_to+0x47/0xf80
[   25.815824]  ? __pfx_read_tsc+0x10/0x10
[   25.815852]  ? ktime_get_ts64+0x86/0x230
[   25.815878]  kunit_try_run_case+0x1a5/0x480
[   25.815901]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.815921]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.815946]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.815969]  ? __kthread_parkme+0x82/0x180
[   25.815989]  ? preempt_count_sub+0x50/0x80
[   25.816011]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.816032]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.816056]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.816081]  kthread+0x337/0x6f0
[   25.816100]  ? trace_preempt_on+0x20/0xc0
[   25.816124]  ? __pfx_kthread+0x10/0x10
[   25.816144]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.816165]  ? calculate_sigpending+0x7b/0xa0
[   25.816194]  ? __pfx_kthread+0x10/0x10
[   25.816215]  ret_from_fork+0x116/0x1d0
[   25.816234]  ? __pfx_kthread+0x10/0x10
[   25.816254]  ret_from_fork_asm+0x1a/0x30
[   25.816286]  </TASK>
[   25.816298] 
[   25.827812] Allocated by task 259:
[   25.828570]  kasan_save_stack+0x45/0x70
[   25.828962]  kasan_save_track+0x18/0x40
[   25.829117]  kasan_save_alloc_info+0x3b/0x50
[   25.829472]  __kasan_slab_alloc+0x91/0xa0
[   25.829676]  kmem_cache_alloc_noprof+0x123/0x3f0
[   25.830137]  kmem_cache_invalid_free+0x157/0x460
[   25.830380]  kunit_try_run_case+0x1a5/0x480
[   25.830733]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.831189]  kthread+0x337/0x6f0
[   25.831364]  ret_from_fork+0x116/0x1d0
[   25.831738]  ret_from_fork_asm+0x1a/0x30
[   25.832079] 
[   25.832160] The buggy address belongs to the object at ffff888105852000
[   25.832160]  which belongs to the cache test_cache of size 200
[   25.832918] The buggy address is located 1 bytes inside of
[   25.832918]  200-byte region [ffff888105852000, ffff8881058520c8)
[   25.833612] 
[   25.833915] The buggy address belongs to the physical page:
[   25.834176] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105852
[   25.834681] flags: 0x200000000000000(node=0|zone=2)
[   25.835153] page_type: f5(slab)
[   25.835431] raw: 0200000000000000 ffff888101ab3280 dead000000000122 0000000000000000
[   25.836101] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   25.836419] page dumped because: kasan: bad access detected
[   25.836679] 
[   25.837101] Memory state around the buggy address:
[   25.837301]  ffff888105851f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.837865]  ffff888105851f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.838247] >ffff888105852000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.838589]                    ^
[   25.838764]  ffff888105852080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   25.839356]  ffff888105852100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.839790] ==================================================================