Thread (39 messages) 39 messages, 7 authors, 2025-06-24

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

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help