Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D80C8C433DF for ; Mon, 1 Jun 2020 10:54:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB98C20679 for ; Mon, 1 Jun 2020 10:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591008889; bh=3IYFoIJiG5PoHkFydzxdFiMsv/lU03Wjp/4Ff6WOvOQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=LzrLA6tmIMRdPMz6PxNR/OPp4G/Zq37U7RzAuIgpRlQcszB8Md83GfB/Ccjc1gcRi vLrWWf07aXEmRsLoOewsJ0c/SU83XRsN7ZSKwTTX2pwjOvaU0DwI3WSvMOhKPVw7ce TIYafd4beVOhmwdWWpihaeZMKqnGUQ+grakwzmU4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725838AbgFAKys (ORCPT ); Mon, 1 Jun 2020 06:54:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:60166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725788AbgFAKys (ORCPT ); Mon, 1 Jun 2020 06:54:48 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7190920679; Mon, 1 Jun 2020 10:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591008886; bh=3IYFoIJiG5PoHkFydzxdFiMsv/lU03Wjp/4Ff6WOvOQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PEdAQINexhOJD/3gu07yyuAOOTqjReLGszpDBVhj8mNFHf8O2QfGreVtiJCCTNmBQ m+ew93I2bHAbf22fG8//i6/32lPrmXUG/3+klVGZGAJ3kHqDBN99rWZ+abVmiVhmL8 OOl6AfRh7iYnv186QK6vbm+GSHT33z8jjz1EXPaw= Date: Mon, 1 Jun 2020 12:54:44 +0200 From: Greg Kroah-Hartman To: Helge Deller Cc: stable@vger.kernel.org, Ben Hutchings Subject: Re: [PATCH] parisc: Fix kernel panic in mem_init() Message-ID: <20200601105444.GA124421@kroah.com> References: <20200530093402.GA8212@ls3530.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200530093402.GA8212@ls3530.fritz.box> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Sat, May 30, 2020 at 11:34:02AM +0200, Helge Deller wrote: > Dear stable kernel maintainers, > can you please apply this patch to all 3.x and 4.x stable kernels? > Based on upstream commit bf71bc16e02162388808949b179d59d0b571b965 > which doesn't apply out of the box on older kernels. > ----------- > > The Debian kernel v5.6 triggers this kernel panic: > > Kernel panic - not syncing: Bad Address (null pointer deref?) > Bad Address (null pointer deref?): Code=26 (Data memory access rights trap) at addr 0000000000000000 > CPU: 0 PID: 0 Comm: swapper Not tainted 5.6.0-2-parisc64 #1 Debian 5.6.14-1 > IAOQ[0]: mem_init+0xb0/0x150 > IAOQ[1]: mem_init+0xb4/0x150 > RP(r2): start_kernel+0x6c8/0x1190 > Backtrace: > [<0000000040101ab4>] start_kernel+0x6c8/0x1190 > [<0000000040108574>] start_parisc+0x158/0x1b8 > > on a HP-PARISC rp3440 machine with this memory layout: > Memory Ranges: > 0) Start 0x0000000000000000 End 0x000000003fffffff Size 1024 MB > 1) Start 0x0000004040000000 End 0x00000040ffdfffff Size 3070 MB > > Fix the crash by avoiding virt_to_page() and similar functions in > mem_init() until the memory zones have been fully set up. > > Signed-off-by: Helge Deller > > diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c > index aae9b0d71c1e..10a52664e29f 100644 > --- a/arch/parisc/mm/init.c > +++ b/arch/parisc/mm/init.c > @@ -607,7 +607,7 @@ void __init mem_init(void) > > BITS_PER_LONG); > > high_memory = __va((max_pfn << PAGE_SHIFT)); > - set_max_mapnr(page_to_pfn(virt_to_page(high_memory - 1)) + 1); > + set_max_mapnr(max_low_pfn); > free_all_bootmem(); > > #ifdef CONFIG_PA11 Now queued up, thanks! greg k-h