Hay
Date
July 8, 2025, 11:10 a.m.

Environment
qemu-arm64
qemu-x86_64

[   31.221765] ==================================================================
[   31.221828] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x154/0x2e0
[   31.221885] Read of size 64 at addr fff00000c9acb284 by task kunit_try_catch/213
[   31.221952] 
[   31.221984] CPU: 0 UID: 0 PID: 213 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT 
[   31.222546] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.222578] Hardware name: linux,dummy-virt (DT)
[   31.222714] Call trace:
[   31.222741]  show_stack+0x20/0x38 (C)
[   31.222792]  dump_stack_lvl+0x8c/0xd0
[   31.222839]  print_report+0x118/0x5d0
[   31.222886]  kasan_report+0xdc/0x128
[   31.222931]  kasan_check_range+0x100/0x1a8
[   31.222983]  __asan_memmove+0x3c/0x98
[   31.223120]  kmalloc_memmove_invalid_size+0x154/0x2e0
[   31.223222]  kunit_try_run_case+0x170/0x3f0
[   31.223273]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.223573]  kthread+0x328/0x630
[   31.223941]  ret_from_fork+0x10/0x20
[   31.224205] 
[   31.224241] Allocated by task 213:
[   31.224272]  kasan_save_stack+0x3c/0x68
[   31.224315]  kasan_save_track+0x20/0x40
[   31.224553]  kasan_save_alloc_info+0x40/0x58
[   31.224744]  __kasan_kmalloc+0xd4/0xd8
[   31.224795]  __kmalloc_cache_noprof+0x16c/0x3c0
[   31.224868]  kmalloc_memmove_invalid_size+0xb0/0x2e0
[   31.224911]  kunit_try_run_case+0x170/0x3f0
[   31.224950]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.224995]  kthread+0x328/0x630
[   31.225038]  ret_from_fork+0x10/0x20
[   31.225147] 
[   31.225175] The buggy address belongs to the object at fff00000c9acb280
[   31.225175]  which belongs to the cache kmalloc-64 of size 64
[   31.225245] The buggy address is located 4 bytes inside of
[   31.225245]  allocated 64-byte region [fff00000c9acb280, fff00000c9acb2c0)
[   31.225423] 
[   31.225456] The buggy address belongs to the physical page:
[   31.225489] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x109acb
[   31.225545] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.225595] page_type: f5(slab)
[   31.225634] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   31.225684] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   31.225726] page dumped because: kasan: bad access detected
[   31.225759] 
[   31.226404] Memory state around the buggy address:
[   31.226468]  fff00000c9acb180: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   31.226513]  fff00000c9acb200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   31.226991] >fff00000c9acb280: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   31.227033]                                            ^
[   31.227100]  fff00000c9acb300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.227154]  fff00000c9acb380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.227459] ==================================================================

[   23.558115] ==================================================================
[   23.559427] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x16f/0x330
[   23.560307] Read of size 64 at addr ffff8881059b5d04 by task kunit_try_catch/230
[   23.561228] 
[   23.561344] CPU: 0 UID: 0 PID: 230 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc5-next-20250708 #1 PREEMPT(voluntary) 
[   23.561402] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.561415] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.561438] Call Trace:
[   23.561453]  <TASK>
[   23.561473]  dump_stack_lvl+0x73/0xb0
[   23.561508]  print_report+0xd1/0x610
[   23.561533]  ? __virt_addr_valid+0x1db/0x2d0
[   23.561559]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   23.561584]  ? kasan_complete_mode_report_info+0x2a/0x200
[   23.561612]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   23.561638]  kasan_report+0x141/0x180
[   23.561661]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   23.561691]  kasan_check_range+0x10c/0x1c0
[   23.561716]  __asan_memmove+0x27/0x70
[   23.561743]  kmalloc_memmove_invalid_size+0x16f/0x330
[   23.561780]  ? __pfx_kmalloc_memmove_invalid_size+0x10/0x10
[   23.561806]  ? __schedule+0x10cc/0x2b60
[   23.561848]  ? __pfx_read_tsc+0x10/0x10
[   23.562040]  ? ktime_get_ts64+0x86/0x230
[   23.562071]  kunit_try_run_case+0x1a5/0x480
[   23.562097]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.562118]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   23.562140]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.562168]  ? __kthread_parkme+0x82/0x180
[   23.562190]  ? preempt_count_sub+0x50/0x80
[   23.562214]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.562236]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.562274]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.562301]  kthread+0x337/0x6f0
[   23.562322]  ? trace_preempt_on+0x20/0xc0
[   23.562348]  ? __pfx_kthread+0x10/0x10
[   23.562370]  ? _raw_spin_unlock_irq+0x47/0x80
[   23.562397]  ? calculate_sigpending+0x7b/0xa0
[   23.562425]  ? __pfx_kthread+0x10/0x10
[   23.562448]  ret_from_fork+0x116/0x1d0
[   23.562467]  ? __pfx_kthread+0x10/0x10
[   23.562490]  ret_from_fork_asm+0x1a/0x30
[   23.562525]  </TASK>
[   23.562538] 
[   23.577171] Allocated by task 230:
[   23.577516]  kasan_save_stack+0x45/0x70
[   23.577909]  kasan_save_track+0x18/0x40
[   23.578231]  kasan_save_alloc_info+0x3b/0x50
[   23.578394]  __kasan_kmalloc+0xb7/0xc0
[   23.578519]  __kmalloc_cache_noprof+0x189/0x420
[   23.578670]  kmalloc_memmove_invalid_size+0xac/0x330
[   23.578851]  kunit_try_run_case+0x1a5/0x480
[   23.578989]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.579266]  kthread+0x337/0x6f0
[   23.579433]  ret_from_fork+0x116/0x1d0
[   23.579595]  ret_from_fork_asm+0x1a/0x30
[   23.579864] 
[   23.580019] The buggy address belongs to the object at ffff8881059b5d00
[   23.580019]  which belongs to the cache kmalloc-64 of size 64
[   23.581090] The buggy address is located 4 bytes inside of
[   23.581090]  allocated 64-byte region [ffff8881059b5d00, ffff8881059b5d40)
[   23.582259] 
[   23.582425] The buggy address belongs to the physical page:
[   23.582963] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1059b5
[   23.583636] flags: 0x200000000000000(node=0|zone=2)
[   23.583826] page_type: f5(slab)
[   23.584099] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   23.584741] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   23.585290] page dumped because: kasan: bad access detected
[   23.585457] 
[   23.585520] Memory state around the buggy address:
[   23.585671]  ffff8881059b5c00: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   23.585894]  ffff8881059b5c80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   23.586357] >ffff8881059b5d00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   23.586600]                                            ^
[   23.586957]  ffff8881059b5d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.587271]  ffff8881059b5e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   23.587548] ==================================================================