Module: xenomai-3
Branch: next
Commit: c332e694ad14416663d60236c9b08dffa349b44f
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c332e694ad14416663d60236c9b08dffa349b44f

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Fri Dec 18 14:36:16 2015 +0100

cobalt/x86: Fix strncpy_from_user_nocheck for SMAP-enabled systems

If SMAP is on, we need to explicitly allow kernel access to userspace
memory via stac() and disallow it again once done (clac()). This fixes
oopses on recent Intel CPUs.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 kernel/cobalt/arch/x86/machine.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/cobalt/arch/x86/machine.c b/kernel/cobalt/arch/x86/machine.c
index 4ca5cd8..14443e0 100644
--- a/kernel/cobalt/arch/x86/machine.c
+++ b/kernel/cobalt/arch/x86/machine.c
@@ -104,7 +104,10 @@ do {                                                       
                   \
 long strncpy_from_user_nocheck(char *dst, const char __user *src, long count)
 {
        long res;
+
+       stac();
        __do_strncpy_from_user(dst, src, count, res);
+       clac();
        return res;
 }
 EXPORT_SYMBOL_GPL(strncpy_from_user_nocheck);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to