Re: [PATCH v2] misc: vmw_zerocopy: Add VMware zero-copy buffer sharing driver

From: Greg KH

Date: Fri Jun 19 2026 - 01:11:49 EST


On Thu, Jun 18, 2026 at 11:10:34AM -0700, Rishi Chhibber wrote:
> +/*
> + * Used for sending user buffer.
> + * Either is optional but not both.
> + *
> + * Pointers are __u64 so the struct layout is identical on 32-bit and 64-bit
> + * userspace, avoiding a compat_ioctl handler. Use u64_to_user_ptr() in the
> + * driver to convert back to a __user pointer.
> + */
> +struct vmw_zc_guest_data {
> + __u64 buffer;
> + __u32 buffer_length;
> + __u64 metadata;
> + __u32 metadata_length;
> +} __packed;

You have an unaligned metadata pointer here in the structure, are you
sure that's a good idea? Or can you not change that anymore?

> +
> +struct vmw_zc_guest_raw_buffer {
> + __user __u8 raw_buffer[MAX_RAW_BUFFER_LEN];

Why is __user in an ioctl structure? That's an internal-to-the-kernel
marking.

thanks,

greg k-h