Hay
Date
July 25, 2025, 3:13 a.m.

Environment
qemu-arm64
qemu-x86_64

[   32.481307] ==================================================================
[   32.481370] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x154/0x2e0
[   32.481426] Read of size 64 at addr fff00000c9b0bc04 by task kunit_try_catch/214
[   32.481509] 
[   32.481554] CPU: 1 UID: 0 PID: 214 Comm: kunit_try_catch Tainted: G    B   W        N  6.16.0-rc7-next-20250725 #1 PREEMPT 
[   32.481652] Tainted: [B]=BAD_PAGE, [W]=WARN, [N]=TEST
[   32.482709] Hardware name: linux,dummy-virt (DT)
[   32.482760] Call trace:
[   32.482909]  show_stack+0x20/0x38 (C)
[   32.482965]  dump_stack_lvl+0x8c/0xd0
[   32.483272]  print_report+0x118/0x5e8
[   32.483328]  kasan_report+0xdc/0x128
[   32.483632]  kasan_check_range+0x100/0x1a8
[   32.483852]  __asan_memmove+0x3c/0x98
[   32.484208]  kmalloc_memmove_invalid_size+0x154/0x2e0
[   32.484309]  kunit_try_run_case+0x170/0x3f0
[   32.484461]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.484519]  kthread+0x328/0x630
[   32.484740]  ret_from_fork+0x10/0x20
[   32.485011] 
[   32.485056] Allocated by task 214:
[   32.485109]  kasan_save_stack+0x3c/0x68
[   32.485212]  kasan_save_track+0x20/0x40
[   32.485431]  kasan_save_alloc_info+0x40/0x58
[   32.485936]  __kasan_kmalloc+0xd4/0xd8
[   32.486037]  __kmalloc_cache_noprof+0x16c/0x3c0
[   32.486390]  kmalloc_memmove_invalid_size+0xb0/0x2e0
[   32.486727]  kunit_try_run_case+0x170/0x3f0
[   32.486792]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   32.487219]  kthread+0x328/0x630
[   32.487317]  ret_from_fork+0x10/0x20
[   32.487367] 
[   32.487520] The buggy address belongs to the object at fff00000c9b0bc00
[   32.487520]  which belongs to the cache kmalloc-64 of size 64
[   32.487752] The buggy address is located 4 bytes inside of
[   32.487752]  allocated 64-byte region [fff00000c9b0bc00, fff00000c9b0bc40)
[   32.487927] 
[   32.487952] The buggy address belongs to the physical page:
[   32.488191] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109b0b
[   32.488774] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   32.488892] page_type: f5(slab)
[   32.489042] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   32.489303] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   32.489504] page dumped because: kasan: bad access detected
[   32.489550] 
[   32.489569] Memory state around the buggy address:
[   32.489830]  fff00000c9b0bb00: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   32.490071]  fff00000c9b0bb80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   32.490167] >fff00000c9b0bc00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   32.490242]                                            ^
[   32.490449]  fff00000c9b0bc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.490714]  fff00000c9b0bd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   32.490961] ==================================================================

[   25.981102] ==================================================================
[   25.981600] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x16f/0x330
[   25.982444] Read of size 64 at addr ffff888106254004 by task kunit_try_catch/231
[   25.982975] 
[   25.983080] CPU: 1 UID: 0 PID: 231 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc7-next-20250725 #1 PREEMPT(voluntary) 
[   25.983232] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.983251] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.983273] Call Trace:
[   25.983286]  <TASK>
[   25.983361]  dump_stack_lvl+0x73/0xb0
[   25.983395]  print_report+0xd1/0x640
[   25.983418]  ? __virt_addr_valid+0x1db/0x2d0
[   25.983443]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   25.983467]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.983493]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   25.983518]  kasan_report+0x141/0x180
[   25.983540]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   25.983569]  kasan_check_range+0x10c/0x1c0
[   25.983593]  __asan_memmove+0x27/0x70
[   25.983617]  kmalloc_memmove_invalid_size+0x16f/0x330
[   25.983642]  ? __pfx_kmalloc_memmove_invalid_size+0x10/0x10
[   25.983668]  ? __schedule+0x10da/0x2b60
[   25.983690]  ? __pfx_read_tsc+0x10/0x10
[   25.983712]  ? ktime_get_ts64+0x86/0x230
[   25.983737]  kunit_try_run_case+0x1a5/0x480
[   25.983761]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.983796]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   25.983819]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.983845]  ? __kthread_parkme+0x82/0x180
[   25.983865]  ? preempt_count_sub+0x50/0x80
[   25.983889]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.983913]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.983937]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.983972]  kthread+0x337/0x6f0
[   25.983992]  ? trace_preempt_on+0x20/0xc0
[   25.984015]  ? __pfx_kthread+0x10/0x10
[   25.984036]  ? _raw_spin_unlock_irq+0x47/0x80
[   25.984115]  ? calculate_sigpending+0x7b/0xa0
[   25.984141]  ? __pfx_kthread+0x10/0x10
[   25.984163]  ret_from_fork+0x116/0x1d0
[   25.984182]  ? __pfx_kthread+0x10/0x10
[   25.984203]  ret_from_fork_asm+0x1a/0x30
[   25.984234]  </TASK>
[   25.984245] 
[   25.994969] Allocated by task 231:
[   25.995421]  kasan_save_stack+0x45/0x70
[   25.995716]  kasan_save_track+0x18/0x40
[   25.996094]  kasan_save_alloc_info+0x3b/0x50
[   25.996388]  __kasan_kmalloc+0xb7/0xc0
[   25.996568]  __kmalloc_cache_noprof+0x189/0x420
[   25.996769]  kmalloc_memmove_invalid_size+0xac/0x330
[   25.997015]  kunit_try_run_case+0x1a5/0x480
[   25.997536]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.997750]  kthread+0x337/0x6f0
[   25.998236]  ret_from_fork+0x116/0x1d0
[   25.998509]  ret_from_fork_asm+0x1a/0x30
[   25.998704] 
[   25.998987] The buggy address belongs to the object at ffff888106254000
[   25.998987]  which belongs to the cache kmalloc-64 of size 64
[   25.999667] The buggy address is located 4 bytes inside of
[   25.999667]  allocated 64-byte region [ffff888106254000, ffff888106254040)
[   26.000497] 
[   26.000723] The buggy address belongs to the physical page:
[   26.001033] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106254
[   26.001629] flags: 0x200000000000000(node=0|zone=2)
[   26.001861] page_type: f5(slab)
[   26.002347] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   26.002746] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   26.003290] page dumped because: kasan: bad access detected
[   26.003497] 
[   26.003587] Memory state around the buggy address:
[   26.003808]  ffff888106253f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.004096]  ffff888106253f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.004782] >ffff888106254000: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   26.005314]                                            ^
[   26.005626]  ffff888106254080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.005958]  ffff888106254100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   26.006737] ==================================================================