Hay
Date
May 29, 2025, 7:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   22.894426] ==================================================================
[   22.895554] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   22.895740] Free of addr fff00000c725d001 by task kunit_try_catch/211
[   22.895843] 
[   22.895954] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT 
[   22.896487] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.896663] Hardware name: linux,dummy-virt (DT)
[   22.896849] Call trace:
[   22.896945]  show_stack+0x20/0x38 (C)
[   22.897440]  dump_stack_lvl+0x8c/0xd0
[   22.897842]  print_report+0x118/0x608
[   22.898333]  kasan_report_invalid_free+0xc0/0xe8
[   22.898729]  check_slab_allocation+0xfc/0x108
[   22.898844]  __kasan_slab_pre_free+0x2c/0x48
[   22.898950]  kmem_cache_free+0xf0/0x470
[   22.899966]  kmem_cache_invalid_free+0x184/0x3c8
[   22.900368]  kunit_try_run_case+0x170/0x3f0
[   22.900975]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.901169]  kthread+0x328/0x630
[   22.901728]  ret_from_fork+0x10/0x20
[   22.902623] 
[   22.902711] Allocated by task 211:
[   22.902784]  kasan_save_stack+0x3c/0x68
[   22.903582]  kasan_save_track+0x20/0x40
[   22.904220]  kasan_save_alloc_info+0x40/0x58
[   22.904541]  __kasan_slab_alloc+0xa8/0xb0
[   22.905004]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   22.905125]  kmem_cache_invalid_free+0x12c/0x3c8
[   22.905228]  kunit_try_run_case+0x170/0x3f0
[   22.905325]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   22.905447]  kthread+0x328/0x630
[   22.905534]  ret_from_fork+0x10/0x20
[   22.905629] 
[   22.905682] The buggy address belongs to the object at fff00000c725d000
[   22.905682]  which belongs to the cache test_cache of size 200
[   22.905830] The buggy address is located 1 bytes inside of
[   22.905830]  200-byte region [fff00000c725d000, fff00000c725d0c8)
[   22.907480] 
[   22.907923] The buggy address belongs to the physical page:
[   22.908153] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10725d
[   22.908692] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   22.909342] page_type: f5(slab)
[   22.910027] raw: 0bfffe0000000000 fff00000c787b140 dead000000000122 0000000000000000
[   22.910253] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   22.910572] page dumped because: kasan: bad access detected
[   22.910965] 
[   22.911005] Memory state around the buggy address:
[   22.911085]  fff00000c725cf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.911180]  fff00000c725cf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.911259] >fff00000c725d000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.911329]                    ^
[   22.911392]  fff00000c725d080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   22.911862]  fff00000c725d100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.912081] ==================================================================


[   11.576581] ==================================================================
[   11.577410] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   11.578093] Free of addr ffff888102fa0001 by task kunit_try_catch/228
[   11.578865] 
[   11.579163] CPU: 0 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250529 #1 PREEMPT(voluntary) 
[   11.579215] Tainted: [B]=BAD_PAGE, [N]=TEST
[   11.579228] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   11.579259] Call Trace:
[   11.579271]  <TASK>
[   11.579288]  dump_stack_lvl+0x73/0xb0
[   11.579316]  print_report+0xd1/0x650
[   11.579339]  ? __virt_addr_valid+0x1db/0x2d0
[   11.579363]  ? kasan_complete_mode_report_info+0x2a/0x200
[   11.579384]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.579406]  kasan_report_invalid_free+0x10a/0x130
[   11.579430]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.579453]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.579473]  check_slab_allocation+0x11f/0x130
[   11.579495]  __kasan_slab_pre_free+0x28/0x40
[   11.579516]  kmem_cache_free+0xed/0x420
[   11.579537]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   11.579558]  ? kmem_cache_invalid_free+0x1d8/0x460
[   11.579582]  kmem_cache_invalid_free+0x1d8/0x460
[   11.579602]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   11.579637]  ? finish_task_switch.isra.0+0x153/0x700
[   11.579659]  ? __switch_to+0x47/0xf50
[   11.579687]  ? __pfx_read_tsc+0x10/0x10
[   11.579709]  ? ktime_get_ts64+0x86/0x230
[   11.579733]  kunit_try_run_case+0x1a5/0x480
[   11.579783]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.579803]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   11.579870]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   11.579894]  ? __kthread_parkme+0x82/0x180
[   11.579915]  ? preempt_count_sub+0x50/0x80
[   11.579938]  ? __pfx_kunit_try_run_case+0x10/0x10
[   11.580099]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.580185]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   11.580211]  kthread+0x337/0x6f0
[   11.580230]  ? trace_preempt_on+0x20/0xc0
[   11.580255]  ? __pfx_kthread+0x10/0x10
[   11.580275]  ? _raw_spin_unlock_irq+0x47/0x80
[   11.580297]  ? calculate_sigpending+0x7b/0xa0
[   11.580321]  ? __pfx_kthread+0x10/0x10
[   11.580343]  ret_from_fork+0x116/0x1d0
[   11.580361]  ? __pfx_kthread+0x10/0x10
[   11.580381]  ret_from_fork_asm+0x1a/0x30
[   11.580412]  </TASK>
[   11.580422] 
[   11.594162] Allocated by task 228:
[   11.594350]  kasan_save_stack+0x45/0x70
[   11.594563]  kasan_save_track+0x18/0x40
[   11.594852]  kasan_save_alloc_info+0x3b/0x50
[   11.595097]  __kasan_slab_alloc+0x91/0xa0
[   11.595242]  kmem_cache_alloc_noprof+0x123/0x3f0
[   11.595471]  kmem_cache_invalid_free+0x157/0x460
[   11.595772]  kunit_try_run_case+0x1a5/0x480
[   11.596146]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   11.596395]  kthread+0x337/0x6f0
[   11.596562]  ret_from_fork+0x116/0x1d0
[   11.596808]  ret_from_fork_asm+0x1a/0x30
[   11.597244] 
[   11.597372] The buggy address belongs to the object at ffff888102fa0000
[   11.597372]  which belongs to the cache test_cache of size 200
[   11.598056] The buggy address is located 1 bytes inside of
[   11.598056]  200-byte region [ffff888102fa0000, ffff888102fa00c8)
[   11.598618] 
[   11.598761] The buggy address belongs to the physical page:
[   11.599147] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102fa0
[   11.599564] flags: 0x200000000000000(node=0|zone=2)
[   11.599963] page_type: f5(slab)
[   11.600125] raw: 0200000000000000 ffff8881011daa00 dead000000000122 0000000000000000
[   11.600536] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   11.600920] page dumped because: kasan: bad access detected
[   11.601229] 
[   11.601571] Memory state around the buggy address:
[   11.601958]  ffff888102f9ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.602247]  ffff888102f9ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.602597] >ffff888102fa0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   11.602959]                    ^
[   11.603126]  ffff888102fa0080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   11.603481]  ffff888102fa0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   11.603847] ==================================================================