Hay
Date
June 17, 2025, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   17.794538] ==================================================================
[   17.794643] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   17.794958] Free of addr fff00000c507a001 by task kunit_try_catch/220
[   17.795223] 
[   17.795464] CPU: 1 UID: 0 PID: 220 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT 
[   17.795991] Tainted: [B]=BAD_PAGE, [N]=TEST
[   17.796220] Hardware name: linux,dummy-virt (DT)
[   17.796461] Call trace:
[   17.796732]  show_stack+0x20/0x38 (C)
[   17.796920]  dump_stack_lvl+0x8c/0xd0
[   17.797095]  print_report+0x118/0x608
[   17.797321]  kasan_report_invalid_free+0xc0/0xe8
[   17.797780]  check_slab_allocation+0xfc/0x108
[   17.797867]  __kasan_slab_pre_free+0x2c/0x48
[   17.798131]  kmem_cache_free+0xf0/0x468
[   17.798321]  kmem_cache_invalid_free+0x184/0x3c8
[   17.798422]  kunit_try_run_case+0x170/0x3f0
[   17.798480]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.798787]  kthread+0x328/0x630
[   17.798969]  ret_from_fork+0x10/0x20
[   17.799078] 
[   17.799171] Allocated by task 220:
[   17.799228]  kasan_save_stack+0x3c/0x68
[   17.799662]  kasan_save_track+0x20/0x40
[   17.799750]  kasan_save_alloc_info+0x40/0x58
[   17.800084]  __kasan_slab_alloc+0xa8/0xb0
[   17.800232]  kmem_cache_alloc_noprof+0x10c/0x398
[   17.800319]  kmem_cache_invalid_free+0x12c/0x3c8
[   17.800746]  kunit_try_run_case+0x170/0x3f0
[   17.800835]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   17.800990]  kthread+0x328/0x630
[   17.801028]  ret_from_fork+0x10/0x20
[   17.801099] 
[   17.801243] The buggy address belongs to the object at fff00000c507a000
[   17.801243]  which belongs to the cache test_cache of size 200
[   17.801464] The buggy address is located 1 bytes inside of
[   17.801464]  200-byte region [fff00000c507a000, fff00000c507a0c8)
[   17.801585] 
[   17.801704] The buggy address belongs to the physical page:
[   17.801753] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10507a
[   17.801848] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   17.802190] page_type: f5(slab)
[   17.802373] raw: 0bfffe0000000000 fff00000c115d780 dead000000000122 0000000000000000
[   17.802657] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   17.802747] page dumped because: kasan: bad access detected
[   17.802885] 
[   17.802936] Memory state around the buggy address:
[   17.802986]  fff00000c5079f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.803213]  fff00000c5079f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.803367] >fff00000c507a000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   17.803938]                    ^
[   17.804120]  fff00000c507a080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   17.804196]  fff00000c507a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   17.804643] ==================================================================

[   19.165530] ==================================================================
[   19.166354] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   19.166943] Free of addr ffff8881033aa001 by task kunit_try_catch/238
[   19.167421] 
[   19.167649] CPU: 0 UID: 0 PID: 238 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc2-next-20250617 #1 PREEMPT(voluntary) 
[   19.167776] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.167812] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   19.167923] Call Trace:
[   19.167962]  <TASK>
[   19.168014]  dump_stack_lvl+0x73/0xb0
[   19.168098]  print_report+0xd1/0x650
[   19.168171]  ? __virt_addr_valid+0x1db/0x2d0
[   19.168294]  ? kasan_complete_mode_report_info+0x2a/0x200
[   19.168370]  ? kmem_cache_invalid_free+0x1d8/0x460
[   19.168443]  kasan_report_invalid_free+0x10a/0x130
[   19.168507]  ? kmem_cache_invalid_free+0x1d8/0x460
[   19.168576]  ? kmem_cache_invalid_free+0x1d8/0x460
[   19.168640]  check_slab_allocation+0x11f/0x130
[   19.168698]  __kasan_slab_pre_free+0x28/0x40
[   19.168755]  kmem_cache_free+0xed/0x420
[   19.168811]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   19.168890]  ? kmem_cache_invalid_free+0x1d8/0x460
[   19.168961]  kmem_cache_invalid_free+0x1d8/0x460
[   19.169028]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   19.169084]  ? finish_task_switch.isra.0+0x153/0x700
[   19.169143]  ? __switch_to+0x47/0xf50
[   19.169256]  ? __pfx_read_tsc+0x10/0x10
[   19.169329]  ? ktime_get_ts64+0x86/0x230
[   19.169405]  kunit_try_run_case+0x1a5/0x480
[   19.169487]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.169555]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   19.169624]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   19.169707]  ? __kthread_parkme+0x82/0x180
[   19.169776]  ? preempt_count_sub+0x50/0x80
[   19.169863]  ? __pfx_kunit_try_run_case+0x10/0x10
[   19.169938]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.170009]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   19.170080]  kthread+0x337/0x6f0
[   19.170142]  ? trace_preempt_on+0x20/0xc0
[   19.170256]  ? __pfx_kthread+0x10/0x10
[   19.170326]  ? _raw_spin_unlock_irq+0x47/0x80
[   19.170395]  ? calculate_sigpending+0x7b/0xa0
[   19.170462]  ? __pfx_kthread+0x10/0x10
[   19.170529]  ret_from_fork+0x116/0x1d0
[   19.170593]  ? __pfx_kthread+0x10/0x10
[   19.170662]  ret_from_fork_asm+0x1a/0x30
[   19.170754]  </TASK>
[   19.170790] 
[   19.187506] Allocated by task 238:
[   19.187802]  kasan_save_stack+0x45/0x70
[   19.188366]  kasan_save_track+0x18/0x40
[   19.188696]  kasan_save_alloc_info+0x3b/0x50
[   19.189115]  __kasan_slab_alloc+0x91/0xa0
[   19.189640]  kmem_cache_alloc_noprof+0x123/0x3f0
[   19.190047]  kmem_cache_invalid_free+0x157/0x460
[   19.190825]  kunit_try_run_case+0x1a5/0x480
[   19.191170]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   19.191643]  kthread+0x337/0x6f0
[   19.191995]  ret_from_fork+0x116/0x1d0
[   19.192307]  ret_from_fork_asm+0x1a/0x30
[   19.192628] 
[   19.192991] The buggy address belongs to the object at ffff8881033aa000
[   19.192991]  which belongs to the cache test_cache of size 200
[   19.193991] The buggy address is located 1 bytes inside of
[   19.193991]  200-byte region [ffff8881033aa000, ffff8881033aa0c8)
[   19.195021] 
[   19.195359] The buggy address belongs to the physical page:
[   19.195863] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1033aa
[   19.196699] flags: 0x200000000000000(node=0|zone=2)
[   19.197196] page_type: f5(slab)
[   19.197680] raw: 0200000000000000 ffff8881017f1280 dead000000000122 0000000000000000
[   19.198251] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.199133] page dumped because: kasan: bad access detected
[   19.199719] 
[   19.199912] Memory state around the buggy address:
[   19.200403]  ffff8881033a9f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.200952]  ffff8881033a9f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.201527] >ffff8881033aa000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.202100]                    ^
[   19.202419]  ffff8881033aa080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   19.203024]  ffff8881033aa100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.203570] ==================================================================