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

Environment
qemu-arm64
qemu-x86_64

[   34.201802] ==================================================================
[   34.201946] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x150/0x2f8
[   34.202119] Write of size 2 at addr fff00000c6818877 by task kunit_try_catch/174
[   34.202261] 
[   34.202346] CPU: 1 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N  6.14.0-rc7-next-20250319 #1 PREEMPT 
[   34.202580] Tainted: [B]=BAD_PAGE, [N]=TEST
[   34.202660] Hardware name: linux,dummy-virt (DT)
[   34.202756] Call trace:
[   34.202821]  show_stack+0x20/0x38 (C)
[   34.202985]  dump_stack_lvl+0x8c/0xd0
[   34.203155]  print_report+0x118/0x5f0
[   34.203308]  kasan_report+0xc8/0x118
[   34.203533]  kasan_check_range+0x100/0x1a8
[   34.203766]  __asan_memset+0x34/0x78
[   34.203991]  kmalloc_oob_memset_2+0x150/0x2f8
[   34.204163]  kunit_try_run_case+0x14c/0x3d0
[   34.204303]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.204872]  kthread+0x318/0x618
[   34.205172]  ret_from_fork+0x10/0x20
[   34.205457] 
[   34.205556] Allocated by task 174:
[   34.205645]  kasan_save_stack+0x3c/0x68
[   34.205765]  kasan_save_track+0x20/0x40
[   34.206170]  kasan_save_alloc_info+0x40/0x58
[   34.206297]  __kasan_kmalloc+0xd4/0xd8
[   34.206655]  __kmalloc_cache_noprof+0x15c/0x3c0
[   34.206857]  kmalloc_oob_memset_2+0xb0/0x2f8
[   34.207084]  kunit_try_run_case+0x14c/0x3d0
[   34.207209]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   34.207363]  kthread+0x318/0x618
[   34.207543]  ret_from_fork+0x10/0x20
[   34.207722] 
[   34.207826] The buggy address belongs to the object at fff00000c6818800
[   34.207826]  which belongs to the cache kmalloc-128 of size 128
[   34.208106] The buggy address is located 119 bytes inside of
[   34.208106]  allocated 120-byte region [fff00000c6818800, fff00000c6818878)
[   34.208291] 
[   34.208421] The buggy address belongs to the physical page:
[   34.209402] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106818
[   34.209562] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   34.209715] page_type: f5(slab)
[   34.209799] raw: 0bfffe0000000000 fff00000c0001a00 dead000000000122 0000000000000000
[   34.209881] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   34.209947] page dumped because: kasan: bad access detected
[   34.209999] 
[   34.210028] Memory state around the buggy address:
[   34.210118]  fff00000c6818700: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   34.210262]  fff00000c6818780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.210464] >fff00000c6818800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   34.210608]                                                                 ^
[   34.210740]  fff00000c6818880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.211141]  fff00000c6818900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   34.211478] ==================================================================

[   21.852492] ==================================================================
[   21.853576] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_memset_2+0x166/0x330
[   21.854217] Write of size 2 at addr ffff88810305a477 by task kunit_try_catch/193
[   21.854873] 
[   21.855209] CPU: 0 UID: 0 PID: 193 Comm: kunit_try_catch Tainted: G    B            N  6.14.0-rc7-next-20250319 #1 PREEMPT(voluntary) 
[   21.855342] Tainted: [B]=BAD_PAGE, [N]=TEST
[   21.855376] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   21.855433] Call Trace:
[   21.855467]  <TASK>
[   21.855505]  dump_stack_lvl+0x73/0xb0
[   21.855583]  print_report+0xd1/0x660
[   21.855680]  ? __virt_addr_valid+0x1db/0x2d0
[   21.855805]  ? kasan_complete_mode_report_info+0x2a/0x200
[   21.855878]  kasan_report+0x104/0x140
[   21.856019]  ? kmalloc_oob_memset_2+0x166/0x330
[   21.856179]  ? kmalloc_oob_memset_2+0x166/0x330
[   21.856283]  kasan_check_range+0x10c/0x1c0
[   21.856359]  __asan_memset+0x27/0x50
[   21.856421]  kmalloc_oob_memset_2+0x166/0x330
[   21.856488]  ? __pfx_kmalloc_oob_memset_2+0x10/0x10
[   21.856548]  ? __schedule+0xd46/0x29c0
[   21.856590]  ? __pfx_read_tsc+0x10/0x10
[   21.856622]  ? ktime_get_ts64+0x86/0x240
[   21.856661]  kunit_try_run_case+0x1b2/0x490
[   21.856699]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.856767]  ? _raw_spin_lock_irqsave+0xa1/0x100
[   21.856801]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   21.856833]  ? __kthread_parkme+0x82/0x160
[   21.856864]  ? preempt_count_sub+0x50/0x80
[   21.856900]  ? __pfx_kunit_try_run_case+0x10/0x10
[   21.856933]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.856967]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   21.856999]  kthread+0x323/0x710
[   21.857028]  ? trace_preempt_on+0x20/0xc0
[   21.857062]  ? __pfx_kthread+0x10/0x10
[   21.857093]  ? _raw_spin_unlock_irq+0x47/0x80
[   21.857144]  ? calculate_sigpending+0x7b/0xa0
[   21.857177]  ? __pfx_kthread+0x10/0x10
[   21.857209]  ret_from_fork+0x41/0x80
[   21.857239]  ? __pfx_kthread+0x10/0x10
[   21.857270]  ret_from_fork_asm+0x1a/0x30
[   21.857318]  </TASK>
[   21.857333] 
[   21.873509] Allocated by task 193:
[   21.873892]  kasan_save_stack+0x3d/0x60
[   21.874199]  kasan_save_track+0x18/0x40
[   21.874485]  kasan_save_alloc_info+0x3b/0x50
[   21.875209]  __kasan_kmalloc+0xb7/0xc0
[   21.875742]  __kmalloc_cache_noprof+0x183/0x410
[   21.876253]  kmalloc_oob_memset_2+0xac/0x330
[   21.876776]  kunit_try_run_case+0x1b2/0x490
[   21.877242]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   21.877686]  kthread+0x323/0x710
[   21.878180]  ret_from_fork+0x41/0x80
[   21.878553]  ret_from_fork_asm+0x1a/0x30
[   21.879108] 
[   21.879451] The buggy address belongs to the object at ffff88810305a400
[   21.879451]  which belongs to the cache kmalloc-128 of size 128
[   21.880426] The buggy address is located 119 bytes inside of
[   21.880426]  allocated 120-byte region [ffff88810305a400, ffff88810305a478)
[   21.881601] 
[   21.881852] The buggy address belongs to the physical page:
[   21.882301] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10305a
[   21.883219] flags: 0x200000000000000(node=0|zone=2)
[   21.883691] page_type: f5(slab)
[   21.884012] raw: 0200000000000000 ffff888100041a00 dead000000000122 0000000000000000
[   21.884437] raw: 0000000000000000 0000000080100010 00000000f5000000 0000000000000000
[   21.884821] page dumped because: kasan: bad access detected
[   21.885203] 
[   21.885442] Memory state around the buggy address:
[   21.885891]  ffff88810305a300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
[   21.886776]  ffff88810305a380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.887547] >ffff88810305a400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
[   21.888462]                                                                 ^
[   21.889307]  ffff88810305a480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.889953]  ffff88810305a500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   21.890347] ==================================================================