summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-08-19 13:56:14 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-08-19 13:56:14 -0700
commite45c890140c8c2c9f3dd475c14bdf084c4cd2296 (patch)
treefd018056ddaeddccbbe449bc5e795db5653ca8c5 /security
parent8fd00059cc13c7f170451e9318a9a5e772b88e17 (diff)
parent012e8d2034f1bda8863435cd589636e618d6a659 (diff)
downloadlinux-e45c890140c8c2c9f3dd475c14bdf084c4cd2296.tar.gz
linux-e45c890140c8c2c9f3dd475c14bdf084c4cd2296.tar.bz2
linux-e45c890140c8c2c9f3dd475c14bdf084c4cd2296.zip
Merge tag 'hardening-v6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull hardening fixes from Kees Cook: - Also undef LATENT_ENTROPY_PLUGIN for per-file disabling (Andrew Donnellan) - Return EFAULT on copy_from_user() failures in LoadPin (Kees Cook) * tag 'hardening-v6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file LoadPin: Return EFAULT on copy_from_user() failures
Diffstat (limited to 'security')
-rw-r--r--security/loadpin/loadpin.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/security/loadpin/loadpin.c b/security/loadpin/loadpin.c
index 6ab5f2bbf41f..44521582dcba 100644
--- a/security/loadpin/loadpin.c
+++ b/security/loadpin/loadpin.c
@@ -356,13 +356,11 @@ static long dm_verity_ioctl(struct file *filp, unsigned int cmd, unsigned long a
{
void __user *uarg = (void __user *)arg;
unsigned int fd;
- int rc;
switch (cmd) {
case LOADPIN_IOC_SET_TRUSTED_VERITY_DIGESTS:
- rc = copy_from_user(&fd, uarg, sizeof(fd));
- if (rc)
- return rc;
+ if (copy_from_user(&fd, uarg, sizeof(fd)))
+ return -EFAULT;
return read_trusted_verity_root_digests(fd);