Hay
Date
March 19, 2025, 10:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   34.311864] ==================================================================
[   34.312019] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_16+0x150/0x2f8
[   34.312819] Write of size 16 at addr fff00000c6818b69 by task kunit_try_catch/180
[   34.313185] 
[   34.313464] CPU: 1 UID: 0 PID: 180 Comm: kunit_try_catch Tainted: G    B            N  6.14.0-rc7-next-20250319 #1 PREEMPT 
[   34.313848] Tainted: [B]=BAD_PAGE, [N]=TEST
[   34.314274] Hardware name: linux,dummy-virt (DT)
[   34.314398] Call trace:
[   34.314471]  show_stack+0x20/0x38 (C)
[   34.314623]  dump_stack_lvl+0x8c/0xd0
[   34.314817]  print_report+0x118/0x5f0
[   34.314978]  kasan_report+0xc8/0x118
[   34.315134]  kasan_check_range+0x100/0x1a8
[   34.315370]  __asan_memset+0x34/0x78
[   34.315813]  kmalloc_oob_memset_16+0x150/0x2f8
[   34.316124]  kunit_try_run_case+0x14c/0x3d0
[   34.316629]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.317102]  kthread+0x318/0x618
[   34.317489]  ret_from_fork+0x10/0x20
[   34.317637] 
[   34.319114] Allocated by task 180:
[   34.319212]  kasan_save_stack+0x3c/0x68
[   34.319335]  kasan_save_track+0x20/0x40
[   34.319444]  kasan_save_alloc_info+0x40/0x58
[   34.319562]  __kasan_kmalloc+0xd4/0xd8
[   34.319671]  __kmalloc_cache_noprof+0x15c/0x3c0
[   34.319785]  kmalloc_oob_memset_16+0xb0/0x2f8
[   34.319901]  kunit_try_run_case+0x14c/0x3d0
[   34.320012]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.320175]  kthread+0x318/0x618
[   34.320427]  ret_from_fork+0x10/0x20
[   34.320614] 
[   34.320743] The buggy address belongs to the object at fff00000c6818b00
[   34.320743]  which belongs to the cache kmalloc-128 of size 128
[   34.320930] The buggy address is located 105 bytes inside of
[   34.320930]  allocated 120-byte region [fff00000c6818b00, fff00000c6818b78)
[   34.321218] 
[   34.321481] The buggy address belongs to the physical page:
[   34.323412] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106818
[   34.323589] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   34.324524] page_type: f5(slab)
[   34.324631] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   34.324806] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   34.324939] page dumped because: kasan: bad access detected
[   34.325036] 
[   34.325117] Memory state around the buggy address:
[   34.325216]  fff00000c6818a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   34.325353]  fff00000c6818a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.325488] >fff00000c6818b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   34.325604]                                                                 ^
[   34.325727]  fff00000c6818b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.325856]  fff00000c6818c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.325973] ==================================================================

[   21.991494] ==================================================================
[   21.993249] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_16+0x166/0x330
[   21.994088] Write of size 16 at addr ffff888103210369 by task kunit_try_catch/199
[   21.995283] 
[   21.995467] CPU: 1 UID: 0 PID: 199 Comm: kunit_try_catch Tainted: G    B            N  6.14.0-rc7-next-20250319 #1 PREEMPT(voluntary) 
[   21.995601] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.995653] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.995706] Call Trace:
[   21.995738]  <TASK>
[   21.995773]  dump_stack_lvl+0x73/0xb0
[   21.995853]  print_report+0xd1/0x660
[   21.995919]  ? __virt_addr_valid+0x1db/0x2d0
[   21.996049]  ? kasan_complete_mode_report_info+0x2a/0x200
[   21.996140]  kasan_report+0x104/0x140
[   21.996203]  ? kmalloc_oob_memset_16+0x166/0x330
[   21.996267]  ? kmalloc_oob_memset_16+0x166/0x330
[   21.996344]  kasan_check_range+0x10c/0x1c0
[   21.996411]  __asan_memset+0x27/0x50
[   21.996467]  kmalloc_oob_memset_16+0x166/0x330
[   21.996561]  ? __pfx_kmalloc_oob_memset_16+0x10/0x10
[   21.996652]  ? __pfx_kmalloc_oob_memset_16+0x10/0x10
[   21.996759]  kunit_try_run_case+0x1b2/0x490
[   21.996806]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.996838]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   21.996870]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.996902]  ? __kthread_parkme+0x82/0x160
[   21.996934]  ? preempt_count_sub+0x50/0x80
[   21.996970]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.997004]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.997037]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.997070]  kthread+0x323/0x710
[   21.997099]  ? trace_preempt_on+0x20/0xc0
[   21.997185]  ? __pfx_kthread+0x10/0x10
[   21.997275]  ? _raw_spin_unlock_irq+0x47/0x80
[   21.997310]  ? calculate_sigpending+0x7b/0xa0
[   21.997343]  ? __pfx_kthread+0x10/0x10
[   21.997375]  ret_from_fork+0x41/0x80
[   21.997409]  ? __pfx_kthread+0x10/0x10
[   21.997441]  ret_from_fork_asm+0x1a/0x30
[   21.997489]  </TASK>
[   21.997504] 
[   22.011432] Allocated by task 199:
[   22.011703]  kasan_save_stack+0x3d/0x60
[   22.012162]  kasan_save_track+0x18/0x40
[   22.012572]  kasan_save_alloc_info+0x3b/0x50
[   22.013469]  __kasan_kmalloc+0xb7/0xc0
[   22.014235]  __kmalloc_cache_noprof+0x183/0x410
[   22.014822]  kmalloc_oob_memset_16+0xac/0x330
[   22.015208]  kunit_try_run_case+0x1b2/0x490
[   22.015665]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.016349]  kthread+0x323/0x710
[   22.016613]  ret_from_fork+0x41/0x80
[   22.017056]  ret_from_fork_asm+0x1a/0x30
[   22.017401] 
[   22.017613] The buggy address belongs to the object at ffff888103210300
[   22.017613]  which belongs to the cache kmalloc-128 of size 128
[   22.018709] The buggy address is located 105 bytes inside of
[   22.018709]  allocated 120-byte region [ffff888103210300, ffff888103210378)
[   22.019928] 
[   22.020178] The buggy address belongs to the physical page:
[   22.020962] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x103210
[   22.021426] flags: 0x200000000000000(node=0|zone=2)
[   22.022214] page_type: f5(slab)
[   22.022736] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   22.023424] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   22.024458] page dumped because: kasan: bad access detected
[   22.024993] 
[   22.025179] Memory state around the buggy address:
[   22.025452]  ffff888103210200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   22.025813]  ffff888103210280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.026465] >ffff888103210300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   22.027089]                                                                 ^
[   22.028522]  ffff888103210380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.029096]  ffff888103210400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.029784] ==================================================================