From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753295AbbE1IQy (ORCPT ); Thu, 28 May 2015 04:16:54 -0400 Received: from mail.emea.novell.com ([130.57.118.101]:53922 "EHLO mail.emea.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751573AbbE1IQt convert rfc822-to-8bit (ORCPT ); Thu, 28 May 2015 04:16:49 -0400 Message-Id: <5566EB0D020000780007E655@mail.emea.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.0.1 Date: Thu, 28 May 2015 09:16:45 +0100 From: "Jan Beulich" To: , , Cc: , Subject: [PATCH] ix86: really make user_mode() work correctly for VM86 mode Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Andy Lutomirski --- 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