Received: by 10.213.65.68 with SMTP id h4csp1739745imn; Mon, 19 Mar 2018 11:58:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELvuxWhGTPMjJDLDLodBRkfO7blX29n9jZRbjZxY6+Lyy92xpgk/Bwq6XGXiua4PnUtmYGBS X-Received: by 2002:a17:902:468:: with SMTP id 95-v6mr13701081ple.360.1521485881276; Mon, 19 Mar 2018 11:58:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521485881; cv=none; d=google.com; s=arc-20160816; b=bpwCsFPs3Be3hNQbjkD5cwd2uj0QebW3T/SaLUfOBK0m9a2CmoEBlNBmWgaGbAw5V1 PJi2RekFkBNVZJKwy+wdZepQHmAPo/84coP3Flv9j1k02JxjM3lSBXsZzVPfV7LQiNTu 5oR9+52KVSt2UlE8MhEld3ihqblFej5z1Pku4+pcTugwRjzHo4a8/LbgqfzH5TJ+wNzB ENWZcdQrYch8HDwOXc+Y3yzePbGYFGmtzNbE764aN5fvT+r0DlHAC43J6nA5W076BMAU pgI5Bd+q1/jpY+k+BIvz1vh0GOD41rzROqTWTD+eiG01NHLDselMlHGrzyqkSX4KGMrf sXBw== 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=q5vZMFkrhCLhW74fiNP8KcOf9GE/tbD6xMXspRUA9t8=; b=tj+f7S9ohKZBKjF/7PYPv1hVxDD+S79wM2MOZchC7LOdifD7zQSYbdsWyk7C3r2/Bs zYw6MPhk8D1EdqGqw6R5CTPnfW8h5KO1Mg5G2u3FiOQgMmKc+NdjKtysjL3Pc+hDnQjB l7uHZ7TkKeM/ZPb8nVJem/zn+mE/T/vusmSlug0pErN9CH3glIYbDtaYwDZdWMkZZFkL F3RndEgpZ55VCBFyVBOjTgqPjIixkaU7W46XDFQvuw190LlwIaIbjv/0Of5TSbFnIbSH yP/68j4LYVUCTHaRb5LjXhWfHa/8cykcv6nZNmW1fTJS9WEoJcgfHvu7ztSfjZe3PEtx pYYw== 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 d3si383678pfh.77.2018.03.19.11.57.46; Mon, 19 Mar 2018 11:58:01 -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 S970460AbeCSSz6 (ORCPT + 99 others); Mon, 19 Mar 2018 14:55:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53026 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031897AbeCSS35 (ORCPT ); Mon, 19 Mar 2018 14:29: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 DF21011C7; Mon, 19 Mar 2018 18:29: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.14 07/41] x86/vm86/32: Fix POPF emulation Date: Mon, 19 Mar 2018 19:08:07 +0100 Message-Id: <20180319180732.701007027@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180732.195217948@linuxfoundation.org> References: <20180319180732.195217948@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.14-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 @@ -727,7 +727,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; }