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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 8C5ADC433E2 for ; Thu, 17 Sep 2020 17:29:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34082221EC for ; Thu, 17 Sep 2020 17:29:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726202AbgIQR3g (ORCPT ); Thu, 17 Sep 2020 13:29:36 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:40972 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726574AbgIQR2q (ORCPT ); Thu, 17 Sep 2020 13:28:46 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kIxhm-00F6fZ-6y; Thu, 17 Sep 2020 19:28:22 +0200 Date: Thu, 17 Sep 2020 19:28:22 +0200 From: Andrew Lunn To: Florian Fainelli Cc: netdev@vger.kernel.org, hkallweit1@gmail.com, kuba@kernel.org, davem@davemloft.net Subject: Re: [PATCH net 1/2] net: phy: Avoid NPD upon phy_detach() when driver is unbound Message-ID: <20200917172822.GA3598897@lunn.ch> References: <20200917034310.2360488-1-f.fainelli@gmail.com> <20200917034310.2360488-2-f.fainelli@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200917034310.2360488-2-f.fainelli@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Sep 16, 2020 at 08:43:09PM -0700, Florian Fainelli wrote: > If we have unbound the PHY driver prior to calling phy_detach() (often > via phy_disconnect()) then we can cause a NULL pointer de-reference > accessing the driver owner member. The steps to reproduce are: > > echo unimac-mdio-0:01 > /sys/class/net/eth0/phydev/driver/unbind > ip link set eth0 down > > Fixes: cafe8df8b9bc ("net: phy: Fix lack of reference count on PHY driver") > Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Andrew