Received: by 10.213.65.68 with SMTP id h4csp1727384imn; Mon, 19 Mar 2018 11:34:31 -0700 (PDT) X-Google-Smtp-Source: AG47ELso+0MwTp2eqxKEZ5Wmxr5LUogMTuseo1/IWfFkOgMpsGixxlbvGTJ4/Tz+qnTbZgSRp+0+ X-Received: by 10.101.97.88 with SMTP id o24mr9695888pgv.270.1521484471441; Mon, 19 Mar 2018 11:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521484471; cv=none; d=google.com; s=arc-20160816; b=Dg8wMYavcq8NIaNnuRexXa0FnUhw/ox9MzrK4KUU1tkfHKd9xmGqmev7XqDtHtdfo/ HU0FN9/FfkN0uzrWnNdLtZtCIS99WYKKWRt3cQRy4SXOxtMppVisqv7HZ4LNSmkJmF7R ROch2khogWTamICe3dhmjvZkluS35pvJUslmDJbp32GBDz8KlPWnvPle7o2g6usXKIcg RKW51LFM0h4gdWEZx3Ycnk3zO96MtlKIC+BZ/iD6f9aKy77eIbHqs1j1WsOKBbn213u4 seTrZuHIxPaZHFp5zq7hbdcLZkJOTM7x9Of/ocsYssRu8GNFC8CHTTzQuets4yebxRva xhCQ== 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=4XST5G4Oy16Clntzg95oHPRI5vg0jCtTQypi8ARZBNU=; b=hkwBkWjLlA/2n4cX2KIFO2SckKQz0hZTfdHPf5Qd8dFMNkQ3D2rXXVizUx6VKEDllD MA9lv8QpRF6yHkPJWNzYGCnkAX/zozp3MAo61aa9yXB+nxSDFyM4hoO8Fe40m3HluVFq 1aM6UYUORT6t49neiFSBC6DnRA5qT0331mBsqYOzdBa2bpx0Zzzxb/pYXIiU5IO9P7EN mzZwvwe4ns8Nq5MZnpDRCfSqVHzASCkJy7I9eNHwryGsQrE16IBmma4UNzg+AZIVLx4x zlhd69eOIb/q8yfcvEaGJivCRqkIlKRP6RbC/rmcPQiZc2KvsmVOZNaBR0OBuhBVS6/z uzXw== 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 h12si286288pgn.317.2018.03.19.11.34.16; Mon, 19 Mar 2018 11:34:31 -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 S970244AbeCSScK (ORCPT + 99 others); Mon, 19 Mar 2018 14:32:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53768 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970188AbeCSScB (ORCPT ); Mon, 19 Mar 2018 14:32:01 -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 32B71129A; Mon, 19 Mar 2018 18:31:59 +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.15 05/52] x86/vm86/32: Fix POPF emulation Date: Mon, 19 Mar 2018 19:08:03 +0100 Message-Id: <20180319180735.348819710@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180734.976730813@linuxfoundation.org> References: <20180319180734.976730813@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.15-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; }