Hay
Date
Dec. 4, 2024, 3:07 p.m.

Environment
qemu-arm64
qemu-x86_64

[   31.864276] ==================================================================
[   31.865558] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_16+0x3a0/0x3f8
[   31.866175] Write of size 16 at addr fff00000c6153d00 by task kunit_try_catch/154
[   31.867258] 
[   31.868031] CPU: 1 UID: 0 PID: 154 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   31.869278] Tainted: [B]=BAD_PAGE, [N]=TEST
[   31.870969] Hardware name: linux,dummy-virt (DT)
[   31.871471] Call trace:
[   31.871776]  show_stack+0x20/0x38 (C)
[   31.872322]  dump_stack_lvl+0x8c/0xd0
[   31.872754]  print_report+0x118/0x5e0
[   31.873593]  kasan_report+0xc8/0x118
[   31.874217]  __asan_report_store16_noabort+0x20/0x30
[   31.875194]  kmalloc_oob_16+0x3a0/0x3f8
[   31.875825]  kunit_try_run_case+0x14c/0x3d0
[   31.876414]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.877510]  kthread+0x24c/0x2d0
[   31.878463]  ret_from_fork+0x10/0x20
[   31.878997] 
[   31.879353] Allocated by task 154:
[   31.879970]  kasan_save_stack+0x3c/0x68
[   31.880557]  kasan_save_track+0x20/0x40
[   31.881454]  kasan_save_alloc_info+0x40/0x58
[   31.882474]  __kasan_kmalloc+0xd4/0xd8
[   31.883037]  __kmalloc_cache_noprof+0x15c/0x3c0
[   31.883686]  kmalloc_oob_16+0xb4/0x3f8
[   31.884315]  kunit_try_run_case+0x14c/0x3d0
[   31.884957]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   31.886298]  kthread+0x24c/0x2d0
[   31.886700]  ret_from_fork+0x10/0x20
[   31.887292] 
[   31.887699] The buggy address belongs to the object at fff00000c6153d00
[   31.887699]  which belongs to the cache kmalloc-16 of size 16
[   31.889313] The buggy address is located 0 bytes inside of
[   31.889313]  allocated 13-byte region [fff00000c6153d00, fff00000c6153d0d)
[   31.890955] 
[   31.891272] The buggy address belongs to the physical page:
[   31.892791] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106153
[   31.893749] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   31.894743] page_type: f5(slab)
[   31.895328] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   31.896381] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   31.897368] page dumped because: kasan: bad access detected
[   31.898411] 
[   31.898741] Memory state around the buggy address:
[   31.899352]  fff00000c6153c00: fa fb fc fc 00 02 fc fc fa fb fc fc fa fb fc fc
[   31.900218]  fff00000c6153c80: fa fb fc fc fa fb fc fc fa fb fc fc 00 04 fc fc
[   31.901612] >fff00000c6153d00: 00 05 fc fc 00 00 fc fc fc fc fc fc fc fc fc fc
[   31.903162]                       ^
[   31.903724]  fff00000c6153d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.904685]  fff00000c6153e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   31.905678] ==================================================================

[   22.676019] ==================================================================
[   22.677345] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_16+0x454/0x4a0
[   22.678909] Write of size 16 at addr ffff888101adf060 by task kunit_try_catch/174
[   22.679830] 
[   22.680186] CPU: 0 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc1-next-20241204 #1
[   22.682123] Tainted: [B]=BAD_PAGE, [N]=TEST
[   22.683007] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   22.684157] Call Trace:
[   22.684718]  <TASK>
[   22.685087]  dump_stack_lvl+0x73/0xb0
[   22.685501]  print_report+0xd1/0x640
[   22.686159]  ? __virt_addr_valid+0x1db/0x2d0
[   22.686997]  ? kasan_complete_mode_report_info+0x2a/0x200
[   22.688084]  kasan_report+0x102/0x140
[   22.688506]  ? kmalloc_oob_16+0x454/0x4a0
[   22.688815]  ? kmalloc_oob_16+0x454/0x4a0
[   22.689315]  __asan_report_store16_noabort+0x1b/0x30
[   22.689911]  kmalloc_oob_16+0x454/0x4a0
[   22.690432]  ? __pfx_kmalloc_oob_16+0x10/0x10
[   22.690809]  ? __schedule+0xc3e/0x2790
[   22.691230]  ? __pfx_read_tsc+0x10/0x10
[   22.692136]  ? ktime_get_ts64+0x86/0x230
[   22.692791]  kunit_try_run_case+0x1b3/0x490
[   22.693215]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.694223]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   22.694565]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   22.695248]  ? __kthread_parkme+0x82/0x160
[   22.695920]  ? preempt_count_sub+0x50/0x80
[   22.696603]  ? __pfx_kunit_try_run_case+0x10/0x10
[   22.696943]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   22.697685]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.698226]  kthread+0x257/0x310
[   22.699032]  ? __pfx_kthread+0x10/0x10
[   22.699804]  ret_from_fork+0x41/0x80
[   22.700723]  ? __pfx_kthread+0x10/0x10
[   22.701036]  ret_from_fork_asm+0x1a/0x30
[   22.701899]  </TASK>
[   22.702402] 
[   22.702810] Allocated by task 174:
[   22.703178]  kasan_save_stack+0x3d/0x60
[   22.704330]  kasan_save_track+0x18/0x40
[   22.704938]  kasan_save_alloc_info+0x3b/0x50
[   22.705910]  __kasan_kmalloc+0xb7/0xc0
[   22.706581]  __kmalloc_cache_noprof+0x184/0x410
[   22.706807]  kmalloc_oob_16+0xa9/0x4a0
[   22.707643]  kunit_try_run_case+0x1b3/0x490
[   22.708608]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   22.709292]  kthread+0x257/0x310
[   22.709703]  ret_from_fork+0x41/0x80
[   22.710276]  ret_from_fork_asm+0x1a/0x30
[   22.710748] 
[   22.711428] The buggy address belongs to the object at ffff888101adf060
[   22.711428]  which belongs to the cache kmalloc-16 of size 16
[   22.712906] The buggy address is located 0 bytes inside of
[   22.712906]  allocated 13-byte region [ffff888101adf060, ffff888101adf06d)
[   22.713837] 
[   22.714834] The buggy address belongs to the physical page:
[   22.715953] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101adf
[   22.717059] flags: 0x200000000000000(node=0|zone=2)
[   22.717641] page_type: f5(slab)
[   22.718238] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   22.719170] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   22.720185] page dumped because: kasan: bad access detected
[   22.720934] 
[   22.721110] Memory state around the buggy address:
[   22.722218]  ffff888101adef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.723312]  ffff888101adef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.723957] >ffff888101adf000: fa fb fc fc 00 04 fc fc 00 05 fc fc 00 05 fc fc
[   22.724900]                                                           ^
[   22.725524]  ffff888101adf080: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.726272]  ffff888101adf100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   22.727116] ==================================================================