Received: by 10.213.65.68 with SMTP id h4csp21516imn; Mon, 19 Mar 2018 18:11:22 -0700 (PDT) X-Google-Smtp-Source: AG47ELucNuR5x0pgSYgUqGqmuLS4iFWctYhGmrvsOTdZP+rFgRP8jlLnKlf2K5tdXrBDeUaRZnHF X-Received: by 10.101.92.76 with SMTP id v12mr10534947pgr.50.1521508282333; Mon, 19 Mar 2018 18:11:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521508282; cv=none; d=google.com; s=arc-20160816; b=BmjJb74xs/qboAOdpTAf7/0f+Tt6g/BbfvG1z1E+xcUbYyz3FDQGkBHFhnNAa4Kh1m HStHmuZrUtrV4YnVXfd4aodog7bFGdB/oBcfXguCUdb1eviyC1VT5chhuIJWC/lZ2Ehq jjAaeqtNEty/lE/spddPfWNubn54kivvf4InZrx+kyQ+EmLzyDW4ssTRfAoGpocTMjJM 1hJ3Zyb1ZTTeK0xcJfmPLRxacFdPOdLQCNqhmH2Y0bQxTka6x6MAyCn85+7lksaABrU9 2jCK+lov9TXTIaooDJ3M74XA9ju+Rt5702Iu822RC1TG2EKsQ/5ODvoLAfF2VsdwkDD+ DuLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=A4WK57pxvJvYVzgsTNVJlhN/6rdRrYWAJnFTqU2Vbwk=; b=tyxniubfNo/cravxvff7jilXPb+Ud/q6fHFJa5rtHE3GMxzwdX2FeaEwopc7HCzBzf JxUdEBpcLT1i7RYK8Dz0emN70NaO12U5KxvSficfMXy2DY7C0jAMIEa1fpANxO8AuO8n fG6MPhdgUqVoYfOqnTeL6cwCPbWdPPXFAnPDZzhjjB+1fg1o6ikXvXbtLcn8jqCFrGWv tRO+rsHzqGyecRySwQrObkezeyJ31NLAdIEW7fBih60Mc4ZN4/evY4mnGccCeGlkjMAn RK6gadfDASsS7sVVTeCTOgOKrUTW3jV8sOawbqojDFyakrFLJ733+1ZIUZFxgwcWnsNI IVNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n23-v6si440941pll.175.2018.03.19.18.11.07; Mon, 19 Mar 2018 18:11:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970652AbeCSTBQ (ORCPT + 99 others); Mon, 19 Mar 2018 15:01:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52406 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031782AbeCSS2t (ORCPT ); Mon, 19 Mar 2018 14:28:49 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 20E541090; Mon, 19 Mar 2018 18:28:48 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stas Sergeev , Bart Oldeman , Andy Lutomirski , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Josh Poimboeuf , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ingo Molnar Subject: [PATCH 4.9 217/241] x86/vm86/32: Fix POPF emulation Date: Mon, 19 Mar 2018 19:08:02 +0100 Message-Id: <20180319180800.159625579@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andy Lutomirski commit b5069782453459f6ec1fdeb495d9901a4545fcb5 upstream. POPF would trap if VIP was set regardless of whether IF was set. Fix it. Suggested-by: Stas Sergeev Reported-by: Bart Oldeman Signed-off-by: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Josh Poimboeuf Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: stable@vger.kernel.org Fixes: 5ed92a8ab71f ("x86/vm86: Use the normal pt_regs area for vm86") Link: http://lkml.kernel.org/r/ce95f40556e7b2178b6bc06ee9557827ff94bd28.1521003603.git.luto@kernel.org Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/vm86_32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c @@ -719,7 +719,8 @@ void handle_vm86_fault(struct kernel_vm8 return; check_vip: - if (VEFLAGS & X86_EFLAGS_VIP) { + if ((VEFLAGS & (X86_EFLAGS_VIP | X86_EFLAGS_VIF)) == + (X86_EFLAGS_VIP | X86_EFLAGS_VIF)) { save_v86_state(regs, VM86_STI); return; }