aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/test/efi_test.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2019-11-14 05:53:10 +1000
committerDave Airlie <airlied@redhat.com>2019-11-14 05:53:10 +1000
commit77e0723bd27f830d0903225372aa778fe2975648 (patch)
tree4c035783e014b3a0ac9174390f88dc75150533e4 /drivers/firmware/efi/test/efi_test.c
parentMerge tag 'drm-misc-next-fixes-2019-11-06' of git://anongit.freedesktop.org/drm/drm-misc into drm-next (diff)
parentLinux 5.4-rc7 (diff)
downloadlinux-dev-77e0723bd27f830d0903225372aa778fe2975648.tar.xz
linux-dev-77e0723bd27f830d0903225372aa778fe2975648.zip
Merge v5.4-rc7 into drm-next
We have the i915 security fixes to backmerge, but first let's clear the decks for other drivers to avoid a bigger mess. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/firmware/efi/test/efi_test.c')
-rw-r--r--drivers/firmware/efi/test/efi_test.c8
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