public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86 : Ensure X86_FLAGS_NT is cleared on syscall entry
@ 2014-09-25 19:42 Anish Bhatt
  2014-09-25 23:00 ` Chuck Ebbert
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Anish Bhatt @ 2014-09-25 19:42 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, tglx, mingo, hpa, sebastian, Anish Bhatt

The MSR_SYSCALL_MASK, which is responsible for clearing specific EFLAGS on
 syscall entry, should also clear the nested task (NT) flag to be safe from
 userspace injection. Without this fix the application segmentation
 faults on syscall return because of the changed meaning of the IRET
 instruction.

Further details can be seen here https://bugs.winehq.org/show_bug.cgi?id=33275

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
---
 arch/x86/kernel/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index e4ab2b4..3126558 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1184,7 +1184,7 @@ void syscall_init(void)
 	/* Flags to clear on syscall */
 	wrmsrl(MSR_SYSCALL_MASK,
 	       X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF|
-	       X86_EFLAGS_IOPL|X86_EFLAGS_AC);
+	       X86_EFLAGS_IOPL|X86_EFLAGS_AC|X86_EFLAGS_NT);
 }
 
 /*
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2014-09-30  0:12 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-25 19:42 [PATCH] x86 : Ensure X86_FLAGS_NT is cleared on syscall entry Anish Bhatt
2014-09-25 23:00 ` Chuck Ebbert
2014-09-29 17:30   ` Andy Lutomirski
2014-09-26 22:00 ` Chuck Ebbert
2014-09-26 22:10   ` Anish Bhatt
2014-09-26 23:32   ` Linus Torvalds
2014-09-29 17:40 ` Andy Lutomirski
2014-09-29 18:30   ` Sebastian Lackner
2014-09-29 18:43     ` Andy Lutomirski
2014-09-29 19:33     ` Thomas Gleixner
2014-09-29 19:41       ` Sebastian Lackner
2014-09-29 19:51         ` Thomas Gleixner
2014-09-29 18:59   ` Thomas Gleixner
2014-09-29 19:08     ` Andy Lutomirski
2014-09-29 19:17     ` Andy Lutomirski
2014-09-29 19:41       ` Thomas Gleixner
2014-09-29 19:43         ` H. Peter Anvin
2014-09-29 19:57           ` Thomas Gleixner
2014-09-29 20:01             ` H. Peter Anvin
2014-09-29 20:10               ` Thomas Gleixner
2014-09-29 20:29               ` Andy Lutomirski
2014-09-29 20:16         ` Andy Lutomirski
2014-09-29 21:37           ` Thomas Gleixner
2014-09-30  0:11             ` Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox