Hay
Date
May 15, 2025, 10:38 a.m.

Environment
qemu-arm64
qemu-x86_64

[   18.032217] ==================================================================
[   18.032271] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   18.032318] Write of size 2 at addr fff00000c68f1377 by task kunit_try_catch/172
[   18.032798] 
[   18.033058] CPU: 1 UID: 0 PID: 172 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT 
[   18.033415] Tainted: [B]=BAD_PAGE, [N]=TEST
[   18.033690] Hardware name: linux,dummy-virt (DT)
[   18.033778] Call trace:
[   18.034119]  show_stack+0x20/0x38 (C)
[   18.034354]  dump_stack_lvl+0x8c/0xd0
[   18.034717]  print_report+0x118/0x608
[   18.034892]  kasan_report+0xdc/0x128
[   18.035056]  kasan_check_range+0x100/0x1a8
[   18.035152]  __asan_memset+0x34/0x78
[   18.035355]  kmalloc_oob_memset_2+0x150/0x2f8
[   18.035493]  kunit_try_run_case+0x170/0x3f0
[   18.035541]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.035741]  kthread+0x328/0x630
[   18.035909]  ret_from_fork+0x10/0x20
[   18.036120] 
[   18.036367] Allocated by task 172:
[   18.036538]  kasan_save_stack+0x3c/0x68
[   18.036625]  kasan_save_track+0x20/0x40
[   18.036797]  kasan_save_alloc_info+0x40/0x58
[   18.036954]  __kasan_kmalloc+0xd4/0xd8
[   18.037034]  __kmalloc_cache_noprof+0x15c/0x3c0
[   18.037273]  kmalloc_oob_memset_2+0xb0/0x2f8
[   18.037334]  kunit_try_run_case+0x170/0x3f0
[   18.037370]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   18.037411]  kthread+0x328/0x630
[   18.037583]  ret_from_fork+0x10/0x20
[   18.037656] 
[   18.037686] The buggy address belongs to the object at fff00000c68f1300
[   18.037686]  which belongs to the cache kmalloc-128 of size 128
[   18.037974] The buggy address is located 119 bytes inside of
[   18.037974]  allocated 120-byte region [fff00000c68f1300, fff00000c68f1378)
[   18.038194] 
[   18.038261] The buggy address belongs to the physical page:
[   18.038660] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1068f1
[   18.038739] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   18.038964] page_type: f5(slab)
[   18.039342] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   18.039431] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   18.039722] page dumped because: kasan: bad access detected
[   18.039795] 
[   18.039862] Memory state around the buggy address:
[   18.040300]  fff00000c68f1200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   18.040386]  fff00000c68f1280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.040826] >fff00000c68f1300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   18.040923]                                                                 ^
[   18.040993]  fff00000c68f1380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.041369]  fff00000c68f1400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   18.041535] ==================================================================


[   14.143160] ==================================================================
[   14.143881] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   14.144082] Write of size 2 at addr ffff8881022f9d77 by task kunit_try_catch/190
[   14.144216] 
[   14.144361] CPU: 1 UID: 0 PID: 190 Comm: kunit_try_catch Tainted: G    B            N  6.15.0-rc6-next-20250515 #1 PREEMPT(voluntary) 
[   14.144450] Tainted: [B]=BAD_PAGE, [N]=TEST
[   14.144470] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   14.144504] Call Trace:
[   14.144529]  <TASK>
[   14.144562]  dump_stack_lvl+0x73/0xb0
[   14.144611]  print_report+0xd1/0x650
[   14.144647]  ? __virt_addr_valid+0x1db/0x2d0
[   14.144682]  ? kmalloc_oob_memset_2+0x166/0x330
[   14.145153]  ? kasan_complete_mode_report_info+0x2a/0x200
[   14.145206]  ? kmalloc_oob_memset_2+0x166/0x330
[   14.145256]  kasan_report+0x141/0x180
[   14.145302]  ? kmalloc_oob_memset_2+0x166/0x330
[   14.145390]  kasan_check_range+0x10c/0x1c0
[   14.145607]  __asan_memset+0x27/0x50
[   14.145672]  kmalloc_oob_memset_2+0x166/0x330
[   14.145710]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   14.145734]  ? __schedule+0x10cc/0x2b60
[   14.145758]  ? __pfx_read_tsc+0x10/0x10
[   14.145779]  ? ktime_get_ts64+0x86/0x230
[   14.145803]  kunit_try_run_case+0x1a5/0x480
[   14.145827]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.145847]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   14.145870]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   14.145890]  ? __kthread_parkme+0x82/0x180
[   14.145911]  ? preempt_count_sub+0x50/0x80
[   14.145934]  ? __pfx_kunit_try_run_case+0x10/0x10
[   14.145957]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.145978]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   14.145999]  kthread+0x337/0x6f0
[   14.146017]  ? trace_preempt_on+0x20/0xc0
[   14.146041]  ? __pfx_kthread+0x10/0x10
[   14.146061]  ? _raw_spin_unlock_irq+0x47/0x80
[   14.146080]  ? calculate_sigpending+0x7b/0xa0
[   14.146104]  ? __pfx_kthread+0x10/0x10
[   14.146124]  ret_from_fork+0x116/0x1d0
[   14.146142]  ? __pfx_kthread+0x10/0x10
[   14.146161]  ret_from_fork_asm+0x1a/0x30
[   14.146192]  </TASK>
[   14.146204] 
[   14.157858] Allocated by task 190:
[   14.158079]  kasan_save_stack+0x45/0x70
[   14.158657]  kasan_save_track+0x18/0x40
[   14.158914]  kasan_save_alloc_info+0x3b/0x50
[   14.159097]  __kasan_kmalloc+0xb7/0xc0
[   14.159345]  __kmalloc_cache_noprof+0x189/0x420
[   14.160257]  kmalloc_oob_memset_2+0xac/0x330
[   14.160882]  kunit_try_run_case+0x1a5/0x480
[   14.161285]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   14.161664]  kthread+0x337/0x6f0
[   14.162028]  ret_from_fork+0x116/0x1d0
[   14.162411]  ret_from_fork_asm+0x1a/0x30
[   14.162844] 
[   14.163011] The buggy address belongs to the object at ffff8881022f9d00
[   14.163011]  which belongs to the cache kmalloc-128 of size 128
[   14.164183] The buggy address is located 119 bytes inside of
[   14.164183]  allocated 120-byte region [ffff8881022f9d00, ffff8881022f9d78)
[   14.164741] 
[   14.164918] The buggy address belongs to the physical page:
[   14.165357] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1022f9
[   14.165987] flags: 0x200000000000000(node=0|zone=2)
[   14.166439] page_type: f5(slab)
[   14.166868] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   14.167316] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   14.168125] page dumped because: kasan: bad access detected
[   14.168785] 
[   14.168990] Memory state around the buggy address:
[   14.169233]  ffff8881022f9c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   14.169599]  ffff8881022f9c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.170258] >ffff8881022f9d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   14.170879]                                                                 ^
[   14.171235]  ffff8881022f9d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.171527]  ffff8881022f9e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   14.171992] ==================================================================