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

Environment
qemu-arm64
qemu-x86_64

[   16.399548] ==================================================================
[   16.399637] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3c8
[   16.399710] Free of addr fff00000c5952001 by task kunit_try_catch/212
[   16.399754] 
[   16.399795] CPU: 1 UID: 0 PID: 212 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT 
[   16.399884] Tainted: [B]=BAD_PAGE, [N]=TEST
[   16.399910] Hardware name: linux,dummy-virt (DT)
[   16.399944] Call trace:
[   16.399966]  show_stack+0x20/0x38 (C)
[   16.400035]  dump_stack_lvl+0x8c/0xd0
[   16.400085]  print_report+0x118/0x5d0
[   16.400140]  kasan_report_invalid_free+0xc0/0xe8
[   16.400203]  check_slab_allocation+0xfc/0x108
[   16.400252]  __kasan_slab_pre_free+0x2c/0x48
[   16.400298]  kmem_cache_free+0xf0/0x468
[   16.400372]  kmem_cache_invalid_free+0x184/0x3c8
[   16.400418]  kunit_try_run_case+0x170/0x3f0
[   16.400476]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.400549]  kthread+0x328/0x630
[   16.400593]  ret_from_fork+0x10/0x20
[   16.400642] 
[   16.400659] Allocated by task 212:
[   16.400944]  kasan_save_stack+0x3c/0x68
[   16.401020]  kasan_save_track+0x20/0x40
[   16.401166]  kasan_save_alloc_info+0x40/0x58
[   16.401384]  __kasan_slab_alloc+0xa8/0xb0
[   16.401518]  kmem_cache_alloc_noprof+0x10c/0x398
[   16.401627]  kmem_cache_invalid_free+0x12c/0x3c8
[   16.401737]  kunit_try_run_case+0x170/0x3f0
[   16.401802]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   16.401846]  kthread+0x328/0x630
[   16.401876]  ret_from_fork+0x10/0x20
[   16.401934] 
[   16.401955] The buggy address belongs to the object at fff00000c5952000
[   16.401955]  which belongs to the cache test_cache of size 200
[   16.402016] The buggy address is located 1 bytes inside of
[   16.402016]  200-byte region [fff00000c5952000, fff00000c59520c8)
[   16.402346] 
[   16.402421] The buggy address belongs to the physical page:
[   16.402582] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105952
[   16.402644] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   16.402871] page_type: f5(slab)
[   16.403111] raw: 0bfffe0000000000 fff00000c590f640 dead000000000122 0000000000000000
[   16.403247] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   16.403366] page dumped because: kasan: bad access detected
[   16.403444] 
[   16.403521] Memory state around the buggy address:
[   16.403553]  fff00000c5951f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.403623]  fff00000c5951f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.403909] >fff00000c5952000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   16.404094]                    ^
[   16.404212]  fff00000c5952080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   16.404277]  fff00000c5952100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   16.404376] ==================================================================

[   13.279555] ==================================================================
[   13.279964] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d8/0x460
[   13.280197] Free of addr ffff8881038d8001 by task kunit_try_catch/228
[   13.281189] 
[   13.281508] CPU: 1 UID: 0 PID: 228 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc6 #1 PREEMPT(voluntary) 
[   13.281559] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.281571] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.281591] Call Trace:
[   13.281603]  <TASK>
[   13.281619]  dump_stack_lvl+0x73/0xb0
[   13.281651]  print_report+0xd1/0x610
[   13.281674]  ? __virt_addr_valid+0x1db/0x2d0
[   13.281699]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.281722]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.281748]  kasan_report_invalid_free+0x10a/0x130
[   13.281790]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.281816]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.281841]  check_slab_allocation+0x11f/0x130
[   13.281863]  __kasan_slab_pre_free+0x28/0x40
[   13.281884]  kmem_cache_free+0xed/0x420
[   13.281905]  ? kmem_cache_alloc_noprof+0x123/0x3f0
[   13.281926]  ? kmem_cache_invalid_free+0x1d8/0x460
[   13.281954]  kmem_cache_invalid_free+0x1d8/0x460
[   13.281979]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.282004]  ? finish_task_switch.isra.0+0x153/0x700
[   13.282028]  ? __switch_to+0x47/0xf50
[   13.282057]  ? __pfx_read_tsc+0x10/0x10
[   13.282077]  ? ktime_get_ts64+0x86/0x230
[   13.282101]  kunit_try_run_case+0x1a5/0x480
[   13.282127]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.282149]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   13.282174]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.282198]  ? __kthread_parkme+0x82/0x180
[   13.282219]  ? preempt_count_sub+0x50/0x80
[   13.282242]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.282266]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.282290]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.282315]  kthread+0x337/0x6f0
[   13.282334]  ? trace_preempt_on+0x20/0xc0
[   13.282358]  ? __pfx_kthread+0x10/0x10
[   13.282379]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.282406]  ? calculate_sigpending+0x7b/0xa0
[   13.282431]  ? __pfx_kthread+0x10/0x10
[   13.282452]  ret_from_fork+0x116/0x1d0
[   13.282470]  ? __pfx_kthread+0x10/0x10
[   13.282491]  ret_from_fork_asm+0x1a/0x30
[   13.282521]  </TASK>
[   13.282531] 
[   13.296324] Allocated by task 228:
[   13.296722]  kasan_save_stack+0x45/0x70
[   13.296952]  kasan_save_track+0x18/0x40
[   13.297128]  kasan_save_alloc_info+0x3b/0x50
[   13.297652]  __kasan_slab_alloc+0x91/0xa0
[   13.297869]  kmem_cache_alloc_noprof+0x123/0x3f0
[   13.298164]  kmem_cache_invalid_free+0x157/0x460
[   13.298528]  kunit_try_run_case+0x1a5/0x480
[   13.298749]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.299002]  kthread+0x337/0x6f0
[   13.299162]  ret_from_fork+0x116/0x1d0
[   13.299344]  ret_from_fork_asm+0x1a/0x30
[   13.300006] 
[   13.300104] The buggy address belongs to the object at ffff8881038d8000
[   13.300104]  which belongs to the cache test_cache of size 200
[   13.300933] The buggy address is located 1 bytes inside of
[   13.300933]  200-byte region [ffff8881038d8000, ffff8881038d80c8)
[   13.301692] 
[   13.301798] The buggy address belongs to the physical page:
[   13.302039] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1038d8
[   13.302387] flags: 0x200000000000000(node=0|zone=2)
[   13.302959] page_type: f5(slab)
[   13.303244] raw: 0200000000000000 ffff888101bdec80 dead000000000122 0000000000000000
[   13.303635] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.303986] page dumped because: kasan: bad access detected
[   13.304225] 
[   13.304305] Memory state around the buggy address:
[   13.304875]  ffff8881038d7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.305164]  ffff8881038d7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.305861] >ffff8881038d8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.306135]                    ^
[   13.306301]  ffff8881038d8080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.306949]  ffff8881038d8100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.307337] ==================================================================