mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
ACPI: Limit access to custom_method when the kernel is locked down
custom_method effectively allows arbitrary access to system memory, making it possible for an attacker to circumvent restrictions on module loading. Disable it if the kernel is locked down. Signed-off-by: Matthew Garrett <mjg59@google.com> Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Kees Cook <keescook@chromium.org> cc: linux-acpi@vger.kernel.org Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
committed by
James Morris
parent
95f5e95f41
commit
f474e1486b
@@ -9,6 +9,7 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/security.h>
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
@@ -29,6 +30,11 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
|
||||
|
||||
struct acpi_table_header table;
|
||||
acpi_status status;
|
||||
int ret;
|
||||
|
||||
ret = security_locked_down(LOCKDOWN_ACPI_TABLES);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!(*ppos)) {
|
||||
/* parse the table header to get the table length */
|
||||
|
||||
Reference in New Issue
Block a user