dbc4a9b
From: Matthew Garrett <matthew.garrett@nebula.com>
dbc4a9b
Date: Fri, 9 Mar 2012 08:39:37 -0500
dbc4a9b
Subject: [PATCH] ACPI: Limit access to custom_method
dbc4a9b
dbc4a9b
custom_method effectively allows arbitrary access to system memory, making
dbc4a9b
it possible for an attacker to circumvent restrictions on module loading.
dbc4a9b
Disable it if any such restrictions have been enabled.
dbc4a9b
dbc4a9b
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
dbc4a9b
---
dbc4a9b
 drivers/acpi/custom_method.c | 3 +++
dbc4a9b
 1 file changed, 3 insertions(+)
dbc4a9b
dbc4a9b
diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c
dbc4a9b
index c68e72414a67..4277938af700 100644
dbc4a9b
--- a/drivers/acpi/custom_method.c
dbc4a9b
+++ b/drivers/acpi/custom_method.c
dbc4a9b
@@ -29,6 +29,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
dbc4a9b
 	struct acpi_table_header table;
dbc4a9b
 	acpi_status status;
dbc4a9b
 
dbc4a9b
+	if (secure_modules())
dbc4a9b
+		return -EPERM;
dbc4a9b
+
dbc4a9b
 	if (!(*ppos)) {
dbc4a9b
 		/* parse the table header to get the table length */
dbc4a9b
 		if (count <= sizeof(struct acpi_table_header))
dbc4a9b
-- 
c47527a
2.1.0
dbc4a9b