From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BCF6EC433EF for ; Thu, 3 Feb 2022 17:10:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YB8xWSaAzFGVeUoxsK5Y/zYYJaFHkdRujGFrX871HMc=; b=m1UnerQZz4ivAc WGhjxN6FFqvzRMXUadfEA1AHP+dZTL4+tAgygEzHYrd7nbCW6dvEgX6rYtJac95mtEJCI6dfc2Del KOp1DRQ+ojAAjBWCJVeYjI9C0sv6szpTgLUEU/RuUyi3q1udBhcg7wsT0hkkRma5J3oA/gS89b5dh LEHaavM4pYiL8PKRv73SWJ1w3PGPKHW04iZFYhxdlDwjpq4Y3GXWl9KPY5yY07qsfS9BYRfdX1mDL 9TXvuVGwUsXd0ENQxIiOxcB/iwRrNfj5Y6636/aHHOukH/jjkQi+zYRsMnCf1jnx2O0EkcKfcsanN X1G31tRfu/1zN4UligiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFfc1-0025K7-OK; Thu, 03 Feb 2022 17:09:37 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFfbx-0025Iq-C2 for linux-arm-kernel@lists.infradead.org; Thu, 03 Feb 2022 17:09:35 +0000 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 69394615DC; Thu, 3 Feb 2022 17:09:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83E18C340E8; Thu, 3 Feb 2022 17:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643908171; bh=lw506HOrYlGmJA6MjUljcsQtm/9VJ1py1ZAa57fuLK0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YxbDCrkX3gkzHafUpB2M8wBBLlWW9Hfml70NSQFstCd4V0iVKQO8QUW6OD6hewWV2 fF2Kjx6y/nQGOLpNGqjpmrzNSS8SIva0qXLUsp28JLnxVew7Ikn1S2HKfaYRqG6Cno e0co+ToS2LMjS7b7hiR/Mo4r1LSA61cmxFhPzPjQTKiRWG7X5nUvDfb5EgD+82yUGm F1wbLg1Pr1kDy2BNHVmn/EEe1Y60yY+o+O67HjXmFV9QMAky5vMm27uA+aFzPQzvZq vbplvEoe7m1YjKhQwzMegw5NI3gXijKiKaFihG6Ynsg2ZnHaLn7M4DuvJwjh2UyhjW DAt2tauffj5NQ== Date: Thu, 3 Feb 2022 10:09:27 -0700 From: Nathan Chancellor To: Sekhar Nori Cc: Bartosz Golaszewski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Arnd Bergmann Subject: Re: [PATCH] ARM: davinci: da850-evm: Avoid NULL pointer dereference Message-ID: References: <20211223222141.1253092-1-nathan@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211223222141.1253092-1-nathan@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220203_090933_506022_22A69083 X-CRM114-Status: GOOD ( 23.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Dec 23, 2021 at 03:21:41PM -0700, Nathan Chancellor wrote: > With newer versions of GCC, there is a panic in da850_evm_config_emac() > when booting multi_v5_defconfig in QEMU under the palmetto-bmc machine: > > Unable to handle kernel NULL pointer dereference at virtual address 00000020 > pgd = (ptrval) > [00000020] *pgd=00000000 > Internal error: Oops: 5 [#1] PREEMPT ARM > Modules linked in: > CPU: 0 PID: 1 Comm: swapper Not tainted 5.15.0 #1 > Hardware name: Generic DT based system > PC is at da850_evm_config_emac+0x1c/0x120 > LR is at do_one_initcall+0x50/0x1e0 > > The emac_pdata pointer in soc_info is NULL because davinci_soc_info only > gets populated on davinci machines but da850_evm_config_emac() is called > on all machines via device_initcall(). > > Move the rmii_en assignment below the machine check so that it is only > dereferenced when running on a supported SoC. > > Cc: stable@vger.kernel.org > Fixes: bae105879f2f ("davinci: DA850/OMAP-L138 EVM: implement autodetect of RMII PHY") > Link: https://lore.kernel.org/r/YcS4xVWs6bQlQSPC@archlinux-ax161/ > Reviewed-by: Arnd Bergmann > Signed-off-by: Nathan Chancellor > --- > arch/arm/mach-davinci/board-da850-evm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c > index 428012687a80..7f7f6bae21c2 100644 > --- a/arch/arm/mach-davinci/board-da850-evm.c > +++ b/arch/arm/mach-davinci/board-da850-evm.c > @@ -1101,11 +1101,13 @@ static int __init da850_evm_config_emac(void) > int ret; > u32 val; > struct davinci_soc_info *soc_info = &davinci_soc_info; > - u8 rmii_en = soc_info->emac_pdata->rmii_en; > + u8 rmii_en; > > if (!machine_is_davinci_da850_evm()) > return 0; > > + rmii_en = soc_info->emac_pdata->rmii_en; > + > cfg_chip3_base = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG); > > val = __raw_readl(cfg_chip3_base); > > base-commit: a7904a538933c525096ca2ccde1e60d0ee62c08e > -- > 2.34.1 > > Could someone pick this patch up? This is still broken on mainline and -next. Cheers, Nathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel