Hay
Date
June 23, 2025, 1:39 p.m.

Environment
qemu-arm64
qemu-x86_64

[   25.756550] ==================================================================
[   25.756837] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   25.757091] Free of addr fff00000c63ef001 by task kunit_try_catch/213
[   25.757358] 
[   25.757471] CPU: 0 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.15.4-rc1 #1 PREEMPT 
[   25.757669] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.757735] Hardware name: linux,dummy-virt (DT)
[   25.757809] Call trace:
[   25.757866]  show_stack+0x20/0x38 (C)
[   25.757997]  dump_stack_lvl+0x8c/0xd0
[   25.758116]  print_report+0x118/0x608
[   25.758227]  kasan_report_invalid_free+0xc0/0xe8
[   25.758340]  check_slab_allocation+0xfc/0x108
[   25.758477]  __kasan_slab_pre_free+0x2c/0x48
[   25.758603]  kmem_cache_free+0xf0/0x468
[   25.758721]  kmem_cache_invalid_free+0x184/0x3c8
[   25.758838]  kunit_try_run_case+0x170/0x3f0
[   25.758963]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.759092]  kthread+0x328/0x630
[   25.759207]  ret_from_fork+0x10/0x20
[   25.759337] 
[   25.759400] Allocated by task 213:
[   25.759473]  kasan_save_stack+0x3c/0x68
[   25.759588]  kasan_save_track+0x20/0x40
[   25.759696]  kasan_save_alloc_info+0x40/0x58
[   25.759806]  __kasan_slab_alloc+0xa8/0xb0
[   25.759970]  kmem_cache_alloc_noprof+0x10c/0x398
[   25.760074]  kmem_cache_invalid_free+0x12c/0x3c8
[   25.760220]  kunit_try_run_case+0x170/0x3f0
[   25.760371]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   25.760571]  kthread+0x328/0x630
[   25.760708]  ret_from_fork+0x10/0x20
[   25.761069] 
[   25.761151] The buggy address belongs to the object at fff00000c63ef000
[   25.761151]  which belongs to the cache test_cache of size 200
[   25.762039] The buggy address is located 1 bytes inside of
[   25.762039]  200-byte region [fff00000c63ef000, fff00000c63ef0c8)
[   25.762209] 
[   25.762270] The buggy address belongs to the physical page:
[   25.762358] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063ef
[   25.762528] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   25.762738] page_type: f5(slab)
[   25.762960] raw: 0bfffe0000000000 fff00000c59ebc80 dead000000000122 0000000000000000
[   25.763084] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   25.763175] page dumped because: kasan: bad access detected
[   25.763247] 
[   25.763285] Memory state around the buggy address:
[   25.763353]  fff00000c63eef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.763630]  fff00000c63eef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.763755] >fff00000c63ef000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   25.763878]                    ^
[   25.763951]  fff00000c63ef080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   25.764054]  fff00000c63ef100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.764144] ==================================================================

[   18.437449] ==================================================================
[   18.438393] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   18.438929] Free of addr ffff88810a083001 by task kunit_try_catch/232
[   18.439434] 
[   18.439725] CPU: 1 UID: 0 PID: 232 Comm: kunit_try_catch Tainted: G    B            N  6.15.4-rc1 #1 PREEMPT(voluntary) 
[   18.439849] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.439884] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   18.439941] Call Trace:
[   18.439979]  <TASK>
[   18.440030]  dump_stack_lvl+0x73/0xb0
[   18.440106]  print_report+0xd1/0x650
[   18.440182]  ? __virt_addr_valid+0x1db/0x2d0
[   18.440261]  ? kasan_complete_mode_report_info+0x2a/0x200
[   18.440332]  ? kmem_cache_invalid_free+0x1d8/0x460
[   18.440399]  kasan_report_invalid_free+0x10a/0x130
[   18.440476]  ? kmem_cache_invalid_free+0x1d8/0x460
[   18.440547]  ? kmem_cache_invalid_free+0x1d8/0x460
[   18.440633]  check_slab_allocation+0x11f/0x130
[   18.440709]  __kasan_slab_pre_free+0x28/0x40
[   18.440761]  kmem_cache_free+0xed/0x420
[   18.440793]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   18.440825]  ? kmem_cache_invalid_free+0x1d8/0x460
[   18.440857]  kmem_cache_invalid_free+0x1d8/0x460
[   18.440885]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   18.440913]  ? finish_task_switch.isra.0+0x153/0x700
[   18.440946]  ? __switch_to+0x5d9/0xf60
[   18.440973]  ? dequeue_task_fair+0x166/0x4e0
[   18.441009]  ? __pfx_read_tsc+0x10/0x10
[   18.441037]  ? ktime_get_ts64+0x86/0x230
[   18.441071]  kunit_try_run_case+0x1a5/0x480
[   18.441107]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.441139]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   18.441172]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   18.441204]  ? __kthread_parkme+0x82/0x180
[   18.441265]  ? preempt_count_sub+0x50/0x80
[   18.441303]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.441338]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.441369]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   18.441401]  kthread+0x337/0x6f0
[   18.441422]  ? trace_preempt_on+0x20/0xc0
[   18.441455]  ? __pfx_kthread+0x10/0x10
[   18.441478]  ? _raw_spin_unlock_irq+0x47/0x80
[   18.441507]  ? calculate_sigpending+0x7b/0xa0
[   18.441537]  ? __pfx_kthread+0x10/0x10
[   18.441560]  ret_from_fork+0x41/0x80
[   18.441589]  ? __pfx_kthread+0x10/0x10
[   18.441638]  ret_from_fork_asm+0x1a/0x30
[   18.441682]  </TASK>
[   18.441696] 
[   18.459450] Allocated by task 232:
[   18.459861]  kasan_save_stack+0x45/0x70
[   18.460346]  kasan_save_track+0x18/0x40
[   18.460763]  kasan_save_alloc_info+0x3b/0x50
[   18.461265]  __kasan_slab_alloc+0x91/0xa0
[   18.461683]  kmem_cache_alloc_noprof+0x123/0x3f0
[   18.462102]  kmem_cache_invalid_free+0x157/0x460
[   18.462564]  kunit_try_run_case+0x1a5/0x480
[   18.462911]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.463380]  kthread+0x337/0x6f0
[   18.463750]  ret_from_fork+0x41/0x80
[   18.464148]  ret_from_fork_asm+0x1a/0x30
[   18.464599] 
[   18.464836] The buggy address belongs to the object at ffff88810a083000
[   18.464836]  which belongs to the cache test_cache of size 200
[   18.465892] The buggy address is located 1 bytes inside of
[   18.465892]  200-byte region [ffff88810a083000, ffff88810a0830c8)
[   18.466644] 
[   18.466879] The buggy address belongs to the physical page:
[   18.467411] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10a083
[   18.468085] flags: 0x200000000000000(node=0|zone=2)
[   18.468636] page_type: f5(slab)
[   18.468960] raw: 0200000000000000 ffff8881016118c0 dead000000000122 0000000000000000
[   18.469650] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.470135] page dumped because: kasan: bad access detected
[   18.470541] 
[   18.470780] Memory state around the buggy address:
[   18.471208]  ffff88810a082f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.471877]  ffff88810a082f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.472552] >ffff88810a083000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.473063]                    ^
[   18.473464]  ffff88810a083080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   18.474126]  ffff88810a083100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.474599] ==================================================================