[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABQQNFEWUUF5GDEP91-KTF3bJ9s--GfhdmTqvk7AbGPS7Dh80w@mail.gmail.com>
Date: Sat, 25 Apr 2015 18:01:32 -0400
From: Christopher Sacchi <christophersacchi@...il.com>
To: linux-kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH] kmod in usermode (module loader in Ring 3)
This is an experimental patch to put kmod in Ring 3, rather than Ring 0.
Here it is, below the dashed lines:
---------------------------------------------------------------------------------------------------------------------------
Signed-off-by: Christopher P. Sacchi <christophersacchi@...il.com>
--- kmod.old 2015-04-12 18:12:50.000000000 -0400
+++ kmod.c 2015-04-25 17:52:47.629844677 -0400
@@ -43,6 +43,14 @@
#include <trace/events/module.h>
+#ifdef CONFIG_X64
+asm("sysret");
+#endif
+
+#ifndef CONFIG_X64
+asm("sysexit");
+#endif
+
extern int max_threads;
static struct workqueue_struct *khelper_wq;
@@ -692,3 +700,11 @@ void __init usermodehelper_init(void)
khelper_wq = create_singlethread_workqueue("khelper");
BUG_ON(!khelper_wq);
}
+
+#ifdef CONFIG_X64
+asm("syscall");
+#endif
+
+#ifndef CONFIG_X64
+asm("sysenter");
+#endif
---------------------------------------------------------------------------------------------------------------------------
Regards,
Christopher P. Sacchi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists