Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp438169iog; Mon, 13 Jun 2022 06:02:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjGTkhEt/fWumGc86X3PJ5Omkc9Ys6OqmjWoPo9Ko5gvozFsKXmVw1mw1xxHDIahOk3eSt X-Received: by 2002:a17:906:7a5c:b0:712:38a6:9ac0 with SMTP id i28-20020a1709067a5c00b0071238a69ac0mr13351950ejo.713.1655125346835; Mon, 13 Jun 2022 06:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125346; cv=none; d=google.com; s=arc-20160816; b=AzYhbjlL5AT46UTON1PrwKZjsj1q6EpNKNaCafu5/BAL2uvs5Ku/LBJjYeP5xMykuU yGazI55xnhpcC3qYqBFbbQUbMme4Iad4/Kw9gAwixegphp3yWv7SGIz4/WnM5SBXjFMB 6Rd1Yfsb5Kk9bk7JaLyBno/ba52ERcp31FjmrgxBremuSuVE0DSmYZ84dMmYK1efkSXb XlV1o8UMrcSGFrufv4OuVpBDcJ6EcD/ExTTMiul6NY4dhE1jW5nq5fxowUiCp6c48KCO yzLeJCMzs+jHVNaFo7dY8fCWC+iOiX55zGZGnJhjB+hCLQ2kLZ7vOJCpEEDh1Tjz9wfs NSfA== 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=LjWsQv5nWJeVGfD+42VjyohtqE4kAgH+Kdys/5Zoqmw=; b=bJeb6+Q0uf0pwrO4D1g2B/CD7/DPDC461LFx0SGqvOqPRc/wiPM0B0WpHhdUWJsgbQ weJpeAAZgybPP0hKbHijEGHifuc2tePGjm1AJYkZFeIhXy5p1zVlqjZuSXcA0Vl1/SDt HBQbCKD5OD9i8aUCvfANuoRKY/vbyAzFiWc2U8k2RXtEtzZEyBlWHSit4Bte2TKNA2QK mQ7gFaLGJiYayMm8AC52Tc73D8xC4NC5e/1U2B+j7iWqK/Us+FEira7UmV0cReU0oz+h Mehvpw0BIGsdFxv5BtCxmlY225H+TCUhFevdFEA/B6+w9NImHjez3lmzLK5SqQKkiUUW eIZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FUtSNPHZ; 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 j1-20020aa7c401000000b00425fcc5d236si7351237edq.53.2022.06.13.06.02.01; Mon, 13 Jun 2022 06:02:26 -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=FUtSNPHZ; 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 S244014AbiFMKbn (ORCPT + 99 others); Mon, 13 Jun 2022 06:31:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244430AbiFMK0d (ORCPT ); Mon, 13 Jun 2022 06:26:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDB50245B2; Mon, 13 Jun 2022 03:19:45 -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 ams.source.kernel.org (Postfix) with ESMTPS id 74F1EB80E5C; Mon, 13 Jun 2022 10:19:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1D2EC34114; Mon, 13 Jun 2022 10:19:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655115583; bh=0evX1aX+8vGsL+wWX4IQfjHNmGv7ZxnUybITsf+ORBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FUtSNPHZtuZlTbWgJBjSCn7TfKAWQrqosC4D0JZqTxoYsdDyZn7NBLpOm5BMWbYub LByomx/5BuXcm3Zdb+N+5tc1jxkQboE4AFn4wwJRorjFiSB2cywtXv4maz3snmPHCX lC/1YehJYJwT4un6ylackIhKO5Hr0TIR1qM5vHRw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hugh Dickens , Greg Ungerer , Sasha Levin Subject: [PATCH 4.9 129/167] m68knommu: set ZERO_PAGE() to the allocated zeroed page Date: Mon, 13 Jun 2022 12:10:03 +0200 Message-Id: <20220613094911.120736832@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094840.720778945@linuxfoundation.org> References: <20220613094840.720778945@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 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: Greg Ungerer [ Upstream commit dc068f46217970d9516f16cd37972a01d50dc055 ] The non-MMU m68k pagetable ZERO_PAGE() macro is being set to the somewhat non-sensical value of "virt_to_page(0)". The zeroth page is not in any way guaranteed to be a page full of "0". So the result is that ZERO_PAGE() will almost certainly contain random values. We already allocate a real "empty_zero_page" in the mm setup code shared between MMU m68k and non-MMU m68k. It is just not hooked up to the ZERO_PAGE() macro for the non-MMU m68k case. Fix ZERO_PAGE() to use the allocated "empty_zero_page" pointer. I am not aware of any specific issues caused by the old code. Link: https://lore.kernel.org/linux-m68k/2a462b23-5b8e-bbf4-ec7d-778434a3b9d7@google.com/T/#t Reported-by: Hugh Dickens Signed-off-by: Greg Ungerer Signed-off-by: Sasha Levin --- arch/m68k/include/asm/pgtable_no.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h index ac7d87a02335..269443e1084b 100644 --- a/arch/m68k/include/asm/pgtable_no.h +++ b/arch/m68k/include/asm/pgtable_no.h @@ -41,7 +41,8 @@ extern void paging_init(void); * ZERO_PAGE is a global shared page that is always zero: used * for zero-mapped memory areas etc.. */ -#define ZERO_PAGE(vaddr) (virt_to_page(0)) +extern void *empty_zero_page; +#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) /* * No page table caches to initialise. -- 2.35.1