mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-13 04:39:36 +02:00
s390/pkey: Wipe sensitive data on failure
[ Upstream commit 1d8c270de5
]
Wipe sensitive data from stack also if the copy_to_user() fails.
Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
d0bbbf3146
commit
90a01aefb8
|
@ -1369,7 +1369,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
|
||||||
if (rc)
|
if (rc)
|
||||||
break;
|
break;
|
||||||
if (copy_to_user(ucs, &kcs, sizeof(kcs)))
|
if (copy_to_user(ucs, &kcs, sizeof(kcs)))
|
||||||
return -EFAULT;
|
rc = -EFAULT;
|
||||||
memzero_explicit(&kcs, sizeof(kcs));
|
memzero_explicit(&kcs, sizeof(kcs));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1404,7 +1404,7 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
|
||||||
if (rc)
|
if (rc)
|
||||||
break;
|
break;
|
||||||
if (copy_to_user(ucp, &kcp, sizeof(kcp)))
|
if (copy_to_user(ucp, &kcp, sizeof(kcp)))
|
||||||
return -EFAULT;
|
rc = -EFAULT;
|
||||||
memzero_explicit(&kcp, sizeof(kcp));
|
memzero_explicit(&kcp, sizeof(kcp));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user