]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: SAUCE: UEFI: asus-wmi: Restrict debugfs interface when module loading is...
authorMatthew Garrett <matthew.garrett@nebula.com>
Fri, 9 Mar 2012 13:46:50 +0000 (08:46 -0500)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
We have no way of validating what all of the Asus WMI methods do on a
given machine, and there's a risk that some will allow hardware state to
be manipulated in such a way that arbitrary code can be executed in the
kernel, circumventing module loading restrictions. Prevent that if any of
these features are enabled.

Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/platform/x86/asus-wmi.c

index 43cb680adbb42045aaeea332220460440180215a..b5d77af6e1555e6b658fbbdbdb3c24dc1f391cda 100644 (file)
@@ -1898,6 +1898,9 @@ static int show_dsts(struct seq_file *m, void *data)
        int err;
        u32 retval = -1;
 
+       if (secure_modules())
+               return -EPERM;
+
        err = asus_wmi_get_devstate(asus, asus->debug.dev_id, &retval);
 
        if (err < 0)
@@ -1914,6 +1917,9 @@ static int show_devs(struct seq_file *m, void *data)
        int err;
        u32 retval = -1;
 
+       if (secure_modules())
+               return -EPERM;
+
        err = asus_wmi_set_devstate(asus->debug.dev_id, asus->debug.ctrl_param,
                                    &retval);
 
@@ -1938,6 +1944,9 @@ static int show_call(struct seq_file *m, void *data)
        union acpi_object *obj;
        acpi_status status;
 
+       if (secure_modules())
+               return -EPERM;
+
        status = wmi_evaluate_method(ASUS_WMI_MGMT_GUID,
                                     1, asus->debug.method_id,
                                     &input, &output);