]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
asus-wmi: Restrict debugfs interface when module loading is restricted
authorMatthew Garrett <matthew.garrett@nebula.com>
Fri, 9 Mar 2012 13:46:50 +0000 (08:46 -0500)
committerJulien Grall <julien.grall@citrix.com>
Fri, 18 Sep 2015 15:29:28 +0000 (16:29 +0100)
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>
drivers/platform/x86/asus-wmi.c

index efbc3f0c592b7a9f6abfc1497e27d9593592f33c..071171be4b7f039485a38dd54e46ba1fea6e6f4e 100644 (file)
@@ -1868,6 +1868,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)
@@ -1884,6 +1887,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);
 
@@ -1908,6 +1914,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);