[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <5566EB0D020000780007E655@mail.emea.novell.com>
Date: Thu, 28 May 2015 09:16:45 +0100
From: "Jan Beulich" <JBeulich@...e.com>
To: <mingo@...e.hu>, <tglx@...utronix.de>, <hpa@...or.com>
Cc: <luto@...nel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] ix86: really make user_mode() work correctly for VM86
mode
While commit efa7045103 ("x86/asm/entry: Make user_mode() work
correctly if regs came from VM86 mode") claims that "user_mode() is now
identical to user_mode_vm()", this wasn't actually the case - no prior
commit made it so.
Signed-off-by: Jan Beulich <jbeulich@...e.com>
Cc: Andy Lutomirski <luto@...nel.org>
---
arch/x86/include/asm/ptrace.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- 4.1-rc5/arch/x86/include/asm/ptrace.h
+++ 4.1-rc5-ix86-user_mode/arch/x86/include/asm/ptrace.h
@@ -107,7 +107,8 @@ static inline unsigned long regs_return_
static inline int user_mode(struct pt_regs *regs)
{
#ifdef CONFIG_X86_32
- return (regs->cs & SEGMENT_RPL_MASK) == USER_RPL;
+ return ((regs->cs & SEGMENT_RPL_MASK) | (regs->flags & X86_VM_MASK))
+ >= USER_RPL;
#else
return !!(regs->cs & 3);
#endif
--
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