From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] sfp: fix oops with ethtool -m Date: Tue, 18 Sep 2018 20:15:13 -0700 (PDT) Message-ID: <20180918.201513.2092519211105088804.davem@redhat.com> References: Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: andrew@lunn.ch, f.fainelli@gmail.com, netdev@vger.kernel.org To: rmk+kernel@armlinux.org.uk Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55812 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbeISIvE (ORCPT ); Wed, 19 Sep 2018 04:51:04 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Russell King Date: Tue, 18 Sep 2018 16:48:53 +0100 > If a network interface is created prior to the SFP socket being > available, ethtool can request module information. This unfortunately > leads to an oops: > > Unable to handle kernel NULL pointer dereference at virtual address 00000008 > pgd = (ptrval) > [00000008] *pgd=7c400831, *pte=00000000, *ppte=00000000 > Internal error: Oops: 17 [#1] SMP ARM > Modules linked in: > CPU: 0 PID: 1480 Comm: ethtool Not tainted 4.19.0-rc3 #138 > Hardware name: Broadcom Northstar Plus SoC > PC is at sfp_get_module_info+0x8/0x10 > LR is at dev_ethtool+0x218c/0x2afc > > Fix this by not filling in the network device's SFP bus pointer until > SFP is fully bound, thereby avoiding the core calling into the SFP bus > code. > > Fixes: ce0aa27ff3f6 ("sfp: add sfp-bus to bridge between network devices and sfp cages") > Reported-by: Florian Fainelli > Tested-by: Florian Fainelli > Signed-off-by: Russell King Applied and queued up for -stable.