Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3322652rwa; Tue, 23 Aug 2022 02:49:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR5E4bYGR+l+8bRItxMpu1jUV7An6lV3ddy1ei7W/OacoXVgq21fanQTKRBiAjy/XyOvH+iF X-Received: by 2002:a05:6402:3881:b0:445:f8bf:5a1c with SMTP id fd1-20020a056402388100b00445f8bf5a1cmr2952623edb.13.1661248174740; Tue, 23 Aug 2022 02:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248174; cv=none; d=google.com; s=arc-20160816; b=0nbiKNyNSMMqgt+0L5Q77c3+QHkaigZIbML/3o06uyNXPaZlSled7/z1CGUbtn2M4q hUDQv4hZ+ApZyJp0fQoGYPUOHndOf60TRJ7PKhmQ4Ao+1Cq1UgjY9iQKvge86IAWWnan YA4A8L7xwN5Q1PeIhs66Xqisz1uZ89jK9ZUS4Xe9djz+0RtgosPMuNdJx9WvDm3c5war IBWsf04lJDgULouiQdFok1IJZ3lznOZCSA/KnGV16ajzvACRuuz4Nb12D1k+xz9eV+Zt xUWoJnt3IlANt1fvrpkmcUcW3hSu5VuXd/kpqbPvuDH97LuvwJhSYTBw256NdZnttWrK T2MQ== 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=ULvNfS4W+9R4pXtU0qTt3CxpCi7vYkPXVM1ai766LpU=; b=o7EZDJKPCvKCfjxEbzZ+AM+f2vMpbTqBQk8pB4707h97n9zmYsda89QxDs3a12htEv MV0gretqevrsnAbSko4Zze6LwJ2gXO3/enl1sQel/ErtXqqCULEBEG2EVb1ZUAax8Pxy nI6Vr5a/WA7u+cJA0CchAGmhMfRq7RMjEuUPtJ2JFpb3vV/UPJ76xwn4iZ4qRPsFFgtx 9BorSrzAL+rrND/bDQybOSPE6HTvfrGzPPsnOr85QcK3Ct111HaBK4w3/odc/H68xOM5 TPeIV4jjnSTTwPu+5cKfK9OLzOa5mrymm9x9i/uPGTnIGSeA+pN42c0LtzZ9RTFJVn7Q JpBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aj1joynr; 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 bv14-20020a170906b1ce00b007330c08fe49si10192124ejb.206.2022.08.23.02.49.09; Tue, 23 Aug 2022 02:49:34 -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=aj1joynr; 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 S241938AbiHWIKP (ORCPT + 99 others); Tue, 23 Aug 2022 04:10:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241798AbiHWIJM (ORCPT ); Tue, 23 Aug 2022 04:09:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAC5F4A110; Tue, 23 Aug 2022 01:05:57 -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 9B705610AA; Tue, 23 Aug 2022 08:05:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90BFAC433C1; Tue, 23 Aug 2022 08:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661241957; bh=xVV0l/Pd2MYjbdMgeA4Tm9OMCqwYPPiHSBBgogv6Dhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aj1joynrvxolbdNc94cBAG+lSPmUy5WL2Mt8ynKukFn8N22L4lttjN9i8QvJjpgre H7U8zmGFEuiPJaizE3EJKdOGOIIUSEl8rOC5VUu1FMapAApoDF8TPx3LimVrxyOfGO LNMuGJVeEKgAozNGNCWjtGOahosdhZnn+mSZ9oS4= 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.19 005/365] x86/mm: Use proper mask when setting PUD mapping Date: Tue, 23 Aug 2022 09:58:26 +0200 Message-Id: <20220823080118.379994360@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@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 @@ -645,7 +645,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,