From: "Gao Feng" <gfree.wind@foxmail•com>
To: "'David Miller'" <davem@davemloft•net>
Cc: <jiri@resnulli•us>, <mareklindner@neomailbox•ch>,
<sw@simonwunderlich•de>, <a@unstable•cc>, <kuznet@ms2•inr.ac.ru>,
<jmorris@namei•org>, <yoshfuji@linux-ipv6•org>, <kaber@trash•net>,
<steffen.klassert@secunet•com>, <herbert@gondor•apana.org.au>,
<netdev@vger•kernel.org>
Subject: RE: [PATCH net v4 00/12] Fix possbile memleaks when fail to register_netdevice
Date: Wed, 3 May 2017 08:33:02 +0800 [thread overview]
Message-ID: <000b01d2c3a4$d3b91260$7b2b3720$@foxmail.com> (raw)
In-Reply-To: <20170502.153029.1605231216574026914.davem@davemloft.net>
Hi David
> From: David Miller [mailto:davem@davemloft•net]
> Sent: Wednesday, May 3, 2017 3:30 AM
> From: gfree.wind@foxmail•com
> Date: Tue, 2 May 2017 13:58:42 +0800
>
[...]
> >
> > This solution doesn't only make sure free all resources in any case,
> > but also follows the original desgin that some resources could be kept
> > until the destructor executes normally after register the device
> > successfully.
>
> I want to think about this some more.
>
> It is really unfortunate that resources are allocated strictly from the
ndo_init()
> yet released in two different callbacks which are invoked only in certain
> (different) situations.
>
> Just the fact that we have to make an internal netdev state test in the
> ndo_uninit callback to get this right is a big red flag to me.
Yes, I am very agree with you.
This fix is just like a workaround under current framework.
The root is that allocate in one spot, but free them at two spots.
It means all ndo_uninit need to handle this case if allocate some resource
and free them in the destructor.
It should be done by the framework.
I thought about if there was a better solution to fix it.
But I think it need to modify the framework of net_device, it seems not good
as a bug fix to net.git.
Best Regards
Feng
next prev parent reply other threads:[~2017-05-03 0:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 5:58 [PATCH net v4 00/12] Fix possbile memleaks when fail to register_netdevice gfree.wind
2017-05-02 5:58 ` [PATCH net v4 01/12] driver: dummy: Fix one possbile memleak " gfree.wind
2017-05-02 5:58 ` [PATCH net v4 02/12] driver: ifb: " gfree.wind
2017-05-02 5:58 ` [PATCH net v4 03/12] driver: loopback: " gfree.wind
2017-05-02 5:58 ` [PATCH net v4 04/12] driver: team: " gfree.wind
2017-05-02 5:58 ` [PATCH net v4 05/12] driver: veth: " gfree.wind
2017-05-02 5:58 ` [PATCH net v4 06/12] net: ip6_gre: " gfree.wind
2017-05-02 6:59 ` [PATCH net v4 07/12] ip6_tunnel: " gfree.wind
2017-05-02 11:10 ` [PATCH net v4 00/12] Fix possbile memleaks " Gao Feng
2017-05-02 13:34 ` [PATCH net v4 08/12] net: ip6_vti: Fix one possbile memleak " gfree.wind
2017-05-02 13:37 ` [PATCH net v4 09/12] net: ip_tunnel: " gfree.wind
2017-05-02 13:39 ` [PATCH net v4 10/12] net: sit: " gfree.wind
2017-05-02 13:41 ` [PATCH net v4 11/12] net: vlan: " gfree.wind
2017-05-02 14:17 ` [PATCH net v4 12/12] net: batman-adv: " gfree.wind
2017-05-02 19:30 ` [PATCH net v4 00/12] Fix possbile memleaks " David Miller
2017-05-03 0:33 ` Gao Feng [this message]
2017-05-07 22:25 ` David Miller
2017-05-08 4:18 ` Gao Feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000b01d2c3a4$d3b91260$7b2b3720$@foxmail.com' \
--to=gfree.wind@foxmail$(echo .)com \
--cc=a@unstable$(echo .)cc \
--cc=davem@davemloft$(echo .)net \
--cc=herbert@gondor$(echo .)apana.org.au \
--cc=jiri@resnulli$(echo .)us \
--cc=jmorris@namei$(echo .)org \
--cc=kaber@trash$(echo .)net \
--cc=kuznet@ms2$(echo .)inr.ac.ru \
--cc=mareklindner@neomailbox$(echo .)ch \
--cc=netdev@vger$(echo .)kernel.org \
--cc=steffen.klassert@secunet$(echo .)com \
--cc=sw@simonwunderlich$(echo .)de \
--cc=yoshfuji@linux-ipv6$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox