Messages in this thread Patch in this message | | | Date | Thu, 28 May 2015 09:16:45 +0100 | From | "Jan Beulich" <> | 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@suse.com> Cc: Andy Lutomirski <luto@kernel.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
| |