Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2324613imm; Fri, 7 Sep 2018 14:41:07 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbu2GtHIUJ5sOmS18GWfotfxxvCH81KtFlpObVLPlcM02GBW8VUrgODBaumDDoQmjN9xUZ/ X-Received: by 2002:a63:2b4d:: with SMTP id r74-v6mr10415493pgr.406.1536356467328; Fri, 07 Sep 2018 14:41:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536356467; cv=none; d=google.com; s=arc-20160816; b=Ovr6TQihmc1ow5UE3Qb6YcPG4spMMjReSiC0iJ0eBKUyaPrPE6T8JhyeEpR8CeuFWj qrIETIf5wXKjdrKDMYDgiMlkJFqJWWN8bV1Xi1kCfe/r5feYaoK5V6s2riUEPu+q7L/A 4a62G5SXBIgF4xYa4UsVNfNRn9qOXEh2uNdXMQEQ048Sa5D3o/BRS0PcSP8C/DfrbAJK ojr79US8s1by9pE+8MODKCdHbHLc+IQxjG/I57p1HBExU+uxaRv1irZ2isJi1hFboBG7 JkFzICvmsurrm7w3A7dhlm15Ds8C97Z7ZdqFg6nr0fA7F7Volb8e2M3eIfPtStmBRSu7 Xj4A== 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; bh=8GWyWwqSbzCmHf2vGLlAoBCxJ31m9X/IEcr7VX6WDwQ=; b=YBsDsHaYrW9C/JtKZYl0X5ZzaHIgs3tpdZu5CrqI3VpcfBya4rWdp51nvbtzYi7DBm 9LbaxCPsUWpmFHF2MnVzDOQ8U07oMI6ZG4g7nSXVYet7lDd79MzHgkMlE5d21z0R9DTm Wld7jG5C8ukhlWKoP0RnvSoKA4in25ta04OyfCXwy0ppwSKxZajQVc/yJQohm6wW/T5n pVpLo3zPQX0BaZMYFCMCOmunmpIcUF0lD5cqUVmJfyAzZKZft9gNo3x43PbA6EFz22EH Z/gKmcuLCsyKFPsvIwF75SqP2/pDbvBthwfqoMloOIERYID5q+pWdbiwHNYh7rdQgOIZ Vaqw== 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 z2-v6si9434157pgn.494.2018.09.07.14.40.52; Fri, 07 Sep 2018 14:41:07 -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 S1730016AbeIHCWV (ORCPT + 99 others); Fri, 7 Sep 2018 22:22:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52780 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726187AbeIHCWU (ORCPT ); Fri, 7 Sep 2018 22:22:20 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 247FDEC3; Fri, 7 Sep 2018 21:39:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andi Kleen , Jiri Slaby Subject: [PATCH 4.4 13/47] x86/mm/pat: Fix L1TF stable backport for CPA, 2nd call Date: Fri, 7 Sep 2018 23:10:09 +0200 Message-Id: <20180907210905.764844643@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907210904.607934824@linuxfoundation.org> References: <20180907210904.607934824@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: Jiri Slaby Mostly recycling the commit log from adaba23ccd7d which fixed populate_pmd, but did not fix populate_pud. The same problem exists there. Stable trees reverted the following patch: Revert "x86/mm/pat: Ensure cpa->pfn only contains page frame numbers" This reverts commit 87e2bd898d3a79a8c609f183180adac47879a2a4 which is commit edc3b9129cecd0f0857112136f5b8b1bc1d45918 upstream. but the L1TF patch 02ff2769edbc backported here x86/mm/pat: Make set_memory_np() L1TF safe commit 958f79b9ee55dfaf00c8106ed1c22a2919e0028b upstream set_memory_np() is used to mark kernel mappings not present, but it has it's own open coded mechanism which does not have the L1TF protection of inverting the address bits. assumed that cpa->pfn contains a PFN. With the above patch reverted it does not, which causes the PUD to be set to an incorrect address shifted by 12 bits, which can cause various failures. Convert the address to a PFN before passing it to pud_pfn(). This is a 4.4 stable only patch to fix the L1TF patches backport there. Cc: stable@vger.kernel.org # 4.4-only Cc: Andi Kleen Signed-off-by: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- arch/x86/mm/pageattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c @@ -1079,7 +1079,7 @@ static int populate_pud(struct cpa_data * Map everything starting from the Gb boundary, possibly with 1G pages */ while (end - start >= PUD_SIZE) { - set_pud(pud, pud_mkhuge(pfn_pud(cpa->pfn, + set_pud(pud, pud_mkhuge(pfn_pud(cpa->pfn >> PAGE_SHIFT, canon_pgprot(pud_pgprot)))); start += PUD_SIZE;