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

Environment
qemu-arm64
qemu-x86_64

[   20.193996] ==================================================================
[   20.194142] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   20.194316] Free of addr fff00000c59ad001 by task kunit_try_catch/212
[   20.194433] 
[   20.194627] CPU: 0 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT 
[   20.195183] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.195318] Hardware name: linux,dummy-virt (DT)
[   20.195563] Call trace:
[   20.195644]  show_stack+0x20/0x38 (C)
[   20.195782]  dump_stack_lvl+0x8c/0xd0
[   20.195915]  print_report+0x118/0x608
[   20.196311]  kasan_report_invalid_free+0xc0/0xe8
[   20.196483]  check_slab_allocation+0xfc/0x108
[   20.196599]  __kasan_slab_pre_free+0x2c/0x48
[   20.196716]  kmem_cache_free+0xf0/0x468
[   20.197326]  kmem_cache_invalid_free+0x184/0x3c8
[   20.197565]  kunit_try_run_case+0x170/0x3f0
[   20.197848]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.198013]  kthread+0x328/0x630
[   20.198124]  ret_from_fork+0x10/0x20
[   20.198227] 
[   20.198267] Allocated by task 212:
[   20.198354]  kasan_save_stack+0x3c/0x68
[   20.198447]  kasan_save_track+0x20/0x40
[   20.198612]  kasan_save_alloc_info+0x40/0x58
[   20.198754]  __kasan_slab_alloc+0xa8/0xb0
[   20.198859]  kmem_cache_alloc_noprof+0x10c/0x398
[   20.198962]  kmem_cache_invalid_free+0x12c/0x3c8
[   20.199097]  kunit_try_run_case+0x170/0x3f0
[   20.199190]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.199322]  kthread+0x328/0x630
[   20.199409]  ret_from_fork+0x10/0x20
[   20.199500] 
[   20.199543] The buggy address belongs to the object at fff00000c59ad000
[   20.199543]  which belongs to the cache test_cache of size 200
[   20.199735] The buggy address is located 1 bytes inside of
[   20.199735]  200-byte region [fff00000c59ad000, fff00000c59ad0c8)
[   20.199889] 
[   20.199960] The buggy address belongs to the physical page:
[   20.200071] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059ad
[   20.200245] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.200365] page_type: f5(slab)
[   20.200452] raw: 0bfffe0000000000 fff00000c58018c0 dead000000000122 0000000000000000
[   20.200576] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   20.200708] page dumped because: kasan: bad access detected
[   20.200808] 
[   20.200860] Memory state around the buggy address:
[   20.200925]  fff00000c59acf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.201120]  fff00000c59acf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.201262] >fff00000c59ad000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.201361]                    ^
[   20.201427]  fff00000c59ad080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   20.201575]  fff00000c59ad100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.201671] ==================================================================

[   13.343957] ==================================================================
[   13.344484] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.344795] Free of addr ffff888102667001 by task kunit_try_catch/229
[   13.345166] 
[   13.345263] CPU: 1 UID: 0 PID: 229 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5 #1 PREEMPT(voluntary) 
[   13.345306] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.345316] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.345336] Call Trace:
[   13.345349]  <TASK>
[   13.345366]  dump_stack_lvl+0x73/0xb0
[   13.345396]  print_report+0xd1/0x650
[   13.345418]  ? __virt_addr_valid+0x1db/0x2d0
[   13.345443]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.345465]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.345491]  kasan_report_invalid_free+0x10a/0x130
[   13.345515]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.345541]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.345567]  check_slab_allocation+0x11f/0x130
[   13.345589]  __kasan_slab_pre_free+0x28/0x40
[   13.345609]  kmem_cache_free+0xed/0x420
[   13.345629]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.345659]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.345687]  kmem_cache_invalid_free+0x1d8/0x460
[   13.345711]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.345736]  ? finish_task_switch.isra.0+0x153/0x700
[   13.345771]  ? __switch_to+0x47/0xf50
[   13.345800]  ? __pfx_read_tsc+0x10/0x10
[   13.345821]  ? ktime_get_ts64+0x86/0x230
[   13.345844]  kunit_try_run_case+0x1a5/0x480
[   13.345869]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.345892]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.345916]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.345940]  ? __kthread_parkme+0x82/0x180
[   13.345960]  ? preempt_count_sub+0x50/0x80
[   13.345982]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.346006]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.346030]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.346055]  kthread+0x337/0x6f0
[   13.346073]  ? trace_preempt_on+0x20/0xc0
[   13.346097]  ? __pfx_kthread+0x10/0x10
[   13.346117]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.346139]  ? calculate_sigpending+0x7b/0xa0
[   13.346162]  ? __pfx_kthread+0x10/0x10
[   13.346183]  ret_from_fork+0x116/0x1d0
[   13.346202]  ? __pfx_kthread+0x10/0x10
[   13.346222]  ret_from_fork_asm+0x1a/0x30
[   13.346252]  </TASK>
[   13.346262] 
[   13.357938] Allocated by task 229:
[   13.358110]  kasan_save_stack+0x45/0x70
[   13.358309]  kasan_save_track+0x18/0x40
[   13.358463]  kasan_save_alloc_info+0x3b/0x50
[   13.358667]  __kasan_slab_alloc+0x91/0xa0
[   13.358818]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.359133]  kmem_cache_invalid_free+0x157/0x460
[   13.359343]  kunit_try_run_case+0x1a5/0x480
[   13.359489]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.359711]  kthread+0x337/0x6f0
[   13.359897]  ret_from_fork+0x116/0x1d0
[   13.360085]  ret_from_fork_asm+0x1a/0x30
[   13.360273] 
[   13.360358] The buggy address belongs to the object at ffff888102667000
[   13.360358]  which belongs to the cache test_cache of size 200
[   13.360739] The buggy address is located 1 bytes inside of
[   13.360739]  200-byte region [ffff888102667000, ffff8881026670c8)
[   13.361368] 
[   13.361465] The buggy address belongs to the physical page:
[   13.361665] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102667
[   13.361914] flags: 0x200000000000000(node=0|zone=2)
[   13.362304] page_type: f5(slab)
[   13.362478] raw: 0200000000000000 ffff8881010208c0 dead000000000122 0000000000000000
[   13.362854] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.363180] page dumped because: kasan: bad access detected
[   13.363350] 
[   13.363419] Memory state around the buggy address:
[   13.363571]  ffff888102666f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.364211]  ffff888102666f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.364510] >ffff888102667000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.364794]                    ^
[   13.365025]  ffff888102667080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.365246]  ffff888102667100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.365555] ==================================================================