Hay
Date
Dec. 9, 2024, 6:35 a.m.

Environment
qemu-arm64
qemu-x86_64

[   24.108995] ==================================================================
[   24.109990] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_16+0x3a0/0x3f8
[   24.110746] Write of size 16 at addr fff00000c6361160 by task kunit_try_catch/154
[   24.111716] 
[   24.112479] CPU: 1 UID: 0 PID: 154 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   24.114036] Tainted: [B]=BAD_PAGE, [N]=TEST
[   24.114998] Hardware name: linux,dummy-virt (DT)
[   24.115650] Call trace:
[   24.116112]  show_stack+0x20/0x38 (C)
[   24.116732]  dump_stack_lvl+0x8c/0xd0
[   24.117317]  print_report+0x118/0x5e0
[   24.117866]  kasan_report+0xc8/0x118
[   24.118389]  __asan_report_store16_noabort+0x20/0x30
[   24.119130]  kmalloc_oob_16+0x3a0/0x3f8
[   24.119600]  kunit_try_run_case+0x14c/0x3d0
[   24.120265]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.121076]  kthread+0x24c/0x2d0
[   24.121623]  ret_from_fork+0x10/0x20
[   24.122208] 
[   24.122598] Allocated by task 154:
[   24.123186]  kasan_save_stack+0x3c/0x68
[   24.123824]  kasan_save_track+0x20/0x40
[   24.124469]  kasan_save_alloc_info+0x40/0x58
[   24.125164]  __kasan_kmalloc+0xd4/0xd8
[   24.125788]  __kmalloc_cache_noprof+0x15c/0x3c0
[   24.126436]  kmalloc_oob_16+0xb4/0x3f8
[   24.127193]  kunit_try_run_case+0x14c/0x3d0
[   24.127984]  kunit_generic_run_threadfn_adapter+0x88/0x100
[   24.128775]  kthread+0x24c/0x2d0
[   24.129247]  ret_from_fork+0x10/0x20
[   24.130034] 
[   24.130352] The buggy address belongs to the object at fff00000c6361160
[   24.130352]  which belongs to the cache kmalloc-16 of size 16
[   24.132107] The buggy address is located 0 bytes inside of
[   24.132107]  allocated 13-byte region [fff00000c6361160, fff00000c636116d)
[   24.133417] 
[   24.133641] The buggy address belongs to the physical page:
[   24.134651] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x106361
[   24.135882] flags: 0xbfffe0000000000(node=0|zone=2|lastcpupid=0x1ffff)
[   24.136629] page_type: f5(slab)
[   24.137112] raw: 0bfffe0000000000 fff00000c0001640 dead000000000122 0000000000000000
[   24.137940] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   24.138775] page dumped because: kasan: bad access detected
[   24.139346] 
[   24.139661] Memory state around the buggy address:
[   24.140519]  fff00000c6361000: 00 02 fc fc 00 02 fc fc 00 05 fc fc fa fb fc fc
[   24.141292]  fff00000c6361080: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   24.142117] >fff00000c6361100: fa fb fc fc fa fb fc fc fa fb fc fc 00 05 fc fc
[   24.143081]                                                           ^
[   24.143824]  fff00000c6361180: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.144603]  fff00000c6361200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.145376] ==================================================================

[   23.973472] ==================================================================
[   23.975571] BUG: KASAN: slab-out-of-bounds in kmalloc_oob_16+0x454/0x4a0
[   23.976871] Write of size 16 at addr ffff888101b7dc20 by task kunit_try_catch/173
[   23.978249] 
[   23.978448] CPU: 0 UID: 0 PID: 173 Comm: kunit_try_catch Tainted: G    B            N 6.13.0-rc2-next-20241209 #1
[   23.979685] Tainted: [B]=BAD_PAGE, [N]=TEST
[   23.980193] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
[   23.981165] Call Trace:
[   23.981776]  <TASK>
[   23.982033]  dump_stack_lvl+0x73/0xb0
[   23.983396]  print_report+0xd1/0x640
[   23.984497]  ? __virt_addr_valid+0x1db/0x2d0
[   23.984985]  ? kasan_complete_mode_report_info+0x2a/0x200
[   23.985769]  kasan_report+0x102/0x140
[   23.986210]  ? kmalloc_oob_16+0x454/0x4a0
[   23.986897]  ? kmalloc_oob_16+0x454/0x4a0
[   23.987833]  __asan_report_store16_noabort+0x1b/0x30
[   23.988215]  kmalloc_oob_16+0x454/0x4a0
[   23.989670]  ? __pfx_kmalloc_oob_16+0x10/0x10
[   23.990100]  ? __schedule+0xc70/0x27e0
[   23.990989]  ? __pfx_read_tsc+0x10/0x10
[   23.991558]  ? ktime_get_ts64+0x86/0x230
[   23.992443]  kunit_try_run_case+0x1b3/0x490
[   23.992895]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.993701]  ? _raw_spin_lock_irqsave+0xa2/0x110
[   23.994360]  ? _raw_spin_unlock_irqrestore+0x5f/0x90
[   23.995521]  ? __kthread_parkme+0x82/0x160
[   23.996521]  ? preempt_count_sub+0x50/0x80
[   23.997249]  ? __pfx_kunit_try_run_case+0x10/0x10
[   23.998515]  ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10
[   23.999040]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   23.999623]  kthread+0x257/0x310
[   24.000430]  ? __pfx_kthread+0x10/0x10
[   24.000977]  ret_from_fork+0x41/0x80
[   24.002087]  ? __pfx_kthread+0x10/0x10
[   24.003099]  ret_from_fork_asm+0x1a/0x30
[   24.003654]  </TASK>
[   24.004428] 
[   24.004663] Allocated by task 173:
[   24.005985]  kasan_save_stack+0x3d/0x60
[   24.006769]  kasan_save_track+0x18/0x40
[   24.007422]  kasan_save_alloc_info+0x3b/0x50
[   24.007754]  __kasan_kmalloc+0xb7/0xc0
[   24.008407]  __kmalloc_cache_noprof+0x184/0x410
[   24.009083]  kmalloc_oob_16+0xa9/0x4a0
[   24.010528]  kunit_try_run_case+0x1b3/0x490
[   24.011558]  kunit_generic_run_threadfn_adapter+0x85/0xf0
[   24.012748]  kthread+0x257/0x310
[   24.013089]  ret_from_fork+0x41/0x80
[   24.013732]  ret_from_fork_asm+0x1a/0x30
[   24.014762] 
[   24.015027] The buggy address belongs to the object at ffff888101b7dc20
[   24.015027]  which belongs to the cache kmalloc-16 of size 16
[   24.016938] The buggy address is located 0 bytes inside of
[   24.016938]  allocated 13-byte region [ffff888101b7dc20, ffff888101b7dc2d)
[   24.018683] 
[   24.018922] The buggy address belongs to the physical page:
[   24.020064] page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x101b7d
[   24.021389] flags: 0x200000000000000(node=0|zone=2)
[   24.022170] page_type: f5(slab)
[   24.022558] raw: 0200000000000000 ffff888100041640 dead000000000122 0000000000000000
[   24.024062] raw: 0000000000000000 0000000080800080 00000000f5000000 0000000000000000
[   24.024823] page dumped because: kasan: bad access detected
[   24.025389] 
[   24.025586] Memory state around the buggy address:
[   24.026628]  ffff888101b7db00: 00 05 fc fc 00 02 fc fc 00 02 fc fc 00 02 fc fc
[   24.027691]  ffff888101b7db80: 00 02 fc fc fa fb fc fc fa fb fc fc fa fb fc fc
[   24.028966] >ffff888101b7dc00: 00 05 fc fc 00 05 fc fc 00 00 fc fc fc fc fc fc
[   24.029769]                                   ^
[   24.030801]  ffff888101b7dc80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.031792]  ffff888101b7dd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
[   24.032079] ==================================================================