Hay
Date
July 18, 2025, 1:09 p.m.

Environment
qemu-arm64
qemu-x86_64

[   32.151172] ==================================================================
[   32.151233] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   32.151294] Free of addr fff00000c3ff2001 by task kunit_try_catch/242
[   32.151336] 
[   32.151404] CPU: 0 UID: 0 PID: 242 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT 
[   32.151566] Tainted: [B]=BAD_PAGE, [N]=TEST
[   32.151607] Hardware name: linux,dummy-virt (DT)
[   32.151640] Call trace:
[   32.151683]  show_stack+0x20/0x38 (C)
[   32.151818]  dump_stack_lvl+0x8c/0xd0
[   32.151873]  print_report+0x118/0x5e8
[   32.151937]  kasan_report_invalid_free+0xc0/0xe8
[   32.151985]  check_slab_allocation+0xfc/0x108
[   32.152030]  __kasan_slab_pre_free+0x2c/0x48
[   32.152075]  kmem_cache_free+0xf0/0x468
[   32.152135]  kmem_cache_invalid_free+0x184/0x3c8
[   32.152184]  kunit_try_run_case+0x170/0x3f0
[   32.152440]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.152499]  kthread+0x328/0x630
[   32.152545]  ret_from_fork+0x10/0x20
[   32.152603] 
[   32.152621] Allocated by task 242:
[   32.152651]  kasan_save_stack+0x3c/0x68
[   32.152700]  kasan_save_track+0x20/0x40
[   32.152734]  kasan_save_alloc_info+0x40/0x58
[   32.152771]  __kasan_slab_alloc+0xa8/0xb0
[   32.152805]  kmem_cache_alloc_noprof+0x10c/0x398
[   32.152856]  kmem_cache_invalid_free+0x12c/0x3c8
[   32.152895]  kunit_try_run_case+0x170/0x3f0
[   32.152931]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.152978]  kthread+0x328/0x630
[   32.153021]  ret_from_fork+0x10/0x20
[   32.153055] 
[   32.153073] The buggy address belongs to the object at fff00000c3ff2000
[   32.153073]  which belongs to the cache test_cache of size 200
[   32.153158] The buggy address is located 1 bytes inside of
[   32.153158]  200-byte region [fff00000c3ff2000, fff00000c3ff20c8)
[   32.153226] 
[   32.153266] The buggy address belongs to the physical page:
[   32.153299] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103ff2
[   32.153361] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.153411] page_type: f5(slab)
[   32.153450] raw: 0bfffe0000000000 fff00000c4743640 dead000000000122 0000000000000000
[   32.153516] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   32.153566] page dumped because: kasan: bad access detected
[   32.153612] 
[   32.153631] Memory state around the buggy address:
[   32.153667]  fff00000c3ff1f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.153721]  fff00000c3ff1f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   32.153764] >fff00000c3ff2000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   32.153802]                    ^
[   32.153828]  fff00000c3ff2080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   32.153870]  fff00000c3ff2100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.153908] ==================================================================


[   25.587707] ==================================================================
[   25.588289] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   25.588920] Free of addr ffff8881053be001 by task kunit_try_catch/259
[   25.589209] 
[   25.589383] CPU: 0 UID: 0 PID: 259 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6-next-20250718 #1 PREEMPT(voluntary) 
[   25.589665] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.589678] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.589702] Call Trace:
[   25.589717]  <TASK>
[   25.589735]  dump_stack_lvl+0x73/0xb0
[   25.589983]  print_report+0xd1/0x640
[   25.590008]  ? __virt_addr_valid+0x1db/0x2d0
[   25.590036]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.590061]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.590085]  kasan_report_invalid_free+0x10a/0x130
[   25.590109]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.590134]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.590157]  check_slab_allocation+0x11f/0x130
[   25.590178]  __kasan_slab_pre_free+0x28/0x40
[   25.590197]  kmem_cache_free+0xed/0x420
[   25.590217]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   25.590255]  ? kmem_cache_invalid_free+0x1d8/0x460
[   25.590280]  kmem_cache_invalid_free+0x1d8/0x460
[   25.590304]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   25.590326]  ? finish_task_switch.isra.0+0x153/0x700
[   25.590347]  ? __switch_to+0x47/0xf80
[   25.590376]  ? __pfx_read_tsc+0x10/0x10
[   25.590398]  ? ktime_get_ts64+0x86/0x230
[   25.590423]  kunit_try_run_case+0x1a5/0x480
[   25.590448]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.590469]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.590503]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.590535]  ? __kthread_parkme+0x82/0x180
[   25.590554]  ? preempt_count_sub+0x50/0x80
[   25.590575]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.590598]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.590621]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.590650]  kthread+0x337/0x6f0
[   25.590672]  ? trace_preempt_on+0x20/0xc0
[   25.590696]  ? __pfx_kthread+0x10/0x10
[   25.590715]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.590745]  ? calculate_sigpending+0x7b/0xa0
[   25.590769]  ? __pfx_kthread+0x10/0x10
[   25.590789]  ret_from_fork+0x116/0x1d0
[   25.590808]  ? __pfx_kthread+0x10/0x10
[   25.590827]  ret_from_fork_asm+0x1a/0x30
[   25.590873]  </TASK>
[   25.590884] 
[   25.602389] Allocated by task 259:
[   25.602556]  kasan_save_stack+0x45/0x70
[   25.602749]  kasan_save_track+0x18/0x40
[   25.602916]  kasan_save_alloc_info+0x3b/0x50
[   25.603099]  __kasan_slab_alloc+0x91/0xa0
[   25.603990]  kmem_cache_alloc_noprof+0x123/0x3f0
[   25.604360]  kmem_cache_invalid_free+0x157/0x460
[   25.604765]  kunit_try_run_case+0x1a5/0x480
[   25.605196]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.605585]  kthread+0x337/0x6f0
[   25.605941]  ret_from_fork+0x116/0x1d0
[   25.606252]  ret_from_fork_asm+0x1a/0x30
[   25.606555] 
[   25.606791] The buggy address belongs to the object at ffff8881053be000
[   25.606791]  which belongs to the cache test_cache of size 200
[   25.607497] The buggy address is located 1 bytes inside of
[   25.607497]  200-byte region [ffff8881053be000, ffff8881053be0c8)
[   25.608483] 
[   25.608718] The buggy address belongs to the physical page:
[   25.609297] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1053be
[   25.609899] flags: 0x200000000000000(node=0|zone=2)
[   25.610385] page_type: f5(slab)
[   25.610691] raw: 0200000000000000 ffff888100a0b500 dead000000000122 0000000000000000
[   25.611268] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   25.611568] page dumped because: kasan: bad access detected
[   25.611784] 
[   25.611863] Memory state around the buggy address:
[   25.612065]  ffff8881053bdf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.612868]  ffff8881053bdf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.613552] >ffff8881053be000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.614436]                    ^
[   25.614764]  ffff8881053be080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   25.615088]  ffff8881053be100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.615397] ==================================================================