Module: xenomai-jki Branch: for-forge Commit: ff09f67ea2822999e66bec302d36def5f3629edd URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=ff09f67ea2822999e66bec302d36def5f3629edd
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