diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-11-11 07:59:06 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-11-11 07:59:06 +0100 |
commit | 1ca7feb59087a3d1a4ef79e09c42eca5c2e7fa38 (patch) | |
tree | 548d3518b41341b93c88ee4ff5661e1eb42bd7f4 /drivers/firmware/efi/test/efi_test.c | |
parent | perf/core: Optimize perf_init_event() for TYPE_SOFTWARE (diff) | |
parent | Linux 5.4-rc7 (diff) | |
download | linux-dev-1ca7feb59087a3d1a4ef79e09c42eca5c2e7fa38.tar.xz linux-dev-1ca7feb59087a3d1a4ef79e09c42eca5c2e7fa38.zip |
Merge tag 'v5.4-rc7' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/test/efi_test.c')
-rw-r--r-- | drivers/firmware/efi/test/efi_test.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c index 877745c3aaf2..7baf48c01e72 100644 --- a/drivers/firmware/efi/test/efi_test.c +++ b/drivers/firmware/efi/test/efi_test.c @@ -14,6 +14,7 @@ #include <linux/init.h> #include <linux/proc_fs.h> #include <linux/efi.h> +#include <linux/security.h> #include <linux/slab.h> #include <linux/uaccess.h> @@ -717,6 +718,13 @@ static long efi_test_ioctl(struct file *file, unsigned int cmd, static int efi_test_open(struct inode *inode, struct file *file) { + int ret = security_locked_down(LOCKDOWN_EFI_TEST); + + if (ret) + return ret; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; /* * nothing special to do here * We do accept multiple open files at the same time as we |