lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201021102315.3dab7bc9@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Wed, 21 Oct 2020 10:23:15 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Defang Bo <bodefang@....com>
Cc:     siva.kallam@...adcom.com, prashant@...adcom.com,
        mchan@...adcom.com, davem@...emloft.net, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] tg3: Avoid NULL pointer dereference in
 netif_device_attach()

On Wed, 21 Oct 2020 15:38:09 +0800 Defang Bo wrote:
> Similar to commit<1b0ff89852d7>("tg3: Avoid NULL pointer dereference in tg3_io_error_detected()")
> This patch avoids NULL pointer dereference add a check for netdev being NULL on tg3_resume().
> 
> Signed-off-by: Defang Bo <bodefang@....com>

Are you actually hitting this error or can otherwise prove it may
happen?

PCIe error handlers could reasonably happen asynchronously during
probe, but suspend/resume getting called on a device that wasn't fully
probed sounds like something that should be prevented by the bus.

> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index ae756dd..345c6aa 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -18099,7 +18099,7 @@ static int tg3_resume(struct device *device)
>  
>  	rtnl_lock();
>  
> -	if (!netdev || !netif_running(dev))
> +	if (!dev || !netif_running(dev))
>  		goto unlock;
>  
>  	netif_device_attach(dev);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ