]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
UBUNTU: SAUCE: (efi-lockdown) ACPI: Limit access to custom_method when the kernel...
authorMatthew Garrett <mjg59@srcf.ucam.org>
Mon, 9 Apr 2018 08:52:48 +0000 (09:52 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 4 Mar 2019 12:51:26 +0000 (06:51 -0600)
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@srcf.ucam.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: "Lee, Chun-Yi" <jlee@suse.com>
cc: linux-acpi@vger.kernel.org
(cherry picked from commit 4fb93a972b047e8871b8e207a0f8621e03a89acf
 git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/fedora.git)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/acpi/custom_method.c

index 4451877f83b63932149b0fd4e552129b2b790c18..ac8a90dc709691a1f330af1a3a4fdb22071e624d 100644 (file)
@@ -29,6 +29,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
        struct acpi_table_header table;
        acpi_status status;
 
+       if (kernel_is_locked_down("ACPI custom methods"))
+               return -EPERM;
+
        if (!(*ppos)) {
                /* parse the table header to get the table length */
                if (count <= sizeof(struct acpi_table_header))