Hay
Date
July 5, 2025, 11:11 p.m.

Environment
qemu-arm64
qemu-x86_64

[   18.867354] ==================================================================
[   18.867425] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   18.867499] Free of addr fff00000c7847001 by task kunit_try_catch/211
[   18.867543] 
[   18.867582] CPU: 0 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.867664] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.867728] Hardware name: linux,dummy-virt (DT)
[   18.868004] Call trace:
[   18.868074]  show_stack+0x20/0x38 (C)
[   18.868266]  dump_stack_lvl+0x8c/0xd0
[   18.868339]  print_report+0x118/0x608
[   18.868437]  kasan_report_invalid_free+0xc0/0xe8
[   18.868529]  check_slab_allocation+0xfc/0x108
[   18.868576]  __kasan_slab_pre_free+0x2c/0x48
[   18.868623]  kmem_cache_free+0xf0/0x468
[   18.868670]  kmem_cache_invalid_free+0x184/0x3c8
[   18.868717]  kunit_try_run_case+0x170/0x3f0
[   18.868766]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.868851]  kthread+0x328/0x630
[   18.868895]  ret_from_fork+0x10/0x20
[   18.868989] 
[   18.869008] Allocated by task 211:
[   18.869094]  kasan_save_stack+0x3c/0x68
[   18.869207]  kasan_save_track+0x20/0x40
[   18.869304]  kasan_save_alloc_info+0x40/0x58
[   18.869407]  __kasan_slab_alloc+0xa8/0xb0
[   18.869482]  kmem_cache_alloc_noprof+0x10c/0x398
[   18.869522]  kmem_cache_invalid_free+0x12c/0x3c8
[   18.869785]  kunit_try_run_case+0x170/0x3f0
[   18.869868]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.869975]  kthread+0x328/0x630
[   18.870128]  ret_from_fork+0x10/0x20
[   18.870258] 
[   18.870296] The buggy address belongs to the object at fff00000c7847000
[   18.870296]  which belongs to the cache test_cache of size 200
[   18.870479] The buggy address is located 1 bytes inside of
[   18.870479]  200-byte region [fff00000c7847000, fff00000c78470c8)
[   18.870637] 
[   18.870732] The buggy address belongs to the physical page:
[   18.870842] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107847
[   18.871059] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.871160] page_type: f5(slab)
[   18.871220] raw: 0bfffe0000000000 fff00000c595ddc0 dead000000000122 0000000000000000
[   18.871591] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.871677] page dumped because: kasan: bad access detected
[   18.871815] 
[   18.871942] Memory state around the buggy address:
[   18.872075]  fff00000c7846f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.872120]  fff00000c7846f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.872180] >fff00000c7847000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.872222]                    ^
[   18.872249]  fff00000c7847080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   18.872533]  fff00000c7847100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.872649] ==================================================================

[   14.411655] ==================================================================
[   14.412361] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   14.412740] Free of addr ffff888102a05001 by task kunit_try_catch/229
[   14.413100] 
[   14.413287] CPU: 1 UID: 0 PID: 229 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   14.413349] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.413363] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.413388] Call Trace:
[   14.413404]  <TASK>
[   14.413425]  dump_stack_lvl+0x73/0xb0
[   14.413462]  print_report+0xd1/0x650
[   14.413488]  ? __virt_addr_valid+0x1db/0x2d0
[   14.413517]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.413541]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.413571]  kasan_report_invalid_free+0x10a/0x130
[   14.413598]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.413630]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.413658]  check_slab_allocation+0x11f/0x130
[   14.413684]  __kasan_slab_pre_free+0x28/0x40
[   14.413707]  kmem_cache_free+0xed/0x420
[   14.413731]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   14.413753]  ? kmem_cache_invalid_free+0x1d8/0x460
[   14.413784]  kmem_cache_invalid_free+0x1d8/0x460
[   14.413824]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   14.413850]  ? sysvec_apic_timer_interrupt+0x50/0x90
[   14.413884]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   14.413916]  kunit_try_run_case+0x1a5/0x480
[   14.413945]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.413971]  ? queued_spin_lock_slowpath+0x116/0xb40
[   14.413999]  ? __kthread_parkme+0x82/0x180
[   14.414023]  ? preempt_count_sub+0x50/0x80
[   14.414050]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.414099]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.414310]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.414344]  kthread+0x337/0x6f0
[   14.414367]  ? trace_preempt_on+0x20/0xc0
[   14.414395]  ? __pfx_kthread+0x10/0x10
[   14.414419]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.414445]  ? calculate_sigpending+0x7b/0xa0
[   14.414472]  ? __pfx_kthread+0x10/0x10
[   14.414496]  ret_from_fork+0x116/0x1d0
[   14.414519]  ? __pfx_kthread+0x10/0x10
[   14.414542]  ret_from_fork_asm+0x1a/0x30
[   14.414578]  </TASK>
[   14.414594] 
[   14.431307] Allocated by task 229:
[   14.431848]  kasan_save_stack+0x45/0x70
[   14.432405]  kasan_save_track+0x18/0x40
[   14.432779]  kasan_save_alloc_info+0x3b/0x50
[   14.432969]  __kasan_slab_alloc+0x91/0xa0
[   14.433204]  kmem_cache_alloc_noprof+0x123/0x3f0
[   14.433858]  kmem_cache_invalid_free+0x157/0x460
[   14.434454]  kunit_try_run_case+0x1a5/0x480
[   14.434920]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.435578]  kthread+0x337/0x6f0
[   14.435734]  ret_from_fork+0x116/0x1d0
[   14.435906]  ret_from_fork_asm+0x1a/0x30
[   14.436068] 
[   14.436184] The buggy address belongs to the object at ffff888102a05000
[   14.436184]  which belongs to the cache test_cache of size 200
[   14.437033] The buggy address is located 1 bytes inside of
[   14.437033]  200-byte region [ffff888102a05000, ffff888102a050c8)
[   14.438039] 
[   14.438276] The buggy address belongs to the physical page:
[   14.438710] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a05
[   14.439568] flags: 0x200000000000000(node=0|zone=2)
[   14.439971] page_type: f5(slab)
[   14.440177] raw: 0200000000000000 ffff888101a64b40 dead000000000122 0000000000000000
[   14.440802] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   14.441508] page dumped because: kasan: bad access detected
[   14.441926] 
[   14.442066] Memory state around the buggy address:
[   14.442827]  ffff888102a04f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.443180]  ffff888102a04f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.443651] >ffff888102a05000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   14.444021]                    ^
[   14.444643]  ffff888102a05080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   14.445140]  ffff888102a05100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.445833] ==================================================================