Hay
Date
May 26, 2025, 9:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.445580] ==================================================================
[   18.445749] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   18.445892] Free of addr fff00000c794d001 by task kunit_try_catch/211
[   18.445980] 
[   18.446512] CPU: 0 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT 
[   18.446837] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.446926] Hardware name: linux,dummy-virt (DT)
[   18.447043] Call trace:
[   18.447102]  show_stack+0x20/0x38 (C)
[   18.447209]  dump_stack_lvl+0x8c/0xd0
[   18.447304]  print_report+0x118/0x608
[   18.447438]  kasan_report_invalid_free+0xc0/0xe8
[   18.447532]  check_slab_allocation+0xfc/0x108
[   18.447732]  __kasan_slab_pre_free+0x2c/0x48
[   18.448060]  kmem_cache_free+0xf0/0x470
[   18.448225]  kmem_cache_invalid_free+0x184/0x3c8
[   18.448399]  kunit_try_run_case+0x170/0x3f0
[   18.448534]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.448658]  kthread+0x328/0x630
[   18.448745]  ret_from_fork+0x10/0x20
[   18.448873] 
[   18.448938] Allocated by task 211:
[   18.449036]  kasan_save_stack+0x3c/0x68
[   18.449170]  kasan_save_track+0x20/0x40
[   18.449279]  kasan_save_alloc_info+0x40/0x58
[   18.449386]  __kasan_slab_alloc+0xa8/0xb0
[   18.449474]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   18.449591]  kmem_cache_invalid_free+0x12c/0x3c8
[   18.449716]  kunit_try_run_case+0x170/0x3f0
[   18.449801]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.449933]  kthread+0x328/0x630
[   18.450033]  ret_from_fork+0x10/0x20
[   18.450139] 
[   18.450200] The buggy address belongs to the object at fff00000c794d000
[   18.450200]  which belongs to the cache test_cache of size 200
[   18.450365] The buggy address is located 1 bytes inside of
[   18.450365]  200-byte region [fff00000c794d000, fff00000c794d0c8)
[   18.450483] 
[   18.450528] The buggy address belongs to the physical page:
[   18.450604] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10794d
[   18.450823] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.450935] page_type: f5(slab)
[   18.451025] raw: 0bfffe0000000000 fff00000c794a000 dead000000000122 0000000000000000
[   18.451119] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.451200] page dumped because: kasan: bad access detected
[   18.451261] 
[   18.451299] Memory state around the buggy address:
[   18.451390]  fff00000c794cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.451498]  fff00000c794cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.451582] >fff00000c794d000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.451651]                    ^
[   18.451696]  fff00000c794d080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   18.451759]  fff00000c794d100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.451835] ==================================================================


[   11.712552] ==================================================================
[   11.714044] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   11.714806] Free of addr ffff888102a93001 by task kunit_try_catch/229
[   11.715830] 
[   11.716149] CPU: 1 UID: 0 PID: 229 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7-next-20250526 #1 PREEMPT(voluntary) 
[   11.716200] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.716212] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.716235] Call Trace:
[   11.716248]  <TASK>
[   11.716265]  dump_stack_lvl+0x73/0xb0
[   11.716293]  print_report+0xd1/0x650
[   11.716316]  ? __virt_addr_valid+0x1db/0x2d0
[   11.716341]  ? kasan_complete_mode_report_info+0x2a/0x200
[   11.716363]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.716399]  kasan_report_invalid_free+0x10a/0x130
[   11.716423]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.716479]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.716500]  check_slab_allocation+0x11f/0x130
[   11.716521]  __kasan_slab_pre_free+0x28/0x40
[   11.716542]  kmem_cache_free+0xed/0x420
[   11.716562]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   11.716582]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.716605]  kmem_cache_invalid_free+0x1d8/0x460
[   11.716626]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   11.716645]  ? finish_task_switch.isra.0+0x153/0x700
[   11.716667]  ? __switch_to+0x47/0xf50
[   11.716696]  ? __pfx_read_tsc+0x10/0x10
[   11.716727]  ? ktime_get_ts64+0x86/0x230
[   11.716752]  kunit_try_run_case+0x1a5/0x480
[   11.716773]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.716792]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.716817]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.716842]  ? __kthread_parkme+0x82/0x180
[   11.716862]  ? preempt_count_sub+0x50/0x80
[   11.716884]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.716904]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.716927]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.716951]  kthread+0x337/0x6f0
[   11.716970]  ? trace_preempt_on+0x20/0xc0
[   11.716992]  ? __pfx_kthread+0x10/0x10
[   11.717079]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.717103]  ? calculate_sigpending+0x7b/0xa0
[   11.717127]  ? __pfx_kthread+0x10/0x10
[   11.717149]  ret_from_fork+0x116/0x1d0
[   11.717167]  ? __pfx_kthread+0x10/0x10
[   11.717188]  ret_from_fork_asm+0x1a/0x30
[   11.717218]  </TASK>
[   11.717229] 
[   11.730631] Allocated by task 229:
[   11.730922]  kasan_save_stack+0x45/0x70
[   11.731309]  kasan_save_track+0x18/0x40
[   11.731615]  kasan_save_alloc_info+0x3b/0x50
[   11.731768]  __kasan_slab_alloc+0x91/0xa0
[   11.731904]  kmem_cache_alloc_noprof+0x123/0x3f0
[   11.732053]  kmem_cache_invalid_free+0x157/0x460
[   11.732652]  kunit_try_run_case+0x1a5/0x480
[   11.732875]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.733278]  kthread+0x337/0x6f0
[   11.733425]  ret_from_fork+0x116/0x1d0
[   11.733579]  ret_from_fork_asm+0x1a/0x30
[   11.733854] 
[   11.733994] The buggy address belongs to the object at ffff888102a93000
[   11.733994]  which belongs to the cache test_cache of size 200
[   11.734618] The buggy address is located 1 bytes inside of
[   11.734618]  200-byte region [ffff888102a93000, ffff888102a930c8)
[   11.735250] 
[   11.735421] The buggy address belongs to the physical page:
[   11.735704] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a93
[   11.736210] flags: 0x200000000000000(node=0|zone=2)
[   11.736497] page_type: f5(slab)
[   11.736688] raw: 0200000000000000 ffff8881017ca280 dead000000000122 0000000000000000
[   11.737200] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   11.737542] page dumped because: kasan: bad access detected
[   11.737833] 
[   11.737928] Memory state around the buggy address:
[   11.738233]  ffff888102a92f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.738610]  ffff888102a92f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.738912] >ffff888102a93000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.739339]                    ^
[   11.739573]  ffff888102a93080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   11.740066]  ffff888102a93100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.740315] ==================================================================