Hay
Date
May 12, 2025, 6:12 p.m.

Environment
qemu-arm64
qemu-x86_64

[   19.591478] ==================================================================
[   19.592204] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3b8
[   19.592937] Free of addr fff00000c6573001 by task kunit_try_catch/200
[   19.593444] 
[   19.593638] CPU: 0 UID: 0 PID: 200 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   19.593770] Tainted: [B]=BAD_PAGE, [N]=TEST
[   19.593812] Hardware name: linux,dummy-virt (DT)
[   19.593869] Call trace:
[   19.593900]  show_stack+0x20/0x38 (C)
[   19.593973]  dump_stack_lvl+0x8c/0xd0
[   19.594037]  print_report+0x118/0x608
[   19.594119]  kasan_report_invalid_free+0xc0/0xe8
[   19.594183]  check_slab_allocation+0xfc/0x108
[   19.594242]  __kasan_slab_pre_free+0x2c/0x48
[   19.594299]  kmem_cache_free+0xf0/0x470
[   19.594378]  kmem_cache_invalid_free+0x184/0x3b8
[   19.594443]  kunit_try_run_case+0x170/0x3f0
[   19.594565]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.594640]  kthread+0x318/0x620
[   19.594696]  ret_from_fork+0x10/0x20
[   19.594770] 
[   19.598928] Allocated by task 200:
[   19.599234]  kasan_save_stack+0x3c/0x68
[   19.599581]  kasan_save_track+0x20/0x40
[   19.600418]  kasan_save_alloc_info+0x40/0x58
[   19.600731]  __kasan_slab_alloc+0xa8/0xb0
[   19.601124]  kmem_cache_alloc_noprof+0x10c/0x3a0
[   19.601392]  kmem_cache_invalid_free+0x12c/0x3b8
[   19.601632]  kunit_try_run_case+0x170/0x3f0
[   19.601813]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   19.602211]  kthread+0x318/0x620
[   19.602453]  ret_from_fork+0x10/0x20
[   19.602725] 
[   19.602916] The buggy address belongs to the object at fff00000c6573000
[   19.602916]  which belongs to the cache test_cache of size 200
[   19.603448] The buggy address is located 1 bytes inside of
[   19.603448]  200-byte region [fff00000c6573000, fff00000c65730c8)
[   19.604042] 
[   19.604234] The buggy address belongs to the physical page:
[   19.604513] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106573
[   19.605168] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   19.605500] page_type: f5(slab)
[   19.605781] raw: 0bfffe0000000000 fff00000c656d280 dead000000000122 0000000000000000
[   19.606159] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   19.606873] page dumped because: kasan: bad access detected
[   19.607375] 
[   19.607696] Memory state around the buggy address:
[   19.607918]  fff00000c6572f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.608168]  fff00000c6572f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.609178] >fff00000c6573000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   19.609569]                    ^
[   19.609769]  fff00000c6573080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   19.610252]  fff00000c6573100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   19.610828] ==================================================================

[   13.142346] ==================================================================
[   13.144023] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d9/0x470
[   13.144397] Free of addr ffff888101b30001 by task kunit_try_catch/219
[   13.144603] 
[   13.144933] CPU: 1 UID: 0 PID: 219 Comm: kunit_try_catch Tainted: G    B            N 6.14.7-rc1 #1
[   13.145018] Tainted: [B]=BAD_PAGE, [N]=TEST
[   13.145258] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   13.145289] Call Trace:
[   13.145305]  <TASK>
[   13.145327]  dump_stack_lvl+0x73/0xb0
[   13.145362]  print_report+0xd1/0x650
[   13.145385]  ? __virt_addr_valid+0x1db/0x2d0
[   13.145410]  ? kasan_complete_mode_report_info+0x2a/0x200
[   13.145435]  ? kmem_cache_invalid_free+0x1d9/0x470
[   13.145460]  kasan_report_invalid_free+0xfc/0x120
[   13.145483]  ? kmem_cache_invalid_free+0x1d9/0x470
[   13.145508]  ? kmem_cache_invalid_free+0x1d9/0x470
[   13.145531]  check_slab_allocation+0x11f/0x130
[   13.145552]  __kasan_slab_pre_free+0x28/0x40
[   13.145571]  kmem_cache_free+0xee/0x420
[   13.145591]  ? kmem_cache_alloc_noprof+0x124/0x400
[   13.145614]  ? kmem_cache_invalid_free+0x1d9/0x470
[   13.145641]  kmem_cache_invalid_free+0x1d9/0x470
[   13.145664]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   13.145686]  ? finish_task_switch.isra.0+0x153/0x700
[   13.145711]  ? __switch_to+0x5d9/0xf60
[   13.145747]  ? __pfx_read_tsc+0x10/0x10
[   13.145768]  ? ktime_get_ts64+0x86/0x230
[   13.145794]  kunit_try_run_case+0x1a6/0x480
[   13.145819]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.145851]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   13.145874]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   13.145899]  ? __kthread_parkme+0x82/0x160
[   13.145922]  ? preempt_count_sub+0x50/0x80
[   13.145945]  ? __pfx_kunit_try_run_case+0x10/0x10
[   13.145967]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.146012]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   13.146051]  kthread+0x324/0x6e0
[   13.146073]  ? trace_preempt_on+0x20/0xc0
[   13.146097]  ? __pfx_kthread+0x10/0x10
[   13.146119]  ? _raw_spin_unlock_irq+0x47/0x80
[   13.146142]  ? calculate_sigpending+0x7b/0xa0
[   13.146163]  ? __pfx_kthread+0x10/0x10
[   13.146185]  ret_from_fork+0x41/0x80
[   13.146203]  ? __pfx_kthread+0x10/0x10
[   13.146225]  ret_from_fork_asm+0x1a/0x30
[   13.146259]  </TASK>
[   13.146271] 
[   13.161965] Allocated by task 219:
[   13.162474]  kasan_save_stack+0x45/0x70
[   13.162958]  kasan_save_track+0x18/0x40
[   13.163507]  kasan_save_alloc_info+0x3b/0x50
[   13.164055]  __kasan_slab_alloc+0x91/0xa0
[   13.164657]  kmem_cache_alloc_noprof+0x124/0x400
[   13.165319]  kmem_cache_invalid_free+0x158/0x470
[   13.165867]  kunit_try_run_case+0x1a6/0x480
[   13.166648]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   13.167182]  kthread+0x324/0x6e0
[   13.167518]  ret_from_fork+0x41/0x80
[   13.167920]  ret_from_fork_asm+0x1a/0x30
[   13.168288] 
[   13.168544] The buggy address belongs to the object at ffff888101b30000
[   13.168544]  which belongs to the cache test_cache of size 200
[   13.169409] The buggy address is located 1 bytes inside of
[   13.169409]  200-byte region [ffff888101b30000, ffff888101b300c8)
[   13.169760] 
[   13.169851] The buggy address belongs to the physical page:
[   13.170398] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b30
[   13.170760] flags: 0x200000000000000(node=0|zone=2)
[   13.170972] page_type: f5(slab)
[   13.171120] raw: 0200000000000000 ffff888101ab2a00 dead000000000122 0000000000000000
[   13.171664] raw: 0000000000000000 00000000800f000f 00000000f5000000 0000000000000000
[   13.172073] page dumped because: kasan: bad access detected
[   13.172355] 
[   13.172461] Memory state around the buggy address:
[   13.172646]  ffff888101b2ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.172940]  ffff888101b2ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.173626] >ffff888101b30000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   13.174027]                    ^
[   13.174356]  ffff888101b30080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   13.174684]  ffff888101b30100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   13.175012] ==================================================================