Hay
Date
June 3, 2025, 7:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.394341] ==================================================================
[   18.394401] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x154/0x2e0
[   18.394473] Read of size 64 at addr fff00000c65b5984 by task kunit_try_catch/182
[   18.394521] 
[   18.394553] CPU: 1 UID: 0 PID: 182 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250603 #1 PREEMPT 
[   18.394795] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.394853] Hardware name: linux,dummy-virt (DT)
[   18.394891] Call trace:
[   18.394913]  show_stack+0x20/0x38 (C)
[   18.394964]  dump_stack_lvl+0x8c/0xd0
[   18.395017]  print_report+0x118/0x608
[   18.395065]  kasan_report+0xdc/0x128
[   18.395110]  kasan_check_range+0x100/0x1a8
[   18.395157]  __asan_memmove+0x3c/0x98
[   18.395201]  kmalloc_memmove_invalid_size+0x154/0x2e0
[   18.395252]  kunit_try_run_case+0x170/0x3f0
[   18.395453]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.395545]  kthread+0x328/0x630
[   18.395614]  ret_from_fork+0x10/0x20
[   18.395761] 
[   18.395799] Allocated by task 182:
[   18.395826]  kasan_save_stack+0x3c/0x68
[   18.395868]  kasan_save_track+0x20/0x40
[   18.395905]  kasan_save_alloc_info+0x40/0x58
[   18.395942]  __kasan_kmalloc+0xd4/0xd8
[   18.395979]  __kmalloc_cache_noprof+0x16c/0x3c0
[   18.396045]  kmalloc_memmove_invalid_size+0xb0/0x2e0
[   18.396088]  kunit_try_run_case+0x170/0x3f0
[   18.396128]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.396171]  kthread+0x328/0x630
[   18.396204]  ret_from_fork+0x10/0x20
[   18.396238] 
[   18.396257] The buggy address belongs to the object at fff00000c65b5980
[   18.396257]  which belongs to the cache kmalloc-64 of size 64
[   18.396409] The buggy address is located 4 bytes inside of
[   18.396409]  allocated 64-byte region [fff00000c65b5980, fff00000c65b59c0)
[   18.396537] 
[   18.396590] The buggy address belongs to the physical page:
[   18.396704] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1065b5
[   18.396805] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.396950] page_type: f5(slab)
[   18.397040] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   18.397156] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   18.397259] page dumped because: kasan: bad access detected
[   18.397312] 
[   18.397332] Memory state around the buggy address:
[   18.397583]  fff00000c65b5880: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   18.397669]  fff00000c65b5900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   18.397798] >fff00000c65b5980: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   18.397932]                                            ^
[   18.398018]  fff00000c65b5a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.398089]  fff00000c65b5a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.398168] ==================================================================


[   14.797599] ==================================================================
[   14.798396] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x16f/0x330
[   14.799152] Read of size 64 at addr ffff888103333784 by task kunit_try_catch/199
[   14.799784] 
[   14.800088] CPU: 1 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-next-20250603 #1 PREEMPT(voluntary) 
[   14.800221] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.800247] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.800286] Call Trace:
[   14.800307]  <TASK>
[   14.800342]  dump_stack_lvl+0x73/0xb0
[   14.800405]  print_report+0xd1/0x650
[   14.800446]  ? __virt_addr_valid+0x1db/0x2d0
[   14.800500]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   14.800545]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.800591]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   14.800634]  kasan_report+0x141/0x180
[   14.800714]  ? kmalloc_memmove_invalid_size+0x16f/0x330
[   14.800781]  kasan_check_range+0x10c/0x1c0
[   14.800823]  __asan_memmove+0x27/0x70
[   14.800863]  kmalloc_memmove_invalid_size+0x16f/0x330
[   14.800914]  ? __pfx_kmalloc_memmove_invalid_size+0x10/0x10
[   14.801032]  ? __schedule+0x10cc/0x2b60
[   14.801122]  ? __pfx_read_tsc+0x10/0x10
[   14.801171]  ? ktime_get_ts64+0x86/0x230
[   14.801256]  kunit_try_run_case+0x1a5/0x480
[   14.801306]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.801349]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.801445]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.801551]  ? __kthread_parkme+0x82/0x180
[   14.801615]  ? preempt_count_sub+0x50/0x80
[   14.801669]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.801718]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.801772]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.801827]  kthread+0x337/0x6f0
[   14.801882]  ? trace_preempt_on+0x20/0xc0
[   14.801925]  ? __pfx_kthread+0x10/0x10
[   14.801960]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.801997]  ? calculate_sigpending+0x7b/0xa0
[   14.802036]  ? __pfx_kthread+0x10/0x10
[   14.802071]  ret_from_fork+0x116/0x1d0
[   14.802102]  ? __pfx_kthread+0x10/0x10
[   14.802134]  ret_from_fork_asm+0x1a/0x30
[   14.802185]  </TASK>
[   14.802242] 
[   14.815854] Allocated by task 199:
[   14.816112]  kasan_save_stack+0x45/0x70
[   14.816674]  kasan_save_track+0x18/0x40
[   14.817215]  kasan_save_alloc_info+0x3b/0x50
[   14.817610]  __kasan_kmalloc+0xb7/0xc0
[   14.818045]  __kmalloc_cache_noprof+0x189/0x420
[   14.818450]  kmalloc_memmove_invalid_size+0xac/0x330
[   14.819474]  kunit_try_run_case+0x1a5/0x480
[   14.819824]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.820076]  kthread+0x337/0x6f0
[   14.820267]  ret_from_fork+0x116/0x1d0
[   14.820618]  ret_from_fork_asm+0x1a/0x30
[   14.821123] 
[   14.821323] The buggy address belongs to the object at ffff888103333780
[   14.821323]  which belongs to the cache kmalloc-64 of size 64
[   14.822387] The buggy address is located 4 bytes inside of
[   14.822387]  allocated 64-byte region [ffff888103333780, ffff8881033337c0)
[   14.823301] 
[   14.823453] The buggy address belongs to the physical page:
[   14.823702] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103333
[   14.824904] flags: 0x200000000000000(node=0|zone=2)
[   14.825373] page_type: f5(slab)
[   14.825680] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   14.826531] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   14.826838] page dumped because: kasan: bad access detected
[   14.827054] 
[   14.827172] Memory state around the buggy address:
[   14.827637]  ffff888103333680: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   14.829097]  ffff888103333700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   14.830013] >ffff888103333780: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   14.830682]                                            ^
[   14.831205]  ffff888103333800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.832167]  ffff888103333880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.832990] ==================================================================