Hay
Date
June 7, 2025, 10:40 a.m.

Environment
qemu-arm64
qemu-x86_64

[   22.354391] ==================================================================
[   22.356174] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x190/0x3d8
[   22.357118] Free of addr fff00000c41fd001 by task kunit_try_catch/199
[   22.358174] 
[   22.358337] CPU: 1 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   22.358448] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.358480] Hardware name: linux,dummy-virt (DT)
[   22.358522] Call trace:
[   22.358549]  dump_backtrace+0x9c/0x128
[   22.358607]  show_stack+0x20/0x38
[   22.358648]  dump_stack_lvl+0x8c/0xd0
[   22.358698]  print_report+0x118/0x5f0
[   22.358743]  kasan_report_invalid_free+0xc0/0xe8
[   22.358793]  check_slab_allocation+0xfc/0x108
[   22.358839]  __kasan_slab_pre_free+0x2c/0x48
[   22.358885]  kmem_cache_free+0xf0/0x460
[   22.358932]  kmem_cache_invalid_free+0x190/0x3d8
[   22.359008]  kunit_try_run_case+0x170/0x3f0
[   22.359065]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.359119]  kthread+0x24c/0x2d0
[   22.359164]  ret_from_fork+0x10/0x20
[   22.359213] 
[   22.368182] Allocated by task 199:
[   22.368576]  kasan_save_stack+0x3c/0x68
[   22.369184]  kasan_save_track+0x20/0x40
[   22.369903]  kasan_save_alloc_info+0x40/0x58
[   22.370502]  __kasan_slab_alloc+0xa8/0xb0
[   22.371017]  kmem_cache_alloc_noprof+0xf8/0x300
[   22.371829]  kmem_cache_invalid_free+0x130/0x3d8
[   22.372383]  kunit_try_run_case+0x170/0x3f0
[   22.373023]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.373721]  kthread+0x24c/0x2d0
[   22.374204]  ret_from_fork+0x10/0x20
[   22.374778] 
[   22.375132] The buggy address belongs to the object at fff00000c41fd000
[   22.375132]  which belongs to the cache test_cache of size 200
[   22.376619] The buggy address is located 1 bytes inside of
[   22.376619]  200-byte region [fff00000c41fd000, fff00000c41fd0c8)
[   22.377805] 
[   22.378216] The buggy address belongs to the physical page:
[   22.378787] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1041fd
[   22.379751] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.380680] page_type: f5(slab)
[   22.381234] raw: 0bfffe0000000000 fff00000c4182140 dead000000000122 0000000000000000
[   22.382117] raw: 0000000000000000 00000000800f000f 00000001f5000000 0000000000000000
[   22.382928] page dumped because: kasan: bad access detected
[   22.383581] 
[   22.383883] Memory state around the buggy address:
[   22.384427]  fff00000c41fcf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.385260]  fff00000c41fcf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   22.385942] >fff00000c41fd000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.386829]                    ^
[   22.387305]  fff00000c41fd080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   22.388363]  fff00000c41fd100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.389667] ==================================================================

[   18.885124] ==================================================================
[   18.886618] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d9/0x470
[   18.887416] Free of addr ffff88810292e001 by task kunit_try_catch/216
[   18.888128] 
[   18.888429] CPU: 0 UID: 0 PID: 216 Comm: kunit_try_catch Tainted: G    B            N 6.12.33-rc1 #1
[   18.888662] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.888696] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   18.888755] Call Trace:
[   18.888792]  <TASK>
[   18.888913]  dump_stack_lvl+0x73/0xb0
[   18.889032]  print_report+0xd1/0x640
[   18.889117]  ? __virt_addr_valid+0x1db/0x2d0
[   18.889200]  ? kasan_complete_mode_report_info+0x2a/0x200
[   18.889293]  ? kmem_cache_invalid_free+0x1d9/0x470
[   18.889365]  kasan_report_invalid_free+0xfc/0x120
[   18.889450]  ? kmem_cache_invalid_free+0x1d9/0x470
[   18.889575]  ? kmem_cache_invalid_free+0x1d9/0x470
[   18.889609]  check_slab_allocation+0x11f/0x130
[   18.889644]  __kasan_slab_pre_free+0x28/0x40
[   18.889676]  kmem_cache_free+0xee/0x400
[   18.889710]  ? kmem_cache_alloc_noprof+0x107/0x350
[   18.889743]  ? kmem_cache_invalid_free+0x1d9/0x470
[   18.889777]  kmem_cache_invalid_free+0x1d9/0x470
[   18.889808]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   18.889861]  ? finish_task_switch.isra.0+0x153/0x700
[   18.889894]  ? __switch_to+0x5d9/0xf60
[   18.889931]  ? __pfx_read_tsc+0x10/0x10
[   18.889958]  ? ktime_get_ts64+0x84/0x230
[   18.889995]  kunit_try_run_case+0x1a6/0x480
[   18.890028]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.890056]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   18.890086]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   18.890121]  ? __kthread_parkme+0x82/0x160
[   18.890149]  ? preempt_count_sub+0x50/0x80
[   18.890177]  ? __pfx_kunit_try_run_case+0x10/0x10
[   18.890205]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   18.890268]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.890305]  kthread+0x257/0x310
[   18.890330]  ? __pfx_kthread+0x10/0x10
[   18.890356]  ret_from_fork+0x41/0x80
[   18.890385]  ? __pfx_kthread+0x10/0x10
[   18.890410]  ret_from_fork_asm+0x1a/0x30
[   18.890472]  </TASK>
[   18.890517] 
[   18.910031] Allocated by task 216:
[   18.910552]  kasan_save_stack+0x45/0x70
[   18.911085]  kasan_save_track+0x18/0x40
[   18.912152]  kasan_save_alloc_info+0x3b/0x50
[   18.912612]  __kasan_slab_alloc+0x91/0xa0
[   18.913269]  kmem_cache_alloc_noprof+0x107/0x350
[   18.913907]  kmem_cache_invalid_free+0x158/0x470
[   18.914363]  kunit_try_run_case+0x1a6/0x480
[   18.914966]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   18.915917]  kthread+0x257/0x310
[   18.916205]  ret_from_fork+0x41/0x80
[   18.917000]  ret_from_fork_asm+0x1a/0x30
[   18.917815] 
[   18.918535] The buggy address belongs to the object at ffff88810292e000
[   18.918535]  which belongs to the cache test_cache of size 200
[   18.919969] The buggy address is located 1 bytes inside of
[   18.919969]  200-byte region [ffff88810292e000, ffff88810292e0c8)
[   18.921258] 
[   18.921444] The buggy address belongs to the physical page:
[   18.922325] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10292e
[   18.923355] flags: 0x200000000000000(node=0|zone=2)
[   18.924058] page_type: f5(slab)
[   18.924474] raw: 0200000000000000 ffff888101a84dc0 dead000000000122 0000000000000000
[   18.925383] raw: 0000000000000000 00000000800f000f 00000001f5000000 0000000000000000
[   18.926213] page dumped because: kasan: bad access detected
[   18.926564] 
[   18.927209] Memory state around the buggy address:
[   18.927915]  ffff88810292df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.928636]  ffff88810292df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.930771] >ffff88810292e000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   18.931776]                    ^
[   18.932456]  ffff88810292e080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   18.933621]  ffff88810292e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.934007] ==================================================================