Received: by 10.213.65.68 with SMTP id h4csp1781743imn; Mon, 19 Mar 2018 13:06:30 -0700 (PDT) X-Google-Smtp-Source: AG47ELtiXeamI3QO238euM9cUd+FuMiz07dJDP5SW1vmbYDHmkP9IfQJh1iHZ7jmAorUfr0S6aqo X-Received: by 2002:a17:902:7c98:: with SMTP id y24-v6mr13811872pll.60.1521489990642; Mon, 19 Mar 2018 13:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521489990; cv=none; d=google.com; s=arc-20160816; b=WQCz0229cRTcuZsRLgnMyZbEZjJ0SpBKcMKPbrqAPWEe/BUaTeggQhmR59+dLWKXzA 9/MRQhg/T+2/v2H3BHU0Mv4Iw/fIksXT1KQE1k9FW2HNq4ePmGonGpRmG/4KSL6wHP4y aCoTNoCWIWCOnFwX1Z/ttIMKqQ0KMCgl6EYypfoodxnCEqV7pdmnAWV2ghlvCobHAoU/ Oz3wVY0hApeqRk//Ek6cLoWJZnuaixqiwPeg+HThDUrpRXo64+PFfkrGwVxUdX1B7sOo IcdGbIkRV5ljRSrkhmEB8mHmDleZAPTlrFHUp5LKnPzprnrnim/me7/SwT8RYKbkkx6m Ngew== 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=nQypa26QO26F4wgnisr1/felO3rGExSnhn/QtzRpmEo=; b=UWwYQnpy/BzeGarMDU19wXE55mCLJs+9+xgEmJHjMLCzxkeodTL/fRSql8nkk3Gh93 JWyJlnwD2gLdIw2740/bP2QbvkjDk0zgUGn4eX6epqQPgZfKtCmFv6+jkVlCO75P7Rl/ I/iMwwBft5hFqH0ip1tBjESmyup78bG/JYDExeamrvomJwQwWjeBPAV59czTaa77qWAJ IQa+wKpZaM0eBEdx6nL80jU1gktWmzzyCkPJqvl8UWpCv5cflgKxwnGfGpvs1/AFV1tc Bp7Vzl7b6cfzZyYUD6P08dUS6C180IdEgKmRY4+mpjKA+xv+jZRFcXAc80QA4++Hik8h bWJg== 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 w5si445438pgv.514.2018.03.19.13.06.16; Mon, 19 Mar 2018 13:06:30 -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 S969255AbeCSSSG (ORCPT + 99 others); Mon, 19 Mar 2018 14:18:06 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45796 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969226AbeCSSR5 (ORCPT ); Mon, 19 Mar 2018 14:17:57 -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 A2B351267; Mon, 19 Mar 2018 18:17:56 +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.4 114/134] x86/vm86/32: Fix POPF emulation Date: Mon, 19 Mar 2018 19:06:37 +0100 Message-Id: <20180319171905.750832502@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@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.4-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 @@ -715,7 +715,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; }