[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <040df8130f6dffc4c4e519dc9241e1c35ed819ca.camel@codeconstruct.com.au>
Date: Wed, 30 Oct 2024 10:58:21 +0800
From: Jeremy Kerr <jk@...econstruct.com.au>
To: Jakub Kicinski <kuba@...nel.org>
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, Samuel Mendoza-Jonas
<sam@...dozajonas.com>
Subject: Re: [PATCH net 1/2] net: ethernet: ftgmac100: prevent use after
free on unregister when using NCSI
Hi all,
[+Sam, as ncsi maintainer]
> So, this worth a try with the _remove sequence reordered with respect
> to the ncsi device. I'll work on a replacement patch to see if that
> can be done without other fallout, and will send a follow-up soon.
OK, not so simple. ftgmac100_probe does a:
ncsi_register_dev()
-> dev_add_pack()
register_netdev()
- where ptype.dev is the ftgmac netdev.
So we'd want to restructure the _remove to do:
unregister_netdev()
ncsi_unregister_dev()
-> dev_remove_pack()
However, we (sensibly) can't do the unregister_netdev() with a
packet-type handler still in place.
Sam: would it make sense to move the dev_add_pack() / dev_remove_pack()
to the ncsi layer's ncsi_start_dev() / ncsi_stop_dev() ? The channel
monitor is disabled on stop, so we shouldn't expect to receive any
further NCSI ethertype packets.
Cheers,
Jeremy
Powered by blists - more mailing lists