Hay
Date
Dec. 5, 2024, 2:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   30.384990] ==================================================================
[   30.386189] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x154/0x2e8
[   30.387030] Read of size 64 at addr fff00000c63c2104 by task kunit_try_catch/171
[   30.388628] 
[   30.389015] CPU: 0 UID: 0 PID: 171 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   30.390327] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.390858] Hardware name: linux,dummy-virt (DT)
[   30.391647] Call trace:
[   30.392182]  show_stack+0x20/0x38 (C)
[   30.392734]  dump_stack_lvl+0x8c/0xd0
[   30.393390]  print_report+0x118/0x5e0
[   30.393991]  kasan_report+0xc8/0x118
[   30.394572]  kasan_check_range+0x100/0x1a8
[   30.395264]  __asan_memmove+0x3c/0x98
[   30.395808]  kmalloc_memmove_invalid_size+0x154/0x2e8
[   30.396491]  kunit_try_run_case+0x14c/0x3d0
[   30.397135]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.398071]  kthread+0x24c/0x2d0
[   30.398552]  ret_from_fork+0x10/0x20
[   30.399181] 
[   30.399829] Allocated by task 171:
[   30.400235]  kasan_save_stack+0x3c/0x68
[   30.400807]  kasan_save_track+0x20/0x40
[   30.401364]  kasan_save_alloc_info+0x40/0x58
[   30.401891]  __kasan_kmalloc+0xd4/0xd8
[   30.402502]  __kmalloc_cache_noprof+0x15c/0x3c0
[   30.403054]  kmalloc_memmove_invalid_size+0xb0/0x2e8
[   30.403930]  kunit_try_run_case+0x14c/0x3d0
[   30.405113]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.405791]  kthread+0x24c/0x2d0
[   30.406306]  ret_from_fork+0x10/0x20
[   30.406789] 
[   30.407147] The buggy address belongs to the object at fff00000c63c2100
[   30.407147]  which belongs to the cache kmalloc-64 of size 64
[   30.408512] The buggy address is located 4 bytes inside of
[   30.408512]  allocated 64-byte region [fff00000c63c2100, fff00000c63c2140)
[   30.410361] 
[   30.410718] The buggy address belongs to the physical page:
[   30.411262] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063c2
[   30.412490] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.413366] page_type: f5(slab)
[   30.413957] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   30.414909] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   30.416111] page dumped because: kasan: bad access detected
[   30.416802] 
[   30.417149] Memory state around the buggy address:
[   30.417725]  fff00000c63c2000: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   30.418663]  fff00000c63c2080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   30.419864] >fff00000c63c2100: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   30.420772]                                            ^
[   30.421476]  fff00000c63c2180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.422461]  fff00000c63c2200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.423425] ==================================================================

[   28.168822] ==================================================================
[   28.170045] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x170/0x330
[   28.170993] Read of size 64 at addr ffff888101ab3404 by task kunit_try_catch/189
[   28.171913] 
[   28.172579] CPU: 0 UID: 0 PID: 189 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   28.173926] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.174665] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.175577] Call Trace:
[   28.176165]  <TASK>
[   28.176427]  dump_stack_lvl+0x73/0xb0
[   28.177492]  print_report+0xd1/0x640
[   28.177972]  ? __virt_addr_valid+0x1db/0x2d0
[   28.178552]  ? kasan_complete_mode_report_info+0x2a/0x200
[   28.179561]  kasan_report+0x102/0x140
[   28.180667]  ? kmalloc_memmove_invalid_size+0x170/0x330
[   28.181587]  ? kmalloc_memmove_invalid_size+0x170/0x330
[   28.182188]  kasan_check_range+0x10c/0x1c0
[   28.182699]  __asan_memmove+0x27/0x70
[   28.183129]  kmalloc_memmove_invalid_size+0x170/0x330
[   28.183747]  ? __pfx_kmalloc_memmove_invalid_size+0x10/0x10
[   28.184398]  ? __schedule+0xc70/0x27e0
[   28.185037]  ? __pfx_read_tsc+0x10/0x10
[   28.185972]  ? ktime_get_ts64+0x86/0x230
[   28.186912]  kunit_try_run_case+0x1b3/0x490
[   28.187382]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.188246]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.188796]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.189543]  ? __kthread_parkme+0x82/0x160
[   28.190183]  ? preempt_count_sub+0x50/0x80
[   28.190579]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.191356]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.191863]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.192422]  kthread+0x257/0x310
[   28.192790]  ? __pfx_kthread+0x10/0x10
[   28.193143]  ret_from_fork+0x41/0x80
[   28.193769]  ? __pfx_kthread+0x10/0x10
[   28.194398]  ret_from_fork_asm+0x1a/0x30
[   28.194814]  </TASK>
[   28.195118] 
[   28.195297] Allocated by task 189:
[   28.195620]  kasan_save_stack+0x3d/0x60
[   28.195940]  kasan_save_track+0x18/0x40
[   28.196491]  kasan_save_alloc_info+0x3b/0x50
[   28.197288]  __kasan_kmalloc+0xb7/0xc0
[   28.197642]  __kmalloc_cache_noprof+0x184/0x410
[   28.198724]  kmalloc_memmove_invalid_size+0xad/0x330
[   28.199885]  kunit_try_run_case+0x1b3/0x490
[   28.200462]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.201625]  kthread+0x257/0x310
[   28.202470]  ret_from_fork+0x41/0x80
[   28.203256]  ret_from_fork_asm+0x1a/0x30
[   28.203851] 
[   28.204057] The buggy address belongs to the object at ffff888101ab3400
[   28.204057]  which belongs to the cache kmalloc-64 of size 64
[   28.205153] The buggy address is located 4 bytes inside of
[   28.205153]  allocated 64-byte region [ffff888101ab3400, ffff888101ab3440)
[   28.206934] 
[   28.207534] The buggy address belongs to the physical page:
[   28.208458] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101ab3
[   28.209456] flags: 0x200000000000000(node=0|zone=2)
[   28.210495] page_type: f5(slab)
[   28.211435] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   28.212419] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   28.213279] page dumped because: kasan: bad access detected
[   28.214125] 
[   28.214325] Memory state around the buggy address:
[   28.214822]  ffff888101ab3300: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   28.216092]  ffff888101ab3380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   28.216756] >ffff888101ab3400: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   28.217620]                                            ^
[   28.218798]  ffff888101ab3480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.220612]  ffff888101ab3500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.221601] ==================================================================