Hay
Date
Nov. 27, 2024, 3:37 a.m.

Environment
qemu-arm64
qemu-x86_64

[   47.727702] ==================================================================
[   47.728730] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_16+0x3a0/0x3f8
[   47.729470] Write of size 16 at addr fff00000c40dc7a0 by task kunit_try_catch/155
[   47.731327] 
[   47.731762] CPU: 1 UID: 0 PID: 155 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241127 #1
[   47.732898] Tainted: [B]=BAD_PAGE, [N]=TEST
[   47.733690] Hardware name: linux,dummy-virt (DT)
[   47.734809] Call trace:
[   47.735351]  show_stack+0x20/0x38 (C)
[   47.735869]  dump_stack_lvl+0x8c/0xd0
[   47.736430]  print_report+0x118/0x5e0
[   47.736972]  kasan_report+0xc8/0x118
[   47.737507]  __asan_report_store16_noabort+0x20/0x30
[   47.738585]  kmalloc_oob_16+0x3a0/0x3f8
[   47.739146]  kunit_try_run_case+0x14c/0x3d0
[   47.739779]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   47.740518]  kthread+0x24c/0x2d0
[   47.741035]  ret_from_fork+0x10/0x20
[   47.741635] 
[   47.741942] Allocated by task 155:
[   47.742601]  kasan_save_stack+0x3c/0x68
[   47.743228]  kasan_save_track+0x20/0x40
[   47.744017]  kasan_save_alloc_info+0x40/0x58
[   47.744633]  __kasan_kmalloc+0xd4/0xd8
[   47.745075]  __kmalloc_cache_noprof+0x15c/0x3c0
[   47.746054]  kmalloc_oob_16+0xb4/0x3f8
[   47.746600]  kunit_try_run_case+0x14c/0x3d0
[   47.747238]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   47.747977]  kthread+0x24c/0x2d0
[   47.748520]  ret_from_fork+0x10/0x20
[   47.749380] 
[   47.749733] The buggy address belongs to the object at fff00000c40dc7a0
[   47.749733]  which belongs to the cache kmalloc-16 of size 16
[   47.751057] The buggy address is located 0 bytes inside of
[   47.751057]  allocated 13-byte region [fff00000c40dc7a0, fff00000c40dc7ad)
[   47.752577] 
[   47.752861] The buggy address belongs to the physical page:
[   47.753863] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1040dc
[   47.754883] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   47.755517] page_type: f5(slab)
[   47.756093] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   47.757331] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   47.758137] page dumped because: kasan: bad access detected
[   47.758828] 
[   47.759169] Memory state around the buggy address:
[   47.759767]  fff00000c40dc680: 00 00 fc fc 00 06 fc fc 00 06 fc fc fa fb fc fc
[   47.760589]  fff00000c40dc700: 00 06 fc fc 00 06 fc fc fa fb fc fc fa fb fc fc
[   47.761684] >fff00000c40dc780: fa fb fc fc 00 05 fc fc 00 00 fc fc fc fc fc fc
[   47.762675]                                   ^
[   47.763225]  fff00000c40dc800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   47.764176]  fff00000c40dc880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   47.765022] ==================================================================

[   24.956534] ==================================================================
[   24.957648] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_16+0x454/0x4a0
[   24.959122] Write of size 16 at addr ffff888102699d20 by task kunit_try_catch/174
[   24.960827] 
[   24.961507] CPU: 0 UID: 0 PID: 174 Comm: kunit_try_catch Tainted: G    B            N 6.12.0-next-20241127 #1
[   24.962374] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.962956] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   24.963782] Call Trace:
[   24.964055]  <TASK>
[   24.964713]  dump_stack_lvl+0x73/0xb0
[   24.965528]  print_report+0xd1/0x640
[   24.965924]  ? __virt_addr_valid+0x1db/0x2d0
[   24.966271]  ? kasan_complete_mode_report_info+0x2a/0x200
[   24.967568]  kasan_report+0x102/0x140
[   24.968425]  ? kmalloc_oob_16+0x454/0x4a0
[   24.969101]  ? kmalloc_oob_16+0x454/0x4a0
[   24.969677]  __asan_report_store16_noabort+0x1b/0x30
[   24.970496]  kmalloc_oob_16+0x454/0x4a0
[   24.970905]  ? __pfx_kmalloc_oob_16+0x10/0x10
[   24.971861]  ? __schedule+0xc3e/0x2790
[   24.972330]  ? __pfx_read_tsc+0x10/0x10
[   24.972624]  ? ktime_get_ts64+0x84/0x230
[   24.973118]  kunit_try_run_case+0x1b3/0x490
[   24.973856]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.974340]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   24.974940]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   24.975525]  ? __kthread_parkme+0x82/0x160
[   24.976169]  ? preempt_count_sub+0x50/0x80
[   24.976652]  ? __pfx_kunit_try_run_case+0x10/0x10
[   24.976971]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   24.977873]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.978611]  kthread+0x257/0x310
[   24.979362]  ? __pfx_kthread+0x10/0x10
[   24.979825]  ret_from_fork+0x41/0x80
[   24.980222]  ? __pfx_kthread+0x10/0x10
[   24.980500]  ret_from_fork_asm+0x1a/0x30
[   24.981211]  </TASK>
[   24.981585] 
[   24.981840] Allocated by task 174:
[   24.982460]  kasan_save_stack+0x3d/0x60
[   24.982801]  kasan_save_track+0x18/0x40
[   24.983186]  kasan_save_alloc_info+0x3b/0x50
[   24.983855]  __kasan_kmalloc+0xb7/0xc0
[   24.984255]  __kmalloc_cache_noprof+0x184/0x410
[   24.985172]  kmalloc_oob_16+0xa9/0x4a0
[   24.985571]  kunit_try_run_case+0x1b3/0x490
[   24.985866]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.986659]  kthread+0x257/0x310
[   24.987226]  ret_from_fork+0x41/0x80
[   24.987494]  ret_from_fork_asm+0x1a/0x30
[   24.987802] 
[   24.988176] The buggy address belongs to the object at ffff888102699d20
[   24.988176]  which belongs to the cache kmalloc-16 of size 16
[   24.989560] The buggy address is located 0 bytes inside of
[   24.989560]  allocated 13-byte region [ffff888102699d20, ffff888102699d2d)
[   24.990689] 
[   24.990848] The buggy address belongs to the physical page:
[   24.991638] page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102699
[   24.992702] flags: 0x200000000000000(node=0|zone=2)
[   24.993466] page_type: f5(slab)
[   24.993715] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   24.994521] raw: 0000000000000000 0000000080800080 00000001f5000000 0000000000000000
[   24.995664] page dumped because: kasan: bad access detected
[   24.996363] 
[   24.996591] Memory state around the buggy address:
[   24.997095]  ffff888102699c00: 00 02 fc fc 00 02 fc fc 00 02 fc fc fa fb fc fc
[   24.997802]  ffff888102699c80: fa fb fc fc fa fb fc fc 00 05 fc fc 00 04 fc fc
[   24.998689] >ffff888102699d00: fa fb fc fc 00 05 fc fc 00 00 fc fc fc fc fc fc
[   24.999112]                                   ^
[   24.999516]  ffff888102699d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.000613]  ffff888102699e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   25.001525] ==================================================================