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

Environment
qemu-arm64
qemu-x86_64

[   36.937136] ==================================================================
[   36.938253] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x154/0x2e0
[   36.939159] Read of size 18446744073709551614 at addr fff00000c5bc9e04 by task kunit_try_catch/169
[   36.940333] 
[   36.940748] CPU: 1 UID: 0 PID: 169 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   36.942922] Tainted: [B]=BAD_PAGE, [N]=TEST
[   36.943517] Hardware name: linux,dummy-virt (DT)
[   36.944081] Call trace:
[   36.944564]  show_stack+0x20/0x38 (C)
[   36.945148]  dump_stack_lvl+0x8c/0xd0
[   36.946109]  print_report+0x118/0x5e0
[   36.946758]  kasan_report+0xc8/0x118
[   36.947285]  kasan_check_range+0x100/0x1a8
[   36.947974]  __asan_memmove+0x3c/0x98
[   36.948589]  kmalloc_memmove_negative_size+0x154/0x2e0
[   36.949310]  kunit_try_run_case+0x14c/0x3d0
[   36.949950]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   36.950936]  kthread+0x24c/0x2d0
[   36.951489]  ret_from_fork+0x10/0x20
[   36.952094] 
[   36.952436] Allocated by task 169:
[   36.953006]  kasan_save_stack+0x3c/0x68
[   36.953887]  kasan_save_track+0x20/0x40
[   36.954412]  kasan_save_alloc_info+0x40/0x58
[   36.955004]  __kasan_kmalloc+0xd4/0xd8
[   36.955521]  __kmalloc_cache_noprof+0x15c/0x3c8
[   36.956146]  kmalloc_memmove_negative_size+0xb0/0x2e0
[   36.956807]  kunit_try_run_case+0x14c/0x3d0
[   36.957775]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   36.958557]  kthread+0x24c/0x2d0
[   36.959248]  ret_from_fork+0x10/0x20
[   36.959613] 
[   36.959949] The buggy address belongs to the object at fff00000c5bc9e00
[   36.959949]  which belongs to the cache kmalloc-64 of size 64
[   36.961158] The buggy address is located 4 bytes inside of
[   36.961158]  64-byte region [fff00000c5bc9e00, fff00000c5bc9e40)
[   36.962691] 
[   36.963037] The buggy address belongs to the physical page:
[   36.963719] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x105bc9
[   36.964519] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   36.965296] page_type: f5(slab)
[   36.965773] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   36.967028] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000
[   36.967888] page dumped because: kasan: bad access detected
[   36.968488] 
[   36.968819] Memory state around the buggy address:
[   36.969667]  fff00000c5bc9d00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   36.970389]  fff00000c5bc9d80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   36.971146] >fff00000c5bc9e00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   36.972079]                    ^
[   36.972529]  fff00000c5bc9e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.973659]  fff00000c5bc9f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   36.974368] ==================================================================

[   28.409732] ==================================================================
[   28.410735] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x172/0x330
[   28.411398] Read of size 18446744073709551614 at addr ffff8881029dfd04 by task kunit_try_catch/187
[   28.413829] 
[   28.414398] CPU: 1 UID: 0 PID: 187 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241120 #1
[   28.415908] Tainted: [B]=BAD_PAGE, [N]=TEST
[   28.416957] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   28.418200] Call Trace:
[   28.418797]  <TASK>
[   28.419446]  dump_stack_lvl+0x73/0xb0
[   28.419964]  print_report+0xd1/0x640
[   28.420664]  ? __virt_addr_valid+0x1db/0x2d0
[   28.421542]  ? kasan_complete_mode_report_info+0x2a/0x200
[   28.422436]  kasan_report+0x102/0x140
[   28.423002]  ? kmalloc_memmove_negative_size+0x172/0x330
[   28.424009]  ? kmalloc_memmove_negative_size+0x172/0x330
[   28.424764]  kasan_check_range+0x10c/0x1c0
[   28.425080]  __asan_memmove+0x27/0x70
[   28.426150]  kmalloc_memmove_negative_size+0x172/0x330
[   28.427028]  ? __pfx_kmalloc_memmove_negative_size+0x10/0x10
[   28.428127]  ? __schedule+0xc3e/0x2790
[   28.428998]  ? __pfx_read_tsc+0x10/0x10
[   28.429443]  ? ktime_get_ts64+0x84/0x230
[   28.429908]  kunit_try_run_case+0x1b3/0x490
[   28.430914]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.431508]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   28.432063]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   28.432502]  ? __kthread_parkme+0x82/0x160
[   28.432983]  ? preempt_count_sub+0x50/0x80
[   28.433920]  ? __pfx_kunit_try_run_case+0x10/0x10
[   28.434420]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   28.435357]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.435936]  kthread+0x257/0x310
[   28.436667]  ? __pfx_kthread+0x10/0x10
[   28.437084]  ret_from_fork+0x41/0x80
[   28.437543]  ? __pfx_kthread+0x10/0x10
[   28.437972]  ret_from_fork_asm+0x1a/0x30
[   28.438774]  </TASK>
[   28.439140] 
[   28.439487] Allocated by task 187:
[   28.439936]  kasan_save_stack+0x3d/0x60
[   28.440374]  kasan_save_track+0x18/0x40
[   28.440820]  kasan_save_alloc_info+0x3b/0x50
[   28.441457]  __kasan_kmalloc+0xb7/0xc0
[   28.442117]  __kmalloc_cache_noprof+0x184/0x410
[   28.442444]  kmalloc_memmove_negative_size+0xad/0x330
[   28.443638]  kunit_try_run_case+0x1b3/0x490
[   28.444327]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   28.445053]  kthread+0x257/0x310
[   28.445499]  ret_from_fork+0x41/0x80
[   28.445919]  ret_from_fork_asm+0x1a/0x30
[   28.446377] 
[   28.446940] The buggy address belongs to the object at ffff8881029dfd00
[   28.446940]  which belongs to the cache kmalloc-64 of size 64
[   28.447977] The buggy address is located 4 bytes inside of
[   28.447977]  64-byte region [ffff8881029dfd00, ffff8881029dfd40)
[   28.449403] 
[   28.449672] The buggy address belongs to the physical page:
[   28.450132] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1029df
[   28.451054] flags: 0x200000000000000(node=0|zone=2)
[   28.451369] page_type: f5(slab)
[   28.451845] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   28.453015] raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000
[   28.454151] page dumped because: kasan: bad access detected
[   28.454858] 
[   28.455012] Memory state around the buggy address:
[   28.455542]  ffff8881029dfc00: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   28.456527]  ffff8881029dfc80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   28.457488] >ffff8881029dfd00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   28.458445]                    ^
[   28.458919]  ffff8881029dfd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.459591]  ffff8881029dfe00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   28.460637] ==================================================================