Hay
Date
Nov. 28, 2024, 2:36 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.768833] ==================================================================
[   31.769891] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x184/0x3b8
[   31.770622] Free of addr fff00000c406f001 by task kunit_try_catch/199
[   31.771270] 
[   31.771672] CPU: 0 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   31.772870] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.773705] Hardware name: linux,dummy-virt (DT)
[   31.774366] Call trace:
[   31.774822]  show_stack+0x20/0x38 (C)
[   31.775437]  dump_stack_lvl+0x8c/0xd0
[   31.776047]  print_report+0x118/0x5e0
[   31.776711]  kasan_report_invalid_free+0xb0/0xd8
[   31.777612]  check_slab_allocation+0xfc/0x108
[   31.778239]  __kasan_slab_pre_free+0x2c/0x48
[   31.778883]  kmem_cache_free+0xf0/0x470
[   31.779453]  kmem_cache_invalid_free+0x184/0x3b8
[   31.780029]  kunit_try_run_case+0x14c/0x3d0
[   31.780632]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.781353]  kthread+0x24c/0x2d0
[   31.782129]  ret_from_fork+0x10/0x20
[   31.782649] 
[   31.782960] Allocated by task 199:
[   31.783432]  kasan_save_stack+0x3c/0x68
[   31.783969]  kasan_save_track+0x20/0x40
[   31.784470]  kasan_save_alloc_info+0x40/0x58
[   31.785008]  __kasan_slab_alloc+0xa8/0xb0
[   31.785671]  kmem_cache_alloc_noprof+0x108/0x398
[   31.786352]  kmem_cache_invalid_free+0x12c/0x3b8
[   31.787024]  kunit_try_run_case+0x14c/0x3d0
[   31.787699]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.788468]  kthread+0x24c/0x2d0
[   31.788972]  ret_from_fork+0x10/0x20
[   31.789748] 
[   31.790493] The buggy address belongs to the object at fff00000c406f000
[   31.790493]  which belongs to the cache test_cache of size 200
[   31.791498] The buggy address is located 1 bytes inside of
[   31.791498]  200-byte region [fff00000c406f000, fff00000c406f0c8)
[   31.792692] 
[   31.793069] The buggy address belongs to the physical page:
[   31.794193] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10406f
[   31.795072] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.795847] page_type: f5(slab)
[   31.796364] raw: 0bfffe0000000000 fff00000ffeca000 dead000000000122 0000000000000000
[   31.797250] raw: 0000000000000000 00000000800f000f 00000001f5000000 0000000000000000
[   31.798133] page dumped because: kasan: bad access detected
[   31.798847] 
[   31.799210] Memory state around the buggy address:
[   31.799886]  fff00000c406ef00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.800676]  fff00000c406ef80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
[   31.801881] >fff00000c406f000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   31.802668]                    ^
[   31.803202]  fff00000c406f080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   31.803955]  fff00000c406f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.804636] ==================================================================

[   22.689460] ==================================================================
[   22.690355] BUG: KASAN: invalid-free in kmem_cache_invalid_free+0x1d9/0x470
[   22.691066] Free of addr ffff888102a25001 by task kunit_try_catch/219
[   22.691596] 
[   22.691778] CPU: 0 UID: 0 PID: 219 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241128 #1
[   22.692785] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.693598] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.694256] Call Trace:
[   22.694524]  <TASK>
[   22.694769]  dump_stack_lvl+0x73/0xb0
[   22.695120]  print_report+0xd1/0x640
[   22.695493]  ? __virt_addr_valid+0x1db/0x2d0
[   22.695809]  ? kmem_cache_invalid_free+0x1d9/0x470
[   22.696524]  ? kasan_complete_mode_report_info+0x2a/0x200
[   22.697654]  ? kmem_cache_invalid_free+0x1d9/0x470
[   22.698427]  kasan_report_invalid_free+0xc0/0xf0
[   22.699128]  ? kmem_cache_invalid_free+0x1d9/0x470
[   22.699837]  ? kmem_cache_invalid_free+0x1d9/0x470
[   22.700617]  check_slab_allocation+0x11f/0x130
[   22.701117]  __kasan_slab_pre_free+0x28/0x40
[   22.701913]  kmem_cache_free+0xee/0x420
[   22.702870]  ? kmem_cache_alloc_noprof+0x11e/0x3e0
[   22.703331]  ? kmem_cache_invalid_free+0x1d9/0x470
[   22.704002]  kmem_cache_invalid_free+0x1d9/0x470
[   22.704535]  ? __pfx_kmem_cache_invalid_free+0x10/0x10
[   22.705300]  ? finish_task_switch.isra.0+0x153/0x700
[   22.705916]  ? __switch_to+0x5d9/0xf60
[   22.706467]  ? __pfx_read_tsc+0x10/0x10
[   22.707005]  ? ktime_get_ts64+0x84/0x230
[   22.707700]  kunit_try_run_case+0x1b3/0x490
[   22.708170]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.708709]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   22.709215]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.709796]  ? __kthread_parkme+0x82/0x160
[   22.710771]  ? preempt_count_sub+0x50/0x80
[   22.711070]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.711922]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.712550]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.713177]  kthread+0x257/0x310
[   22.713514]  ? __pfx_kthread+0x10/0x10
[   22.714012]  ret_from_fork+0x41/0x80
[   22.714398]  ? __pfx_kthread+0x10/0x10
[   22.715389]  ret_from_fork_asm+0x1a/0x30
[   22.716003]  </TASK>
[   22.716456] 
[   22.716683] Allocated by task 219:
[   22.717091]  kasan_save_stack+0x3d/0x60
[   22.717590]  kasan_save_track+0x18/0x40
[   22.717989]  kasan_save_alloc_info+0x3b/0x50
[   22.718416]  __kasan_slab_alloc+0x91/0xa0
[   22.718886]  kmem_cache_alloc_noprof+0x11e/0x3e0
[   22.719454]  kmem_cache_invalid_free+0x158/0x470
[   22.719939]  kunit_try_run_case+0x1b3/0x490
[   22.720437]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.720843]  kthread+0x257/0x310
[   22.721244]  ret_from_fork+0x41/0x80
[   22.721644]  ret_from_fork_asm+0x1a/0x30
[   22.722215] 
[   22.722472] The buggy address belongs to the object at ffff888102a25000
[   22.722472]  which belongs to the cache test_cache of size 200
[   22.723378] The buggy address is located 1 bytes inside of
[   22.723378]  200-byte region [ffff888102a25000, ffff888102a250c8)
[   22.724466] 
[   22.724742] The buggy address belongs to the physical page:
[   22.725372] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102a25
[   22.726144] flags: 0x200000000000000(node=0|zone=2)
[   22.726649] page_type: f5(slab)
[   22.727023] raw: 0200000000000000 ffff888101653b40 dead000000000122 0000000000000000
[   22.727782] raw: 0000000000000000 00000000800f000f 00000001f5000000 0000000000000000
[   22.728507] page dumped because: kasan: bad access detected
[   22.728993] 
[   22.729251] Memory state around the buggy address:
[   22.729715]  ffff888102a24f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.730519]  ffff888102a24f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.731181] >ffff888102a25000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   22.731886]                    ^
[   22.732313]  ffff888102a25080: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
[   22.733050]  ffff888102a25100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.733790] ==================================================================