Re: [PATCH v9] pidfd: add ioctl to retrieve pid info

From: Christian Brauner
Date: Thu Oct 10 2024 - 05:26:18 EST


> > + /*
> > + * If userspace and the kernel have the same struct size it can just
> > + * be copied. If userspace provides an older struct, only the bits that
> > + * userspace knows about will be copied. If userspace provides a new
> > + * struct, only the bits that the kernel knows about will be copied and
> > + * the size value will be set to the size the kernel knows about.
> > + */
> > + if (copy_to_user(uinfo, &kinfo, min(usize, sizeof(kinfo))))
> > + return -EFAULT;
>
> Which "size value" are you referring to here; I can't see it.

Luca did just copy my comment from another interface which has a
separate size parameter. This should indeed be fixed.