Hay
Date
June 23, 2025, 7:07 a.m.

Environment
qemu-arm64
qemu-x86_64

[   33.074168] ==================================================================
[   33.074416] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x154/0x2e0
[   33.074606] Read of size 18446744073709551614 at addr fff00000c570b104 by task kunit_try_catch/192
[   33.074823] 
[   33.074900] CPU: 1 UID: 0 PID: 192 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT 
[   33.075127] Tainted: [B]=BAD_PAGE, [N]=TEST
[   33.075163] Hardware name: linux,dummy-virt (DT)
[   33.075205] Call trace:
[   33.075232]  show_stack+0x20/0x38 (C)
[   33.075298]  dump_stack_lvl+0x8c/0xd0
[   33.075357]  print_report+0x118/0x608
[   33.075413]  kasan_report+0xdc/0x128
[   33.075470]  kasan_check_range+0x100/0x1a8
[   33.075530]  __asan_memmove+0x3c/0x98
[   33.075587]  kmalloc_memmove_negative_size+0x154/0x2e0
[   33.075650]  kunit_try_run_case+0x170/0x3f0
[   33.075706]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.075769]  kthread+0x328/0x630
[   33.075824]  ret_from_fork+0x10/0x20
[   33.075881] 
[   33.075905] Allocated by task 192:
[   33.075940]  kasan_save_stack+0x3c/0x68
[   33.075994]  kasan_save_track+0x20/0x40
[   33.076068]  kasan_save_alloc_info+0x40/0x58
[   33.076120]  __kasan_kmalloc+0xd4/0xd8
[   33.076165]  __kmalloc_cache_noprof+0x16c/0x3c0
[   33.076216]  kmalloc_memmove_negative_size+0xb0/0x2e0
[   33.076266]  kunit_try_run_case+0x170/0x3f0
[   33.076312]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   33.076365]  kthread+0x328/0x630
[   33.076404]  ret_from_fork+0x10/0x20
[   33.076446] 
[   33.076471] The buggy address belongs to the object at fff00000c570b100
[   33.076471]  which belongs to the cache kmalloc-64 of size 64
[   33.076538] The buggy address is located 4 bytes inside of
[   33.076538]  64-byte region [fff00000c570b100, fff00000c570b140)
[   33.076605] 
[   33.076631] The buggy address belongs to the physical page:
[   33.076667] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10570b
[   33.076729] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   33.076788] page_type: f5(slab)
[   33.076831] raw: 0bfffe0000000000 fff00000c00018c0 dead000000000122 0000000000000000
[   33.076890] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   33.076934] page dumped because: kasan: bad access detected
[   33.076971] 
[   33.076992] Memory state around the buggy address:
[   33.077294]  fff00000c570b000: 00 00 00 00 01 fc fc fc fc fc fc fc fc fc fc fc
[   33.077421]  fff00000c570b080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   33.077854] >fff00000c570b100: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   33.077974]                    ^
[   33.078136]  fff00000c570b180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.078619]  fff00000c570b200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   33.078975] ==================================================================

[   21.970409] ==================================================================
[   21.970814] BUG: KASAN: out-of-bounds in kmalloc_memmove_negative_size+0x171/0x330
[   21.971463] Read of size 18446744073709551614 at addr ffff8881023b5804 by task kunit_try_catch/209
[   21.972279] 
[   21.972448] CPU: 0 UID: 0 PID: 209 Comm: kunit_try_catch Tainted: G    B            N  6.16.0-rc3-next-20250623 #1 PREEMPT(voluntary) 
[   21.972501] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.972512] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.972531] Call Trace:
[   21.972544]  <TASK>
[   21.972560]  dump_stack_lvl+0x73/0xb0
[   21.972591]  print_report+0xd1/0x650
[   21.972610]  ? __virt_addr_valid+0x1db/0x2d0
[   21.972629]  ? kmalloc_memmove_negative_size+0x171/0x330
[   21.972649]  ? kasan_complete_mode_report_info+0x2a/0x200
[   21.972671]  ? kmalloc_memmove_negative_size+0x171/0x330
[   21.972720]  kasan_report+0x141/0x180
[   21.972741]  ? kmalloc_memmove_negative_size+0x171/0x330
[   21.972766]  kasan_check_range+0x10c/0x1c0
[   21.972786]  __asan_memmove+0x27/0x70
[   21.972806]  kmalloc_memmove_negative_size+0x171/0x330
[   21.972829]  ? __pfx_kmalloc_memmove_negative_size+0x10/0x10
[   21.973096]  ? __schedule+0x10cc/0x2b60
[   21.973136]  ? __pfx_read_tsc+0x10/0x10
[   21.973170]  ? ktime_get_ts64+0x86/0x230
[   21.973263]  kunit_try_run_case+0x1a5/0x480
[   21.973309]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.973337]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   21.973358]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.973392]  ? __kthread_parkme+0x82/0x180
[   21.973413]  ? preempt_count_sub+0x50/0x80
[   21.973434]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.973454]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.973474]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.973495]  kthread+0x337/0x6f0
[   21.973511]  ? trace_preempt_on+0x20/0xc0
[   21.973531]  ? __pfx_kthread+0x10/0x10
[   21.973548]  ? _raw_spin_unlock_irq+0x47/0x80
[   21.973565]  ? calculate_sigpending+0x7b/0xa0
[   21.973585]  ? __pfx_kthread+0x10/0x10
[   21.973603]  ret_from_fork+0x116/0x1d0
[   21.973619]  ? __pfx_kthread+0x10/0x10
[   21.973636]  ret_from_fork_asm+0x1a/0x30
[   21.973663]  </TASK>
[   21.973674] 
[   21.981815] Allocated by task 209:
[   21.981999]  kasan_save_stack+0x45/0x70
[   21.982218]  kasan_save_track+0x18/0x40
[   21.982414]  kasan_save_alloc_info+0x3b/0x50
[   21.982560]  __kasan_kmalloc+0xb7/0xc0
[   21.982707]  __kmalloc_cache_noprof+0x189/0x420
[   21.982883]  kmalloc_memmove_negative_size+0xac/0x330
[   21.983069]  kunit_try_run_case+0x1a5/0x480
[   21.983370]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.983743]  kthread+0x337/0x6f0
[   21.984120]  ret_from_fork+0x116/0x1d0
[   21.984424]  ret_from_fork_asm+0x1a/0x30
[   21.984715] 
[   21.985343] The buggy address belongs to the object at ffff8881023b5800
[   21.985343]  which belongs to the cache kmalloc-64 of size 64
[   21.986513] The buggy address is located 4 bytes inside of
[   21.986513]  64-byte region [ffff8881023b5800, ffff8881023b5840)
[   21.987412] 
[   21.987733] The buggy address belongs to the physical page:
[   21.988309] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1023b5
[   21.988644] flags: 0x200000000000000(node=0|zone=2)
[   21.989097] page_type: f5(slab)
[   21.989264] raw: 0200000000000000 ffff8881000418c0 dead000000000122 0000000000000000
[   21.989577] raw: 0000000000000000 0000000080200020 00000000f5000000 0000000000000000
[   21.990167] page dumped because: kasan: bad access detected
[   21.990583] 
[   21.990751] Memory state around the buggy address:
[   21.991290]  ffff8881023b5700: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.991690]  ffff8881023b5780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
[   21.992092] >ffff8881023b5800: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
[   21.992641]                    ^
[   21.992806]  ffff8881023b5880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.993416]  ffff8881023b5900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.993729] ==================================================================