[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241029153619.1743f07e@kernel.org>
Date: Tue, 29 Oct 2024 15:36:19 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Jeremy Kerr <jk@...econstruct.com.au>
Cc: Andrew Lunn <andrew@...n.ch>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Joel Stanley
<joel@....id.au>, Jacky Chou <jacky_chou@...eedtech.com>, Jacob Keller
<jacob.e.keller@...el.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net 1/2] net: ethernet: ftgmac100: prevent use after
free on unregister when using NCSI
On Tue, 29 Oct 2024 12:32:53 +0800 Jeremy Kerr wrote:
> As the ordering in ftgmac100_remove() is:
>
>
> if (priv->ndev)
> ncsi_unregister_dev(priv->ndev);
> unregister_netdev(netdev);
>
> which, is (I assume intentionally) symmetric with the _probe, which
> does:
>
> priv->ndev = ncsi_register_dev(netdev, ftgmac100_ncsi_handler);
>
> /* ... */
>
> register_netdev(netdev)
To be clear - symmetric means mirror image.
I agree with Andrew.
Powered by blists - more mailing lists