Hay
Date
May 23, 2025, 11:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   28.774145] ==================================================================
[   28.774419] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   28.774699] Free of addr fff00000c777e001 by task kunit_try_catch/213
[   28.775052] 
[   28.775266] CPU: 0 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7 #1 PREEMPT 
[   28.775556] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.775640] Hardware name: linux,dummy-virt (DT)
[   28.775743] Call trace:
[   28.776103]  show_stack+0x20/0x38 (C)
[   28.776504]  dump_stack_lvl+0x8c/0xd0
[   28.776804]  print_report+0x118/0x608
[   28.776937]  kasan_report_invalid_free+0xc0/0xe8
[   28.777094]  check_slab_allocation+0xfc/0x108
[   28.777277]  __kasan_slab_pre_free+0x2c/0x48
[   28.777475]  kmem_cache_free+0xf0/0x470
[   28.777681]  kmem_cache_invalid_free+0x184/0x3c8
[   28.777898]  kunit_try_run_case+0x170/0x3f0
[   28.778111]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   28.778335]  kthread+0x328/0x630
[   28.778506]  ret_from_fork+0x10/0x20
[   28.778821] 
[   28.778924] Allocated by task 213:
[   28.779013]  kasan_save_stack+0x3c/0x68
[   28.779143]  kasan_save_track+0x20/0x40
[   28.779257]  kasan_save_alloc_info+0x40/0x58
[   28.779386]  __kasan_slab_alloc+0xa8/0xb0
[   28.779509]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   28.779632]  kmem_cache_invalid_free+0x12c/0x3c8
[   28.779854]  kunit_try_run_case+0x170/0x3f0
[   28.780015]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   28.780148]  kthread+0x328/0x630
[   28.780579]  ret_from_fork+0x10/0x20
[   28.780706] 
[   28.780764] The buggy address belongs to the object at fff00000c777e000
[   28.780764]  which belongs to the cache test_cache of size 200
[   28.780925] The buggy address is located 1 bytes inside of
[   28.780925]  200-byte region [fff00000c777e000, fff00000c777e0c8)
[   28.781069] 
[   28.781126] The buggy address belongs to the physical page:
[   28.781631] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10777e
[   28.781925] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   28.782291] page_type: f5(slab)
[   28.782546] raw: 0bfffe0000000000 fff00000c11fd640 dead000000000122 0000000000000000
[   28.783118] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   28.783343] page dumped because: kasan: bad access detected
[   28.783465] 
[   28.783514] Memory state around the buggy address:
[   28.783605]  fff00000c777df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.784189]  fff00000c777df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.784623] >fff00000c777e000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   28.784746]                    ^
[   28.784830]  fff00000c777e080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   28.785324]  fff00000c777e100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.785490] ==================================================================

[   13.377438] ==================================================================
[   13.377876] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.378116] Free of addr ffff88810270b001 by task kunit_try_catch/230
[   13.378327] 
[   13.378525] CPU: 0 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc7 #1 PREEMPT(voluntary) 
[   13.378573] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.378585] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.378607] Call Trace:
[   13.378620]  <TASK>
[   13.378710]  dump_stack_lvl+0x73/0xb0
[   13.378742]  print_report+0xd1/0x650
[   13.378955]  ? __virt_addr_valid+0x1db/0x2d0
[   13.378985]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.379223]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.379250]  kasan_report_invalid_free+0x10a/0x130
[   13.379275]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.379308]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.379329]  check_slab_allocation+0x11f/0x130
[   13.379350]  __kasan_slab_pre_free+0x28/0x40
[   13.379371]  kmem_cache_free+0xed/0x420
[   13.379393]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.379413]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.379436]  kmem_cache_invalid_free+0x1d8/0x460
[   13.379456]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.379475]  ? finish_task_switch.isra.0+0x153/0x700
[   13.379500]  ? __switch_to+0x5d9/0xf60
[   13.379521]  ? dequeue_task_fair+0x166/0x4e0
[   13.379548]  ? __pfx_read_tsc+0x10/0x10
[   13.379568]  ? ktime_get_ts64+0x86/0x230
[   13.379593]  kunit_try_run_case+0x1a5/0x480
[   13.379617]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.379638]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.379662]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.379684]  ? __kthread_parkme+0x82/0x180
[   13.379706]  ? preempt_count_sub+0x50/0x80
[   13.379729]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.379751]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.379773]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.379794]  kthread+0x337/0x6f0
[   13.379810]  ? trace_preempt_on+0x20/0xc0
[   13.379834]  ? __pfx_kthread+0x10/0x10
[   13.379852]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.379872]  ? calculate_sigpending+0x7b/0xa0
[   13.379894]  ? __pfx_kthread+0x10/0x10
[   13.379912]  ret_from_fork+0x41/0x80
[   13.379932]  ? __pfx_kthread+0x10/0x10
[   13.379949]  ret_from_fork_asm+0x1a/0x30
[   13.379980]  </TASK>
[   13.379992] 
[   13.395441] Allocated by task 230:
[   13.395758]  kasan_save_stack+0x45/0x70
[   13.396260]  kasan_save_track+0x18/0x40
[   13.396607]  kasan_save_alloc_info+0x3b/0x50
[   13.396754]  __kasan_slab_alloc+0x91/0xa0
[   13.397054]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.397574]  kmem_cache_invalid_free+0x157/0x460
[   13.398116]  kunit_try_run_case+0x1a5/0x480
[   13.398599]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.398841]  kthread+0x337/0x6f0
[   13.399320]  ret_from_fork+0x41/0x80
[   13.399672]  ret_from_fork_asm+0x1a/0x30
[   13.399956] 
[   13.400151] The buggy address belongs to the object at ffff88810270b000
[   13.400151]  which belongs to the cache test_cache of size 200
[   13.400704] The buggy address is located 1 bytes inside of
[   13.400704]  200-byte region [ffff88810270b000, ffff88810270b0c8)
[   13.401546] 
[   13.401729] The buggy address belongs to the physical page:
[   13.402348] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10270b
[   13.403109] flags: 0x200000000000000(node=0|zone=2)
[   13.403695] page_type: f5(slab)
[   13.403827] raw: 0200000000000000 ffff888102707140 dead000000000122 0000000000000000
[   13.404544] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.405207] page dumped because: kasan: bad access detected
[   13.405406] 
[   13.405555] Memory state around the buggy address:
[   13.405741]  ffff88810270af00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.405999]  ffff88810270af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.406323] >ffff88810270b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.406846]                    ^
[   13.407039]  ffff88810270b080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.407393]  ffff88810270b100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.407873] ==================================================================