netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ani Sinha <ani@arista.com>, Florian Westphal <fw@strlen.de>,
	netdev@vger.kernel.org, ani@anirban.org, fruggeri@arista.com
Subject: Re: kernel BUG in ipmr_queue_xmit()
Date: Fri, 30 Oct 2015 11:36:58 +0100	[thread overview]
Message-ID: <20151030103658.GA25931@breakpoint.cc> (raw)
In-Reply-To: <1446178542.6254.6.camel@edumazet-glaptop2.roam.corp.google.com>

Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > Signed-off-by: Ani Sinha <ani@arista.com>
> > ---
> >  net/ipv4/ipmr.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
> > index 866ee89..48df3cc 100644
> > --- a/net/ipv4/ipmr.c
> > +++ b/net/ipv4/ipmr.c
> > @@ -936,7 +936,9 @@ static void ipmr_cache_resolve(struct net *net, struct mr_table *mrt,
> >  
> >  			rtnl_unicast(skb, net, NETLINK_CB(skb).portid);
> >  		} else {
> > +			preempt_disable();
> >  			ip_mr_forward(net, mrt, skb, c, 0);
> > +			preempt_enable();
> >  		}
> >  	}
> >  }
> 
> I do not believe this fix is correct.

Yes, sorry.  I should have suggested local_bh_disable instead.

> Better replace the
> IP_INC_STATS_BH() by IP_INC_STATS()
>
> and IP_ADD_STATS_BH() by IP_ADD_STATS()

Hmm, whats the rationale for this?

Note that IP_ADD_STATS_BH in question is unconditional (not in
error path).  It seems that its virtually always called from softirq
except in the setsockopt case.

Thanks Eric.

  reply	other threads:[~2015-10-30 10:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 23:55 kernel BUG in ipmr_queue_xmit() Ani Sinha
2015-10-30  0:15 ` Florian Westphal
2015-10-30  1:41   ` Ani Sinha
2015-10-30  4:15     ` Eric Dumazet
2015-10-30 10:36       ` Florian Westphal [this message]
2015-10-30 10:40         ` Hannes Frederic Sowa
2015-10-30 10:48           ` Florian Westphal
2015-10-30 11:00             ` Eric Dumazet
2015-10-30 17:47               ` Ani Sinha
2015-10-30 19:12                 ` Eric Dumazet
2015-10-30 21:10                   ` Ani Sinha
2015-10-30 23:54                   ` [PATCH 1/1] ipmr: fix possible race resulting from improper usage of IP_INC_STATS_BH() in preemptible context Ani Sinha
2015-11-01 22:35                     ` Eric Dumazet
2015-11-02 20:57                     ` 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=20151030103658.GA25931@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=ani@anirban.org \
    --cc=ani@arista.com \
    --cc=eric.dumazet@gmail.com \
    --cc=fruggeri@arista.com \
    --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).