Re: [PATCH v4 net-next 3/8] vhost-net: allow configuring extended features
From: Paolo Abeni <pabeni@redhat.com>
Date: 2025-06-19 20:13:10
From: Paolo Abeni <pabeni@redhat.com>
Date: 2025-06-19 20:13:10
On 6/19/25 5:00 PM, Akihiko Odaki wrote:
On 2025/06/18 1:12, Paolo Abeni wrote:quoted
+ + /* Any feature specified by user-space above VIRTIO_FEATURES_MAX is + * not supported by definition. + */ + for (; i < count; ++i) { + if (copy_from_user(&features, argp, sizeof(u64)))get_user() is a simpler alternative.
That would require an explicit cast of 'argp' to a suitable pointer type, which is IMHO uglier. I prefer sticking with copy_from_user(). Side note: there is a bug in this loop, as it lacks the needed increment of the src pointer at every iteration. /P