Hay
Date
July 6, 2025, 11:09 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.847280] ==================================================================
[   18.847342] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   18.847414] Free of addr fff00000c56f5001 by task kunit_try_catch/211
[   18.847538] 
[   18.847583] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT 
[   18.847682] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.848000] Hardware name: linux,dummy-virt (DT)
[   18.848105] Call trace:
[   18.848175]  show_stack+0x20/0x38 (C)
[   18.848261]  dump_stack_lvl+0x8c/0xd0
[   18.848377]  print_report+0x118/0x608
[   18.848452]  kasan_report_invalid_free+0xc0/0xe8
[   18.848507]  check_slab_allocation+0xfc/0x108
[   18.848620]  __kasan_slab_pre_free+0x2c/0x48
[   18.848685]  kmem_cache_free+0xf0/0x468
[   18.848735]  kmem_cache_invalid_free+0x184/0x3c8
[   18.848808]  kunit_try_run_case+0x170/0x3f0
[   18.848883]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.848937]  kthread+0x328/0x630
[   18.848999]  ret_from_fork+0x10/0x20
[   18.849275] 
[   18.849325] Allocated by task 211:
[   18.849385]  kasan_save_stack+0x3c/0x68
[   18.849430]  kasan_save_track+0x20/0x40
[   18.849510]  kasan_save_alloc_info+0x40/0x58
[   18.849669]  __kasan_slab_alloc+0xa8/0xb0
[   18.849744]  kmem_cache_alloc_noprof+0x10c/0x398
[   18.849816]  kmem_cache_invalid_free+0x12c/0x3c8
[   18.849950]  kunit_try_run_case+0x170/0x3f0
[   18.850124]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.850169]  kthread+0x328/0x630
[   18.850209]  ret_from_fork+0x10/0x20
[   18.850245] 
[   18.850266] The buggy address belongs to the object at fff00000c56f5000
[   18.850266]  which belongs to the cache test_cache of size 200
[   18.850733] The buggy address is located 1 bytes inside of
[   18.850733]  200-byte region [fff00000c56f5000, fff00000c56f50c8)
[   18.850866] 
[   18.851041] The buggy address belongs to the physical page:
[   18.851224] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1056f5
[   18.851385] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.851521] page_type: f5(slab)
[   18.851560] raw: 0bfffe0000000000 fff00000c1b588c0 dead000000000122 0000000000000000
[   18.851652] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   18.851958] page dumped because: kasan: bad access detected
[   18.852127] 
[   18.852318] Memory state around the buggy address:
[   18.852463]  fff00000c56f4f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.852548]  fff00000c56f4f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.852607] >fff00000c56f5000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.852759]                    ^
[   18.852790]  fff00000c56f5080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   18.852863]  fff00000c56f5100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.853075] ==================================================================

[   12.349295] ==================================================================
[   12.349780] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   12.350114] Free of addr ffff888103a0c001 by task kunit_try_catch/228
[   12.350397] 
[   12.350524] CPU: 0 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc4 #1 PREEMPT(voluntary) 
[   12.350569] Tainted: [B]=BAD_PAGE, [N]=TEST
[   12.350581] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   12.350603] Call Trace:
[   12.350617]  <TASK>
[   12.350635]  dump_stack_lvl+0x73/0xb0
[   12.350667]  print_report+0xd1/0x650
[   12.350690]  ? __virt_addr_valid+0x1db/0x2d0
[   12.350715]  ? kasan_complete_mode_report_info+0x2a/0x200
[   12.350737]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.350762]  kasan_report_invalid_free+0x10a/0x130
[   12.350786]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.350812]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.350835]  check_slab_allocation+0x11f/0x130
[   12.350857]  __kasan_slab_pre_free+0x28/0x40
[   12.350878]  kmem_cache_free+0xed/0x420
[   12.350898]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   12.350918]  ? kmem_cache_invalid_free+0x1d8/0x460
[   12.350957]  kmem_cache_invalid_free+0x1d8/0x460
[   12.350981]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   12.351004]  ? finish_task_switch.isra.0+0x153/0x700
[   12.351028]  ? __switch_to+0x47/0xf50
[   12.351056]  ? __pfx_read_tsc+0x10/0x10
[   12.351077]  ? ktime_get_ts64+0x86/0x230
[   12.351102]  kunit_try_run_case+0x1a5/0x480
[   12.351132]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.351153]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   12.351177]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   12.351200]  ? __kthread_parkme+0x82/0x180
[   12.351221]  ? preempt_count_sub+0x50/0x80
[   12.351243]  ? __pfx_kunit_try_run_case+0x10/0x10
[   12.351266]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.351288]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   12.351310]  kthread+0x337/0x6f0
[   12.351329]  ? trace_preempt_on+0x20/0xc0
[   12.351353]  ? __pfx_kthread+0x10/0x10
[   12.351373]  ? _raw_spin_unlock_irq+0x47/0x80
[   12.351393]  ? calculate_sigpending+0x7b/0xa0
[   12.351417]  ? __pfx_kthread+0x10/0x10
[   12.351440]  ret_from_fork+0x116/0x1d0
[   12.351458]  ? __pfx_kthread+0x10/0x10
[   12.351478]  ret_from_fork_asm+0x1a/0x30
[   12.351508]  </TASK>
[   12.351520] 
[   12.359941] Allocated by task 228:
[   12.360130]  kasan_save_stack+0x45/0x70
[   12.360592]  kasan_save_track+0x18/0x40
[   12.360739]  kasan_save_alloc_info+0x3b/0x50
[   12.360965]  __kasan_slab_alloc+0x91/0xa0
[   12.361205]  kmem_cache_alloc_noprof+0x123/0x3f0
[   12.361406]  kmem_cache_invalid_free+0x157/0x460
[   12.361689]  kunit_try_run_case+0x1a5/0x480
[   12.361862]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   12.362099]  kthread+0x337/0x6f0
[   12.362271]  ret_from_fork+0x116/0x1d0
[   12.362456]  ret_from_fork_asm+0x1a/0x30
[   12.362600] 
[   12.362672] The buggy address belongs to the object at ffff888103a0c000
[   12.362672]  which belongs to the cache test_cache of size 200
[   12.363127] The buggy address is located 1 bytes inside of
[   12.363127]  200-byte region [ffff888103a0c000, ffff888103a0c0c8)
[   12.363707] 
[   12.363807] The buggy address belongs to the physical page:
[   12.364259] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103a0c
[   12.364564] flags: 0x200000000000000(node=0|zone=2)
[   12.364818] page_type: f5(slab)
[   12.365015] raw: 0200000000000000 ffff888101dc2500 dead000000000122 0000000000000000
[   12.365555] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   12.365859] page dumped because: kasan: bad access detected
[   12.366082] 
[   12.366179] Memory state around the buggy address:
[   12.366386]  ffff888103a0bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.366693]  ffff888103a0bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.367141] >ffff888103a0c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   12.367360]                    ^
[   12.367477]  ffff888103a0c080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   12.367913]  ffff888103a0c100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   12.368190] ==================================================================