Commit f7e80983 authored by Christian Borntraeger's avatar Christian Borntraeger Committed by Vasily Gorbik
Browse files

s390/zcrypt: Fix ZCRYPT_PERDEV_REQCNT ioctl



reqcnt is an u32 pointer but we do copy sizeof(reqcnt) which is the
size of the pointer. This means we only copy 8 byte. Let us copy
the full monty.

Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Cc: Harald Freudenberger <freude@linux.ibm.com>
Cc: stable@vger.kernel.org
Fixes: af4a7227 ("s390/zcrypt: Support up to 256 crypto adapters.")
Reviewed-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent ba4f184e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;