Hay
Date
May 13, 2025, 12:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   20.049194] ==================================================================
[   20.049406] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   20.049545] Free of addr fff00000c6617001 by task kunit_try_catch/211
[   20.049600] 
[   20.049654] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250513 #1 PREEMPT 
[   20.049759] Tainted: [B]=BAD_PAGE, [N]=TEST
[   20.049790] Hardware name: linux,dummy-virt (DT)
[   20.049868] Call trace:
[   20.049899]  show_stack+0x20/0x38 (C)
[   20.050007]  dump_stack_lvl+0x8c/0xd0
[   20.050070]  print_report+0x118/0x608
[   20.050179]  kasan_report_invalid_free+0xc0/0xe8
[   20.050293]  check_slab_allocation+0xfc/0x108
[   20.050349]  __kasan_slab_pre_free+0x2c/0x48
[   20.050442]  kmem_cache_free+0xf0/0x470
[   20.050538]  kmem_cache_invalid_free+0x184/0x3c8
[   20.050595]  kunit_try_run_case+0x170/0x3f0
[   20.050652]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.050713]  kthread+0x328/0x630
[   20.050782]  ret_from_fork+0x10/0x20
[   20.050900] 
[   20.051024] Allocated by task 211:
[   20.051063]  kasan_save_stack+0x3c/0x68
[   20.051272]  kasan_save_track+0x20/0x40
[   20.051327]  kasan_save_alloc_info+0x40/0x58
[   20.051596]  __kasan_slab_alloc+0xa8/0xb0
[   20.051659]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   20.051967]  kmem_cache_invalid_free+0x12c/0x3c8
[   20.052261]  kunit_try_run_case+0x170/0x3f0
[   20.052326]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   20.052449]  kthread+0x328/0x630
[   20.052827]  ret_from_fork+0x10/0x20
[   20.052886] 
[   20.052912] The buggy address belongs to the object at fff00000c6617000
[   20.052912]  which belongs to the cache test_cache of size 200
[   20.052999] The buggy address is located 1 bytes inside of
[   20.052999]  200-byte region [fff00000c6617000, fff00000c66170c8)
[   20.053065] 
[   20.053433] The buggy address belongs to the physical page:
[   20.053527] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106617
[   20.053745] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   20.053907] page_type: f5(slab)
[   20.054296] raw: 0bfffe0000000000 fff00000c1806dc0 dead000000000122 0000000000000000
[   20.054569] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   20.054634] page dumped because: kasan: bad access detected
[   20.054770] 
[   20.054977] Memory state around the buggy address:
[   20.055033]  fff00000c6616f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.055157]  fff00000c6616f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.055296] >fff00000c6617000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   20.055511]                    ^
[   20.055752]  fff00000c6617080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   20.056004]  fff00000c6617100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   20.056187] ==================================================================

[   11.837095] ==================================================================
[   11.838147] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   11.839630] Free of addr ffff8881039dd001 by task kunit_try_catch/228
[   11.839844] 
[   11.839942] CPU: 1 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250513 #1 PREEMPT(voluntary) 
[   11.839994] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.840006] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.840028] Call Trace:
[   11.840042]  <TASK>
[   11.840061]  dump_stack_lvl+0x73/0xb0
[   11.840091]  print_report+0xd1/0x650
[   11.840114]  ? __virt_addr_valid+0x1db/0x2d0
[   11.840140]  ? kasan_complete_mode_report_info+0x2a/0x200
[   11.840170]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.840191]  kasan_report_invalid_free+0x10a/0x130
[   11.840217]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.840240]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.840260]  check_slab_allocation+0x11f/0x130
[   11.840282]  __kasan_slab_pre_free+0x28/0x40
[   11.840304]  kmem_cache_free+0xed/0x420
[   11.840324]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   11.840345]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.840368]  kmem_cache_invalid_free+0x1d8/0x460
[   11.840388]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   11.840408]  ? finish_task_switch.isra.0+0x153/0x700
[   11.840431]  ? __switch_to+0x47/0xf50
[   11.840461]  ? __pfx_read_tsc+0x10/0x10
[   11.840481]  ? ktime_get_ts64+0x86/0x230
[   11.840507]  kunit_try_run_case+0x1a5/0x480
[   11.840531]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.840552]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.840575]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.840597]  ? __kthread_parkme+0x82/0x180
[   11.840625]  ? preempt_count_sub+0x50/0x80
[   11.840648]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.840671]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.840694]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.840716]  kthread+0x337/0x6f0
[   11.840735]  ? trace_preempt_on+0x20/0xc0
[   11.840760]  ? __pfx_kthread+0x10/0x10
[   11.840780]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.840800]  ? calculate_sigpending+0x7b/0xa0
[   11.840825]  ? __pfx_kthread+0x10/0x10
[   11.840846]  ret_from_fork+0x116/0x1d0
[   11.840863]  ? __pfx_kthread+0x10/0x10
[   11.841093]  ret_from_fork_asm+0x1a/0x30
[   11.841128]  </TASK>
[   11.841140] 
[   11.855689] Allocated by task 228:
[   11.856000]  kasan_save_stack+0x45/0x70
[   11.856234]  kasan_save_track+0x18/0x40
[   11.856631]  kasan_save_alloc_info+0x3b/0x50
[   11.856782]  __kasan_slab_alloc+0x91/0xa0
[   11.856921]  kmem_cache_alloc_noprof+0x123/0x3f0
[   11.857074]  kmem_cache_invalid_free+0x157/0x460
[   11.857296]  kunit_try_run_case+0x1a5/0x480
[   11.857777]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.858295]  kthread+0x337/0x6f0
[   11.858816]  ret_from_fork+0x116/0x1d0
[   11.859197]  ret_from_fork_asm+0x1a/0x30
[   11.859665] 
[   11.859836] The buggy address belongs to the object at ffff8881039dd000
[   11.859836]  which belongs to the cache test_cache of size 200
[   11.860817] The buggy address is located 1 bytes inside of
[   11.860817]  200-byte region [ffff8881039dd000, ffff8881039dd0c8)
[   11.861315] 
[   11.861495] The buggy address belongs to the physical page:
[   11.862061] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1039dd
[   11.862559] flags: 0x200000000000000(node=0|zone=2)
[   11.863030] page_type: f5(slab)
[   11.863331] raw: 0200000000000000 ffff888100faf500 dead000000000122 0000000000000000
[   11.863949] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   11.864185] page dumped because: kasan: bad access detected
[   11.864357] 
[   11.864437] Memory state around the buggy address:
[   11.864593]  ffff8881039dcf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.864815]  ffff8881039dcf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.865029] >ffff8881039dd000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.865239]                    ^
[   11.865353]  ffff8881039dd080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   11.865563]  ffff8881039dd100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.866134] ==================================================================