Hay
Date
June 5, 2025, 7:08 a.m.

Environment
qemu-arm64
qemu-x86_64

[   26.350565] ==================================================================
[   26.350701] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   26.350842] Free of addr fff00000c7761001 by task kunit_try_catch/211
[   26.350946] 
[   26.351023] CPU: 0 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT 
[   26.353585] Tainted: [B]=BAD_PAGE, [N]=TEST
[   26.354120] Hardware name: linux,dummy-virt (DT)
[   26.354240] Call trace:
[   26.354313]  show_stack+0x20/0x38 (C)
[   26.354467]  dump_stack_lvl+0x8c/0xd0
[   26.355156]  print_report+0x118/0x608
[   26.355917]  kasan_report_invalid_free+0xc0/0xe8
[   26.356214]  check_slab_allocation+0xfc/0x108
[   26.356489]  __kasan_slab_pre_free+0x2c/0x48
[   26.356664]  kmem_cache_free+0xf0/0x468
[   26.356904]  kmem_cache_invalid_free+0x184/0x3c8
[   26.357173]  kunit_try_run_case+0x170/0x3f0
[   26.357553]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.357940]  kthread+0x328/0x630
[   26.358093]  ret_from_fork+0x10/0x20
[   26.358235] 
[   26.358430] Allocated by task 211:
[   26.358516]  kasan_save_stack+0x3c/0x68
[   26.358745]  kasan_save_track+0x20/0x40
[   26.358875]  kasan_save_alloc_info+0x40/0x58
[   26.359102]  __kasan_slab_alloc+0xa8/0xb0
[   26.359229]  kmem_cache_alloc_noprof+0x10c/0x398
[   26.359370]  kmem_cache_invalid_free+0x12c/0x3c8
[   26.359671]  kunit_try_run_case+0x170/0x3f0
[   26.359787]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   26.359928]  kthread+0x328/0x630
[   26.360655]  ret_from_fork+0x10/0x20
[   26.360796] 
[   26.360847] The buggy address belongs to the object at fff00000c7761000
[   26.360847]  which belongs to the cache test_cache of size 200
[   26.360995] The buggy address is located 1 bytes inside of
[   26.360995]  200-byte region [fff00000c7761000, fff00000c77610c8)
[   26.361370] 
[   26.362115] The buggy address belongs to the physical page:
[   26.362222] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x107761
[   26.362427] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   26.362667] page_type: f5(slab)
[   26.362984] raw: 0bfffe0000000000 fff00000ffeb0f00 dead000000000122 0000000000000000
[   26.363131] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   26.363324] page dumped because: kasan: bad access detected
[   26.363464] 
[   26.363541] Memory state around the buggy address:
[   26.363640]  fff00000c7760f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.363757]  fff00000c7760f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   26.363866] >fff00000c7761000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   26.364116]                    ^
[   26.364193]  fff00000c7761080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   26.364297]  fff00000c7761100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.364640] ==================================================================


[   12.135758] ==================================================================
[   12.136875] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   12.137120] Free of addr ffff888102787001 by task kunit_try_catch/228
[   12.137318] 
[   12.137427] CPU: 1 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250605 #1 PREEMPT(voluntary) 
[   12.137471] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.137482] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.137502] Call Trace:
[   12.137513]  <TASK>
[   12.137528]  dump_stack_lvl+0x73/0xb0
[   12.137553]  print_report+0xd1/0x650
[   12.137574]  ? __virt_addr_valid+0x1db/0x2d0
[   12.137598]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.137619]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.137644]  kasan_report_invalid_free+0x10a/0x130
[   12.137668]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.137737]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.137761]  check_slab_allocation+0x11f/0x130
[   12.137795]  __kasan_slab_pre_free+0x28/0x40
[   12.137815]  kmem_cache_free+0xed/0x420
[   12.137835]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   12.137856]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.137884]  kmem_cache_invalid_free+0x1d8/0x460
[   12.137917]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   12.137941]  ? finish_task_switch.isra.0+0x153/0x700
[   12.137963]  ? __switch_to+0x47/0xf50
[   12.137990]  ? __pfx_read_tsc+0x10/0x10
[   12.138011]  ? ktime_get_ts64+0x86/0x230
[   12.138071]  kunit_try_run_case+0x1a5/0x480
[   12.138119]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.138160]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.138187]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.138211]  ? __kthread_parkme+0x82/0x180
[   12.138230]  ? preempt_count_sub+0x50/0x80
[   12.138252]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.138273]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.138297]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.138320]  kthread+0x337/0x6f0
[   12.138339]  ? trace_preempt_on+0x20/0xc0
[   12.138362]  ? __pfx_kthread+0x10/0x10
[   12.138382]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.138403]  ? calculate_sigpending+0x7b/0xa0
[   12.138427]  ? __pfx_kthread+0x10/0x10
[   12.138448]  ret_from_fork+0x116/0x1d0
[   12.138465]  ? __pfx_kthread+0x10/0x10
[   12.138485]  ret_from_fork_asm+0x1a/0x30
[   12.138515]  </TASK>
[   12.138525] 
[   12.155811] Allocated by task 228:
[   12.156289]  kasan_save_stack+0x45/0x70
[   12.156474]  kasan_save_track+0x18/0x40
[   12.156610]  kasan_save_alloc_info+0x3b/0x50
[   12.157159]  __kasan_slab_alloc+0x91/0xa0
[   12.157575]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.158123]  kmem_cache_invalid_free+0x157/0x460
[   12.158286]  kunit_try_run_case+0x1a5/0x480
[   12.158429]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.158604]  kthread+0x337/0x6f0
[   12.158960]  ret_from_fork+0x116/0x1d0
[   12.159562]  ret_from_fork_asm+0x1a/0x30
[   12.160130] 
[   12.160344] The buggy address belongs to the object at ffff888102787000
[   12.160344]  which belongs to the cache test_cache of size 200
[   12.161656] The buggy address is located 1 bytes inside of
[   12.161656]  200-byte region [ffff888102787000, ffff8881027870c8)
[   12.162274] 
[   12.162443] The buggy address belongs to the physical page:
[   12.163054] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102787
[   12.163536] flags: 0x200000000000000(node=0|zone=2)
[   12.163925] page_type: f5(slab)
[   12.164448] raw: 0200000000000000 ffff8881018ce140 dead000000000122 0000000000000000
[   12.165263] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.165583] page dumped because: kasan: bad access detected
[   12.166145] 
[   12.166380] Memory state around the buggy address:
[   12.166923]  ffff888102786f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.167385]  ffff888102786f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.167609] >ffff888102787000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.168329]                    ^
[   12.168740]  ffff888102787080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   12.169466]  ffff888102787100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.169881] ==================================================================