s390 fixes for 5.9-rc7

- Fix truncated ZCRYPT_PERDEV_REQCNT ioctl result. Copy entire reqcnt list.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEE3QHqV+H2a8xAv27vjYWKoQLXFBgFAl9vAiwACgkQjYWKoQLX
 FBj+xwf8DvOpBW0mo0D+aYqUrA0ETpeF5GIJe+yG/Sf4ozx7Qk49GvoC2ahEomSN
 jM4V7wkcnbjoPe1Cisv5PfzSf88AaZFJBbcoC7UKHQqVF2N8FVw59I2zI1+TFf6O
 RXtDZYeaVKNT2l40xrkZJudG4FEhlo9W7FZZqgdQy/4YZmof7p8mMQ0VhB/HQuh0
 qsihtefG9PLKYUUw7GvEtrPfrWoyFfwWfMAc00JklPsnwb6Y+heYgdzNM2ElIj6m
 u5dmnZoq7qsyAcwdA1t1TSCYgGSuYjny87NJ6dbe2HPzRFmwIhIAj1Jgr4ubFDBF
 4zZn0S8PDE4r4MEKDfvq9kohQ6uXCQ==
 =+5YA
 -----END PGP SIGNATURE-----

Merge tag 's390-5.9-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 fix from Vasily Gorbik:
 "Fix truncated ZCRYPT_PERDEV_REQCNT ioctl result. Copy entire reqcnt
  list"

* tag 's390-5.9-7' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/zcrypt: Fix ZCRYPT_PERDEV_REQCNT ioctl
This commit is contained in:
Linus Torvalds 2020-09-26 11:01:18 -07:00
commit eeddbe6841
1 changed files with 2 additions and 1 deletions

View File

@ -1449,7 +1449,8 @@ static long zcrypt_unlocked_ioctl(struct file *filp, unsigned int cmd,
if (!reqcnt)
return -ENOMEM;
zcrypt_perdev_reqcnt(reqcnt, AP_DEVICES);
if (copy_to_user((int __user *) arg, reqcnt, sizeof(reqcnt)))
if (copy_to_user((int __user *) arg, reqcnt,
sizeof(u32) * AP_DEVICES))
rc = -EFAULT;
kfree(reqcnt);
return rc;