Hay
Date
June 23, 2025, 7:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   33.105684] ==================================================================
[   33.105824] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x154/0x2e0
[   33.106045] Read of size 64 at addr fff00000c570b304 by task kunit_try_catch/194
[   33.106215] 
[   33.106357] CPU: 1 UID: 0 PID: 194 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT 
[   33.106624] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.106703] Hardware name: linux,dummy-virt (DT)
[   33.106829] Call trace:
[   33.107086]  show_stack+0x20/0x38 (C)
[   33.107653]  dump_stack_lvl+0x8c/0xd0
[   33.108474]  print_report+0x118/0x608
[   33.108725]  kasan_report+0xdc/0x128
[   33.108908]  kasan_check_range+0x100/0x1a8
[   33.109043]  __asan_memmove+0x3c/0x98
[   33.110195]  kmalloc_memmove_invalid_size+0x154/0x2e0
[   33.110605]  kunit_try_run_case+0x170/0x3f0
[   33.110827]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.111013]  kthread+0x328/0x630
[   33.111232]  ret_from_fork+0x10/0x20
[   33.111389] 
[   33.111443] Allocated by task 194:
[   33.111530]  kasan_save_stack+0x3c/0x68
[   33.111826]  kasan_save_track+0x20/0x40
[   33.111927]  kasan_save_alloc_info+0x40/0x58
[   33.112113]  __kasan_kmalloc+0xd4/0xd8
[   33.112328]  __kmalloc_cache_noprof+0x16c/0x3c0
[   33.112617]  kmalloc_memmove_invalid_size+0xb0/0x2e0
[   33.112856]  kunit_try_run_case+0x170/0x3f0
[   33.113670]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.114012]  kthread+0x328/0x630
[   33.114124]  ret_from_fork+0x10/0x20
[   33.114614] 
[   33.114705] The buggy address belongs to the object at fff00000c570b300
[   33.114705]  which belongs to the cache kmalloc-64 of size 64
[   33.115233] The buggy address is located 4 bytes inside of
[   33.115233]  allocated 64-byte region [fff00000c570b300, fff00000c570b340)
[   33.115856] 
[   33.115924] The buggy address belongs to the physical page:
[   33.116150] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10570b
[   33.116374] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.116548] page_type: f5(slab)
[   33.116786] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   33.116934] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   33.117045] page dumped because: kasan: bad access detected
[   33.117131] 
[   33.117278] Memory state around the buggy address:
[   33.117356]  fff00000c570b200: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   33.117459]  fff00000c570b280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   33.117559] >fff00000c570b300: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   33.117646]                                            ^
[   33.117733]  fff00000c570b380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.117833]  fff00000c570b400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.117973] ==================================================================

[   21.998854] ==================================================================
[   21.999296] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x16f/0x330
[   21.999741] Read of size 64 at addr ffff888102c02f04 by task kunit_try_catch/211
[   22.000003] 
[   22.000371] CPU: 1 UID: 0 PID: 211 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT(voluntary) 
[   22.000480] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.000503] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.000538] Call Trace:
[   22.000559]  <TASK>
[   22.000589]  dump_stack_lvl+0x73/0xb0
[   22.000639]  print_report+0xd1/0x650
[   22.000669]  ? __virt_addr_valid+0x1db/0x2d0
[   22.000706]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   22.000741]  ? kasan_complete_mode_report_info+0x2a/0x200
[   22.000783]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   22.000807]  kasan_report+0x141/0x180
[   22.000825]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   22.000862]  kasan_check_range+0x10c/0x1c0
[   22.000881]  __asan_memmove+0x27/0x70
[   22.000899]  kmalloc_memmove_invalid_size+0x16f/0x330
[   22.000918]  ? __pfx_kmalloc_memmove_invalid_size+0x10/0x10
[   22.000938]  ? __schedule+0x10cc/0x2b60
[   22.000957]  ? __pfx_read_tsc+0x10/0x10
[   22.000975]  ? ktime_get_ts64+0x86/0x230
[   22.000996]  kunit_try_run_case+0x1a5/0x480
[   22.001017]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.001035]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   22.001053]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.001074]  ? __kthread_parkme+0x82/0x180
[   22.001103]  ? preempt_count_sub+0x50/0x80
[   22.001134]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.001163]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.001193]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.001216]  kthread+0x337/0x6f0
[   22.001232]  ? trace_preempt_on+0x20/0xc0
[   22.001251]  ? __pfx_kthread+0x10/0x10
[   22.001268]  ? _raw_spin_unlock_irq+0x47/0x80
[   22.001285]  ? calculate_sigpending+0x7b/0xa0
[   22.001304]  ? __pfx_kthread+0x10/0x10
[   22.001321]  ret_from_fork+0x116/0x1d0
[   22.001336]  ? __pfx_kthread+0x10/0x10
[   22.001353]  ret_from_fork_asm+0x1a/0x30
[   22.001396]  </TASK>
[   22.001414] 
[   22.014156] Allocated by task 211:
[   22.014429]  kasan_save_stack+0x45/0x70
[   22.014805]  kasan_save_track+0x18/0x40
[   22.015148]  kasan_save_alloc_info+0x3b/0x50
[   22.015316]  __kasan_kmalloc+0xb7/0xc0
[   22.015469]  __kmalloc_cache_noprof+0x189/0x420
[   22.015816]  kmalloc_memmove_invalid_size+0xac/0x330
[   22.016034]  kunit_try_run_case+0x1a5/0x480
[   22.016751]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.016982]  kthread+0x337/0x6f0
[   22.017121]  ret_from_fork+0x116/0x1d0
[   22.017266]  ret_from_fork_asm+0x1a/0x30
[   22.017892] 
[   22.017987] The buggy address belongs to the object at ffff888102c02f00
[   22.017987]  which belongs to the cache kmalloc-64 of size 64
[   22.018656] The buggy address is located 4 bytes inside of
[   22.018656]  allocated 64-byte region [ffff888102c02f00, ffff888102c02f40)
[   22.019991] 
[   22.020247] The buggy address belongs to the physical page:
[   22.020444] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102c02
[   22.021072] flags: 0x200000000000000(node=0|zone=2)
[   22.021484] page_type: f5(slab)
[   22.021611] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   22.022458] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   22.023023] page dumped because: kasan: bad access detected
[   22.023663] 
[   22.023751] Memory state around the buggy address:
[   22.024422]  ffff888102c02e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   22.024824]  ffff888102c02e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   22.025475] >ffff888102c02f00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   22.025881]                                            ^
[   22.026602]  ffff888102c02f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.026896]  ffff888102c03000: fa fb fb fb fc fc fc fc fa fb fb fb fc fc fc fc
[   22.027604] ==================================================================