linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] x86: Preserve iopl on fork and execve
@ 2015-05-11 23:38 Alex Henrie
  2015-05-12  6:40 ` Ingo Molnar
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Henrie @ 2015-05-11 23:38 UTC (permalink / raw)
  To: One Thousand Gnomes, Kees Cook, H . Peter Anvin, Doug Johnson,
	Thomas Gleixner, Ingo Molnar, Tyler Hicks, Al Viro, linux-kernel
  Cc: Alex Henrie

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Suggested-by: Doug Johnson <dougvj@dougvj.net>
---
 arch/x86/kernel/process_32.c | 2 +-
 arch/x86/kernel/process_64.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 8ed2106..0ef7078 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -205,7 +205,7 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
 	regs->cs		= __USER_CS;
 	regs->ip		= new_ip;
 	regs->sp		= new_sp;
-	regs->flags		= X86_EFLAGS_IF;
+	regs->flags		= X86_EFLAGS_IF | (X86_EFLAGS_IOPL & regs->flags);
 	force_iret();
 }
 EXPORT_SYMBOL_GPL(start_thread);
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index ddfdbf7..e21eda2 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -238,7 +238,7 @@ start_thread_common(struct pt_regs *regs, unsigned long new_ip,
 	regs->sp		= new_sp;
 	regs->cs		= _cs;
 	regs->ss		= _ss;
-	regs->flags		= X86_EFLAGS_IF;
+	regs->flags		= X86_EFLAGS_IF | (X86_EFLAGS_IOPL & regs->flags);
 	force_iret();
 }
 
-- 
2.4.0


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

end of thread, other threads:[~2015-05-15  0:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 23:38 [PATCH v2] x86: Preserve iopl on fork and execve Alex Henrie
2015-05-12  6:40 ` Ingo Molnar
2015-05-12 15:13   ` Linus Torvalds
2015-05-12 18:24     ` H. Peter Anvin
2015-05-12 15:24   ` Arjan van de Ven
2015-05-12 15:25     ` Arjan van de Ven
2015-05-12 15:47       ` Austin S Hemmelgarn
2015-05-12 18:05         ` Alex Henrie
2015-05-12 18:12           ` Austin S Hemmelgarn
2015-05-14 10:41       ` Josh Triplett
2015-05-15  0:52         ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).