Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3467823rwa; Tue, 23 Aug 2022 05:22:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR5pVFm6QHk3X5qvysFOCdcxf5xFovoz7tOEVf9T6UmFAcKvYwskundOwm6sNb74enO1yNIi X-Received: by 2002:a63:4f10:0:b0:426:9c61:5e48 with SMTP id d16-20020a634f10000000b004269c615e48mr20190477pgb.360.1661257357518; Tue, 23 Aug 2022 05:22:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257357; cv=none; d=google.com; s=arc-20160816; b=gpMnYAZl/XYBxQyoKkwfSuJSmQIRAbPhKQsAHUpyVNsUEdn+Wko4gAUK4OlalZCh48 cZDRQGpUGjCLmtEdIC3FCikScvCBJN+bzGmyX/4RaliEl0TkigOKrZshshNLap41S847 nQpmCZTUsGrSlDqhGIbJ/BIUwm8H9x5cSp+gW0rKoRf5dHP0iuzIlzagpAnN44Bk+xK+ QkRfwfNbuhVDtFVsqX8NZZryS1yfjbX1Y1e8Di0250H4xw6e20YOwYhDJZCOf28GUbkN blDhj78hLxdlxii/01P3+sXZMP+iwEkmXofJ6YTBCnff7ws4jGZYAB93C18Dw8uhrxlJ WOJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dIyvemni90h7OmPTuIZRF7aKTDuHPfBBlHLwfIDaxSg=; b=I8qms5g4bGOXfP0OSxh654twGoVXmAF815VDEkzlToUeGnB2+B00zL6POf+DY+Cz+o uU/Z0WOyPwOWYcGP6VKQXxtFPtC1hBxr3AilJrf6Z7t8+MKWNor0K75UmHeWZ0G32Eup VZq29CsAY+c0ZwDOaTmEGbl5BZ2nFoKXRt/cF9mOm4h7wGgv/ro6UJotb9wJGyenknGk 1juoSku0semjwlXq9Uc64wh8sq/hkgi6t+Tolcbhy6GwBghO7VURxBDwtQ1T6GN/r3jN tLH8UEPakwH2sXX/hc3YfJYwROqHFH2aJCYtlOh/wNbANHs25VYE9kMhlXa8+HrtLh3/ Hguw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zAONnbsk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a170902f78f00b00170a752cbe0si15001497pln.217.2022.08.23.05.22.18; Tue, 23 Aug 2022 05:22:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zAONnbsk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353293AbiHWKLM (ORCPT + 99 others); Tue, 23 Aug 2022 06:11:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348401AbiHWKDM (ORCPT ); Tue, 23 Aug 2022 06:03:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8292F7C75B; Tue, 23 Aug 2022 01:51:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F173C61524; Tue, 23 Aug 2022 08:38:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A4ADC433D6; Tue, 23 Aug 2022 08:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243890; bh=mo4pZi3hofheKli2BHAplF58RB11yRXOjPYawuE3wUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zAONnbskTZWbdZNZtSSYtWLITsKfvs245HHvFUhukvjk/cufYyLITVUGPP8CnurrF BstRlm1+ZvuASK0aSK2pfyYWQdJzYW7UHCp8VA4logps8nra+gMsLi3f+mqsmWOaT8 sv8Lx0yPbCmIRenZfSy/oluMlv9Uz40aLroptafM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Lu , stable@kernel.org, Linus Torvalds Subject: [PATCH 5.15 004/244] x86/mm: Use proper mask when setting PUD mapping Date: Tue, 23 Aug 2022 10:22:43 +0200 Message-Id: <20220823080059.236036421@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aaron Lu commit 88e0a74902f894fbbc55ad3ad2cb23b4bfba555c upstream. Commit c164fbb40c43f("x86/mm: thread pgprot_t through init_memory_mapping()") mistakenly used __pgprot() which doesn't respect __default_kernel_pte_mask when setting PUD mapping. Fix it by only setting the one bit we actually need (PSE) and leaving the other bits (that have been properly masked) alone. Fixes: c164fbb40c43 ("x86/mm: thread pgprot_t through init_memory_mapping()") Signed-off-by: Aaron Lu Cc: stable@kernel.org Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- arch/x86/mm/init_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -646,7 +646,7 @@ phys_pud_init(pud_t *pud_page, unsigned pages++; spin_lock(&init_mm.page_table_lock); - prot = __pgprot(pgprot_val(prot) | __PAGE_KERNEL_LARGE); + prot = __pgprot(pgprot_val(prot) | _PAGE_PSE); set_pte_init((pte_t *)pud, pfn_pte((paddr & PUD_MASK) >> PAGE_SHIFT,