Re: smatch and copy_{to,from}_user return values
Heiko Carstens <[email protected]> Thu, 4 Mar 2021 19:35:36 +0100
| Newsgroups | org.kernel.vger.smatch,org.kernel.vger.linux-s390 |
|---|---|
| Message-ID | <YEEoeIR7X2kSSYkW@osiris> |
On Wed, Mar 03, 2021 at 08:50:19AM +0100, Rasmus Villemoes wrote:
> Hi Dan
>
> If you look at vfio_ccw_mdev_ioctl() in drivers/s390/cio/vfio_ccw_ops.c,
> and vfio_ap_mdev_get_device_info() in drivers/s390/crypto/vfio_ap_ops.c,
> there are examples of functions that can both return -Esomething as well
> as may return the return value of a copy_{to,from}_user directly (i.e.,
> in case of error some positive number).
>
> [Those "return copy_to_user();" should probably all be changed to
> "return copy_to_user() ? -EFAULT : 0;" - cc'ing the s390 list in case
> the maintainers want to do that.]
This has been reported just a couple of days ago - fixes will go
upstream soon.
Thanks for reporting anyway!