All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, den@openvz.org, xemul@openvz.org,
	dlezcano@fr.ibm.com, benjamin.thery@bull.net
Subject: Re: [PATCH] netns: Don't receive new packets in a dead network namespace.
Date: Fri, 20 Jun 2008 18:54:02 -0700	[thread overview]
Message-ID: <m17icjeeo5.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <20080621012621.GA5035@martell.zuzino.mipt.ru> (Alexey Dobriyan's message of "Sat, 21 Jun 2008 05:26:21 +0400")

Alexey Dobriyan <adobriyan@gmail.com> writes:

> On Sat, Jun 21, 2008 at 04:51:25AM +0400, Alexey Dobriyan wrote:
>> On Fri, Jun 20, 2008 at 05:17:05PM -0700, Eric W. Biederman wrote:
>> > --- a/include/net/net_namespace.h
>> > +++ b/include/net/net_namespace.h
>> > @@ -95,6 +95,11 @@ extern struct list_head net_namespace_list;
>> >  #ifdef CONFIG_NET_NS
>> >  extern void __put_net(struct net *net);
>> >  
>> > +static inline int net_alive(struct net *net)
>> > +{
>> > +	return net && atomic_read(&net->count);
>> > +}
>> 
>> netns pointers are always valid, right?

I think they should be.  Given that net_alive is designed
to be called when the invariants aren't as they should be
I was just paranoid when I wrote it.

> Patch seems to help, BTW.

Thanks.  It fixed the problem for me after I reproduced it.

Eric


  reply	other threads:[~2008-06-21  2:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20 20:49 ICMP sockets destruction vs ICMP packets oops Alexey Dobriyan
2008-06-21  0:17 ` [PATCH] netns: Don't receive new packets in a dead network namespace Eric W. Biederman
2008-06-21  0:51   ` Alexey Dobriyan
2008-06-21  1:26     ` Alexey Dobriyan
2008-06-21  1:54       ` Eric W. Biederman [this message]
2008-06-21  5:17   ` 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=m17icjeeo5.fsf@frodo.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=adobriyan@gmail.com \
    --cc=benjamin.thery@bull.net \
    --cc=davem@davemloft.net \
    --cc=den@openvz.org \
    --cc=dlezcano@fr.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@openvz.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.