From: Daniel Lezcano <dlezcano@fr.ibm.com>
To: Brian Haley <brian.haley@hp.com>
Cc: David Miller <davem@davemloft.net>,
containers <containers@lists.osdl.org>,
netdev@vger.kernel.org
Subject: Re: [PATCH 1/2] netns: fix NULL-dereference in dev_net()
Date: Sat, 16 Aug 2008 23:30:09 +0200 [thread overview]
Message-ID: <48A746E1.90703@fr.ibm.com> (raw)
In-Reply-To: <48A4871D.1030708@hp.com>
Brian Haley wrote:
> Change dev_net() to handle a NULL argument - return &init_net instead.
>
> -Brian
>
> Signed-off-by: Brian Haley <brian.haley@hp.com>
Did you fall into the case where the argument was NULL ?
If it is the case, I think it is not the proper way to handle that.
IMHO, this is the symptom the code which calls this function has a
problem with the network namespace and it should be changed to be
correct. eg, the code is assuming the network device is never null and
so the network namespace can be retrieved from it, a correct fix may be
to pass the network namespace as parameter of the function.
Returning &init_net if the network device is null will gracefully avoid
the kernel oopsing but will lead to some inconsistent behaviour and
confusion with what is happening with the namespace.
IMO, we should be radical and let the kernel oopsing, giving us only one
action which is to fix asap the bug correctly.
Thanks.
-- Daniel
next prev parent reply other threads:[~2008-08-16 21:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-14 19:27 [PATCH 1/2] netns: fix NULL-dereference in dev_net() Brian Haley
2008-08-14 19:55 ` [Devel] " Alexey Dobriyan
2008-08-14 20:01 ` Brian Haley
2008-08-14 20:20 ` Denis V. Lunev
2008-08-14 20:29 ` Brian Haley
2008-08-16 21:30 ` Daniel Lezcano [this message]
2008-08-17 22:34 ` David Miller
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=48A746E1.90703@fr.ibm.com \
--to=dlezcano@fr.ibm.com \
--cc=brian.haley@hp.com \
--cc=containers@lists.osdl.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).