summaryrefslogtreecommitdiffstats
path: root/asus-wmi-Restrict-debugfs-interface-when-module-load.patch
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@fedoraproject.org>2014-08-20 13:22:24 -0400
committerJosh Boyer <jwboyer@fedoraproject.org>2014-08-20 13:22:24 -0400
commit6a91557e4cd508858eca5aba5406a9109861d4de (patch)
treec57990ccc4a28a9933db2aebba1006f46c619f44 /asus-wmi-Restrict-debugfs-interface-when-module-load.patch
parenta99be7d4cf2fae68a0562a7687d89ee61c6b9f98 (diff)
downloadkernel-6a91557e4cd508858eca5aba5406a9109861d4de.tar.gz
kernel-6a91557e4cd508858eca5aba5406a9109861d4de.tar.xz
kernel-6a91557e4cd508858eca5aba5406a9109861d4de.zip
Patch file cleanup
Do a couple things here: - Split the mega-patches into individual patches. Should help with rebasing. - Make all patches 'git am' acceptable. There should be no functional or actual code differences from before
Diffstat (limited to 'asus-wmi-Restrict-debugfs-interface-when-module-load.patch')
-rw-r--r--asus-wmi-Restrict-debugfs-interface-when-module-load.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/asus-wmi-Restrict-debugfs-interface-when-module-load.patch b/asus-wmi-Restrict-debugfs-interface-when-module-load.patch
new file mode 100644
index 000000000..781c8e0ce
--- /dev/null
+++ b/asus-wmi-Restrict-debugfs-interface-when-module-load.patch
@@ -0,0 +1,54 @@
+From ed8fc77bea869c0277b035b2b79470ba350c31e0 Mon Sep 17 00:00:00 2001
+From: Matthew Garrett <matthew.garrett@nebula.com>
+Date: Fri, 9 Mar 2012 08:46:50 -0500
+Subject: [PATCH] asus-wmi: Restrict debugfs interface when module loading is
+ restricted
+
+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 | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
+index 21fc932da3a1..c6d42ad95c08 100644
+--- a/drivers/platform/x86/asus-wmi.c
++++ b/drivers/platform/x86/asus-wmi.c
+@@ -1590,6 +1590,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)
+@@ -1606,6 +1609,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);
+
+@@ -1630,6 +1636,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);
+--
+1.9.3
+