Hay
Date
Nov. 22, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   33.987285] ==================================================================
[   33.988643] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x154/0x2e8
[   33.989625] Read of size 64 at addr fff00000c63c3684 by task kunit_try_catch/171
[   33.991161] 
[   33.991570] CPU: 1 UID: 0 PID: 171 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241122 #1
[   33.993355] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.994050] Hardware name: linux,dummy-virt (DT)
[   33.994724] Call trace:
[   33.995305]  show_stack+0x20/0x38 (C)
[   33.996179]  dump_stack_lvl+0x8c/0xd0
[   33.997124]  print_report+0x118/0x5e0
[   33.998153]  kasan_report+0xc8/0x118
[   33.998791]  kasan_check_range+0x100/0x1a8
[   33.999511]  __asan_memmove+0x3c/0x98
[   34.000184]  kmalloc_memmove_invalid_size+0x154/0x2e8
[   34.001487]  kunit_try_run_case+0x14c/0x3d0
[   34.002572]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.003630]  kthread+0x24c/0x2d0
[   34.004149]  ret_from_fork+0x10/0x20
[   34.004811] 
[   34.005128] Allocated by task 171:
[   34.006302]  kasan_save_stack+0x3c/0x68
[   34.006938]  kasan_save_track+0x20/0x40
[   34.007502]  kasan_save_alloc_info+0x40/0x58
[   34.008242]  __kasan_kmalloc+0xd4/0xd8
[   34.009532]  __kmalloc_cache_noprof+0x15c/0x3c8
[   34.011104]  kmalloc_memmove_invalid_size+0xb0/0x2e8
[   34.012108]  kunit_try_run_case+0x14c/0x3d0
[   34.012729]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.013979]  kthread+0x24c/0x2d0
[   34.014475]  ret_from_fork+0x10/0x20
[   34.014854] 
[   34.016107] The buggy address belongs to the object at fff00000c63c3680
[   34.016107]  which belongs to the cache kmalloc-64 of size 64
[   34.018128] The buggy address is located 4 bytes inside of
[   34.018128]  allocated 64-byte region [fff00000c63c3680, fff00000c63c36c0)
[   34.019880] 
[   34.020512] The buggy address belongs to the physical page:
[   34.021498] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1063c3
[   34.022662] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   34.023641] page_type: f5(slab)
[   34.024368] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   34.025670] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000
[   34.026835] page dumped because: kasan: bad access detected
[   34.027764] 
[   34.028145] Memory state around the buggy address:
[   34.028920]  fff00000c63c3580: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   34.030073]  fff00000c63c3600: 00 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc
[   34.031483] >fff00000c63c3680: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   34.032960]                                            ^
[   34.034566]  fff00000c63c3700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.035612]  fff00000c63c3780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.036749] ==================================================================

[   25.391164] ==================================================================
[   25.392369] BUG: KASAN: slab-out-of-bounds in kmalloc_memmove_invalid_size+0x170/0x330
[   25.394144] Read of size 64 at addr ffff888101aad504 by task kunit_try_catch/190
[   25.394807] 
[   25.395292] CPU: 0 UID: 0 PID: 190 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241122 #1
[   25.396159] Tainted: [B]=BAD_PAGE, [N]=TEST
[   25.396789] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   25.397484] Call Trace:
[   25.397894]  <TASK>
[   25.398300]  dump_stack_lvl+0x73/0xb0
[   25.398764]  print_report+0xd1/0x640
[   25.399574]  ? __virt_addr_valid+0x1db/0x2d0
[   25.400149]  ? kasan_complete_mode_report_info+0x2a/0x200
[   25.400900]  kasan_report+0x102/0x140
[   25.401176]  ? kmalloc_memmove_invalid_size+0x170/0x330
[   25.401530]  ? kmalloc_memmove_invalid_size+0x170/0x330
[   25.402628]  kasan_check_range+0x10c/0x1c0
[   25.403096]  __asan_memmove+0x27/0x70
[   25.403503]  kmalloc_memmove_invalid_size+0x170/0x330
[   25.404777]  ? __pfx_kmalloc_memmove_invalid_size+0x10/0x10
[   25.405733]  ? __schedule+0xc3e/0x2790
[   25.406534]  ? __pfx_read_tsc+0x10/0x10
[   25.407076]  ? ktime_get_ts64+0x84/0x230
[   25.407449]  kunit_try_run_case+0x1b3/0x490
[   25.408098]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.408623]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   25.409243]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   25.409771]  ? __kthread_parkme+0x82/0x160
[   25.410163]  ? preempt_count_sub+0x50/0x80
[   25.410571]  ? __pfx_kunit_try_run_case+0x10/0x10
[   25.411354]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   25.412147]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.412536]  kthread+0x257/0x310
[   25.413007]  ? __pfx_kthread+0x10/0x10
[   25.413453]  ret_from_fork+0x41/0x80
[   25.414030]  ? __pfx_kthread+0x10/0x10
[   25.414499]  ret_from_fork_asm+0x1a/0x30
[   25.415348]  </TASK>
[   25.415536] 
[   25.415748] Allocated by task 190:
[   25.416122]  kasan_save_stack+0x3d/0x60
[   25.416523]  kasan_save_track+0x18/0x40
[   25.416964]  kasan_save_alloc_info+0x3b/0x50
[   25.417589]  __kasan_kmalloc+0xb7/0xc0
[   25.418169]  __kmalloc_cache_noprof+0x184/0x410
[   25.418563]  kmalloc_memmove_invalid_size+0xad/0x330
[   25.419478]  kunit_try_run_case+0x1b3/0x490
[   25.419759]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   25.420478]  kthread+0x257/0x310
[   25.420840]  ret_from_fork+0x41/0x80
[   25.421320]  ret_from_fork_asm+0x1a/0x30
[   25.421627] 
[   25.422020] The buggy address belongs to the object at ffff888101aad500
[   25.422020]  which belongs to the cache kmalloc-64 of size 64
[   25.423451] The buggy address is located 4 bytes inside of
[   25.423451]  allocated 64-byte region [ffff888101aad500, ffff888101aad540)
[   25.424374] 
[   25.424574] The buggy address belongs to the physical page:
[   25.425077] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101aad
[   25.425520] flags: 0x200000000000000(node=0|zone=2)
[   25.426293] page_type: f5(slab)
[   25.426610] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   25.427571] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000
[   25.428418] page dumped because: kasan: bad access detected
[   25.429120] 
[   25.429364] Memory state around the buggy address:
[   25.429696]  ffff888101aad400: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.430372]  ffff888101aad480: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   25.431441] >ffff888101aad500: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   25.432199]                                            ^
[   25.432590]  ffff888101aad580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.433186]  ffff888101aad600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.433548] ==================================================================