Skip to content

Commit e45c890

Browse files
committed
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
2 parents 8fd0005 + 012e8d2 commit e45c890

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

scripts/Makefile.gcc-plugins

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so
44
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) \
55
+= -DLATENT_ENTROPY_PLUGIN
66
ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY
7-
DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable
7+
DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable -ULATENT_ENTROPY_PLUGIN
88
endif
99
export DISABLE_LATENT_ENTROPY_PLUGIN
1010

security/loadpin/loadpin.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,11 @@ static long dm_verity_ioctl(struct file *filp, unsigned int cmd, unsigned long a
356356
{
357357
void __user *uarg = (void __user *)arg;
358358
unsigned int fd;
359-
int rc;
360359

361360
switch (cmd) {
362361
case LOADPIN_IOC_SET_TRUSTED_VERITY_DIGESTS:
363-
rc = copy_from_user(&fd, uarg, sizeof(fd));
364-
if (rc)
365-
return rc;
362+
if (copy_from_user(&fd, uarg, sizeof(fd)))
363+
return -EFAULT;
366364

367365
return read_trusted_verity_root_digests(fd);
368366

0 commit comments

Comments
 (0)