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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 9BEF2C43461 for ; Thu, 17 Sep 2020 13:16:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6192F2072E for ; Thu, 17 Sep 2020 13:16:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727033AbgIQNQX (ORCPT ); Thu, 17 Sep 2020 09:16:23 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:40600 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgIQNQB (ORCPT ); Thu, 17 Sep 2020 09:16:01 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kItlJ-00F58G-4V; Thu, 17 Sep 2020 15:15:45 +0200 Date: Thu, 17 Sep 2020 15:15:45 +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: <20200917131545.GL3526428@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 Hi Florian How forceful is this unbind? Can we actually block it while the interface is up? Or returning -EBUSY would make sense. Andrew