Skip to content

Commit

Permalink
acpi: Disable APEI error injection if securelevel is set
Browse files Browse the repository at this point in the history
ACPI provides an error injection mechanism, EINJ, for debugging and testing
the ACPI Platform Error Interface (APEI) and other RAS features. If
supported by the firmware, ACPI specification 5.0 and later provide for a
way to specify a physical memory address to which to inject the error.

Injecting errors through EINJ can produce errors which to the platform are
indistinguishable from real hardware errors. This can have undesirable
side-effects, such as causing the platform to mark hardware as needing
replacement.

While it does not provide a method to load unauthenticated privileged code,
the effect of these errors may persist across reboots and affect trust in
the underlying hardware, so disable error injection through EINJ if
securelevel is set.

Signed-off-by: Linn Crosetto <linn@hpe.com>
  • Loading branch information
Linn Crosetto authored and Matthew Garrett committed Apr 3, 2016
1 parent a4a5ed2 commit d7a6be5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/acpi/apei/einj.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/nmi.h>
#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/security.h>
#include <asm/unaligned.h>

#include "apei-internal.h"
Expand Down Expand Up @@ -521,6 +522,9 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
int rc;
u64 base_addr, size;

if (get_securelevel() > 0)
return -EPERM;

/* If user manually set "flags", make sure it is legal */
if (flags && (flags &
~(SETWA_FLAGS_APICID|SETWA_FLAGS_MEM|SETWA_FLAGS_PCIE_SBDF)))
Expand Down

0 comments on commit d7a6be5

Please sign in to comment.