Skip to content

Commit

Permalink
Merge tag 'hardening-v6.0-rc2' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
torvalds committed Aug 19, 2022
2 parents 8fd0005 + 012e8d2 commit e45c890
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/Makefile.gcc-plugins
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ gcc-plugin-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) += latent_entropy_plugin.so
gcc-plugin-cflags-$(CONFIG_GCC_PLUGIN_LATENT_ENTROPY) \
+= -DLATENT_ENTROPY_PLUGIN
ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY
DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable
DISABLE_LATENT_ENTROPY_PLUGIN += -fplugin-arg-latent_entropy_plugin-disable -ULATENT_ENTROPY_PLUGIN
endif
export DISABLE_LATENT_ENTROPY_PLUGIN

Expand Down
6 changes: 2 additions & 4 deletions security/loadpin/loadpin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e45c890

Please sign in to comment.