linux/drivers/vhost
Yufeng Wang 92a7b138f2 vhost/net: fix clear_user start address in VHOST_GET_FEATURES_ARRAY
The clear_user() call in VHOST_GET_FEATURES_ARRAY incorrectly starts
at argp, which is the beginning of the features array, overwriting the
data just written by copy_to_user(). It should start after the copied
elements at argp + copied * sizeof(u64) to only zero the trailing
unused space.

Use size_mul() for both the offset and length calculations so the
arithmetic stays consistent with the surrounding code and remains
overflow-safe.

Fixes: 333c515d18 ("vhost-net: allow configuring extended features")
Signed-off-by: Yufeng Wang <wangyufeng@kylinos.cn>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260626070438.59149-1-r4o5m6e8o@163.com>
History 2026-08-19 06:38:45 -04:00
..
iotlb.c vhost_iotlb: bound map allocation in add_range 2026-08-03 15:21:54 -04:00
Kconfig vhost: Reintroduce kthread API and add mode selection 2025-08-01 09:11:09 -04:00
Makefile vhost: introduce vDPA-based backend 2020-04-02 10:41:40 -04:00
net.c vhost/net: fix clear_user start address in VHOST_GET_FEATURES_ARRAY 2026-08-19 06:38:45 -04:00
scsi.c vhost-scsi: reject feature changes after endpoint 2026-08-03 23:08:15 -04:00
test.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
test.h tools/virtio: Add --reset 2020-06-22 12:34:21 -04:00
vdpa.c vhost/vdpa: reject overflowing PA map page counts on 32-bit 2026-08-03 15:21:54 -04:00
vhost.c vhost: reset the vring metadata cache on vring reconfiguration 2026-08-03 23:08:15 -04:00
vhost.h kcov: refactor common handle ID into kcov_common_handle_id 2026-05-28 21:24:45 -07:00
vringh.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
vsock.c vhost/vsock: Refuse the connection immediately when guest isn't ready 2026-06-10 02:14:01 -04:00