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

Environment
qemu-arm64
qemu-x86_64

[   30.334339] ==================================================================
[   30.335459] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x154/0x2e0
[   30.336544] Read of size 18446744073709551614 at addr fff00000c64e7504 by task kunit_try_catch/169
[   30.337827] 
[   30.338748] CPU: 1 UID: 0 PID: 169 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   30.340163] Tainted: [B]=BAD_PAGE, [N]=TEST
[   30.340719] Hardware name: linux,dummy-virt (DT)
[   30.341425] Call trace:
[   30.341800]  show_stack+0x20/0x38 (C)
[   30.342655]  dump_stack_lvl+0x8c/0xd0
[   30.343747]  print_report+0x118/0x5e0
[   30.344353]  kasan_report+0xc8/0x118
[   30.344919]  kasan_check_range+0x100/0x1a8
[   30.345547]  __asan_memmove+0x3c/0x98
[   30.346202]  kmalloc_memmove_negative_size+0x154/0x2e0
[   30.347013]  kunit_try_run_case+0x14c/0x3d0
[   30.348086]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.348752]  kthread+0x24c/0x2d0
[   30.349261]  ret_from_fork+0x10/0x20
[   30.349810] 
[   30.350162] Allocated by task 169:
[   30.350674]  kasan_save_stack+0x3c/0x68
[   30.351238]  kasan_save_track+0x20/0x40
[   30.351940]  kasan_save_alloc_info+0x40/0x58
[   30.352571]  __kasan_kmalloc+0xd4/0xd8
[   30.353244]  __kmalloc_cache_noprof+0x15c/0x3c0
[   30.354155]  kmalloc_memmove_negative_size+0xb0/0x2e0
[   30.354904]  kunit_try_run_case+0x14c/0x3d0
[   30.355908]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   30.356533]  kthread+0x24c/0x2d0
[   30.357240]  ret_from_fork+0x10/0x20
[   30.357693] 
[   30.358080] The buggy address belongs to the object at fff00000c64e7500
[   30.358080]  which belongs to the cache kmalloc-64 of size 64
[   30.359463] The buggy address is located 4 bytes inside of
[   30.359463]  64-byte region [fff00000c64e7500, fff00000c64e7540)
[   30.361084] 
[   30.361382] The buggy address belongs to the physical page:
[   30.362199] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1064e7
[   30.363186] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   30.364633] page_type: f5(slab)
[   30.365110] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   30.366040] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   30.367025] page dumped because: kasan: bad access detected
[   30.368076] 
[   30.368418] Memory state around the buggy address:
[   30.369024]  fff00000c64e7400: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   30.369990]  fff00000c64e7480: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   30.370889] >fff00000c64e7500: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   30.371829]                    ^
[   30.372413]  fff00000c64e7580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.373440]  fff00000c64e7600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   30.374686] ==================================================================

[   28.118906] ==================================================================
[   28.119787] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x172/0x330
[   28.120730] Read of size 18446744073709551614 at addr ffff888101ab3284 by task kunit_try_catch/187
[   28.122166] 
[   28.122520] CPU: 0 UID: 0 PID: 187 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241205 #1
[   28.123801] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.124385] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.125343] Call Trace:
[   28.125599]  <TASK>
[   28.126107]  dump_stack_lvl+0x73/0xb0
[   28.126809]  print_report+0xd1/0x640
[   28.127357]  ? __virt_addr_valid+0x1db/0x2d0
[   28.127872]  ? kasan_complete_mode_report_info+0x2a/0x200
[   28.128332]  kasan_report+0x102/0x140
[   28.129103]  ? kmalloc_memmove_negative_size+0x172/0x330
[   28.129578]  ? kmalloc_memmove_negative_size+0x172/0x330
[   28.130248]  kasan_check_range+0x10c/0x1c0
[   28.130820]  __asan_memmove+0x27/0x70
[   28.131306]  kmalloc_memmove_negative_size+0x172/0x330
[   28.131862]  ? __pfx_kmalloc_memmove_negative_size+0x10/0x10
[   28.132566]  ? __schedule+0xc70/0x27e0
[   28.132952]  ? __pfx_read_tsc+0x10/0x10
[   28.133518]  ? ktime_get_ts64+0x86/0x230
[   28.134128]  kunit_try_run_case+0x1b3/0x490
[   28.134566]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.135074]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.135479]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.136067]  ? __kthread_parkme+0x82/0x160
[   28.136446]  ? preempt_count_sub+0x50/0x80
[   28.137165]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.137664]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.138504]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.139179]  kthread+0x257/0x310
[   28.139468]  ? __pfx_kthread+0x10/0x10
[   28.140134]  ret_from_fork+0x41/0x80
[   28.140547]  ? __pfx_kthread+0x10/0x10
[   28.141120]  ret_from_fork_asm+0x1a/0x30
[   28.141627]  </TASK>
[   28.141922] 
[   28.142300] Allocated by task 187:
[   28.142649]  kasan_save_stack+0x3d/0x60
[   28.143331]  kasan_save_track+0x18/0x40
[   28.143714]  kasan_save_alloc_info+0x3b/0x50
[   28.144368]  __kasan_kmalloc+0xb7/0xc0
[   28.144646]  __kmalloc_cache_noprof+0x184/0x410
[   28.145355]  kmalloc_memmove_negative_size+0xad/0x330
[   28.146107]  kunit_try_run_case+0x1b3/0x490
[   28.146432]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.147169]  kthread+0x257/0x310
[   28.147593]  ret_from_fork+0x41/0x80
[   28.148265]  ret_from_fork_asm+0x1a/0x30
[   28.148628] 
[   28.148852] The buggy address belongs to the object at ffff888101ab3280
[   28.148852]  which belongs to the cache kmalloc-64 of size 64
[   28.150006] The buggy address is located 4 bytes inside of
[   28.150006]  64-byte region [ffff888101ab3280, ffff888101ab32c0)
[   28.150975] 
[   28.151186] The buggy address belongs to the physical page:
[   28.151938] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101ab3
[   28.152742] flags: 0x200000000000000(node=0|zone=2)
[   28.153372] page_type: f5(slab)
[   28.153930] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   28.155142] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   28.155798] page dumped because: kasan: bad access detected
[   28.156540] 
[   28.156826] Memory state around the buggy address:
[   28.157580]  ffff888101ab3180: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   28.158334]  ffff888101ab3200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   28.159247] >ffff888101ab3280: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   28.159911]                    ^
[   28.160403]  ffff888101ab3300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.161282]  ffff888101ab3380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.162115] ==================================================================