kernel_optimize_test/drivers/firmware/efi
Javier Martinez Canillas 359efcc2c9 efi/efi_test: Lock down /dev/efi_test and require CAP_SYS_ADMIN
The driver exposes EFI runtime services to user-space through an IOCTL
interface, calling the EFI services function pointers directly without
using the efivar API.

Disallow access to the /dev/efi_test character device when the kernel is
locked down to prevent arbitrary user-space to call EFI runtime services.

Also require CAP_SYS_ADMIN to open the chardev to prevent unprivileged
users to call the EFI runtime services, instead of just relying on the
chardev file mode bits for this.

The main user of this driver is the fwts [0] tool that already checks if
the effective user ID is 0 and fails otherwise. So this change shouldn't
cause any regression to this tool.

[0]: https://wiki.ubuntu.com/FirmwareTestSuite/Reference/uefivarinfo

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Matthew Garrett <mjg59@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: https://lkml.kernel.org/r/20191029173755.27149-7-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2019-10-31 09:40:21 +01:00
..
libstub x86, efi: Never relocate kernel below lowest acceptable address 2019-10-31 09:40:19 +01:00
test efi/efi_test: Lock down /dev/efi_test and require CAP_SYS_ADMIN 2019-10-31 09:40:21 +01:00
apple-properties.c
arm-init.c
arm-runtime.c
capsule-loader.c
capsule.c
cper-arm.c
cper-x86.c
cper.c
dev-path-parser.c
earlycon.c
efi-bgrt.c
efi-pstore.c
efi.c efi/random: Treat EFI_RNG_PROTOCOL output as bootloader randomness 2019-10-31 09:40:18 +01:00
efibc.c
efivars.c
esrt.c
fake_mem.c
Kconfig
Makefile
memattr.c
memmap.c
rci2-table.c
reboot.c
runtime-map.c
runtime-wrappers.c
tpm.c
vars.c