netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: David Ahern <dsahern@gmail.com>
Cc: Marek Majkowski <marek@cloudflare.com>,
	David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, kernel-team <kernel-team@cloudflare.com>
Subject: Re: NEIGH: BUG, double timer add, state is 8
Date: Fri, 5 Jul 2019 19:30:11 +0200	[thread overview]
Message-ID: <20190705173011.GA2882@localhost.localdomain> (raw)
In-Reply-To: <1f4be489-4369-01d1-41c6-1406006df9c5@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]

On Jul 05, David Ahern wrote:
> On 7/4/19 3:59 PM, Marek Majkowski wrote:
> > I found a way to hit an obscure BUG in the
> > net/core/neighbour.c:neigh_add_timer(), by piping two carefully
> > crafted messages into AF_NETLINK socket.
> > 
> > https://github.com/torvalds/linux/blob/v5.2-rc7/net/core/neighbour.c#L259
> > 
> >     if (unlikely(mod_timer(&n->timer, when))) {
> >         printk("NEIGH: BUG, double timer add, state is %x\n", n->nud_state);
> >         dump_stack();
> >      }
> > 
> > The repro is here:
> > https://gist.github.com/majek/d70297b9d72bc2e2b82145e122722a0c
> > 
> > wget https://gist.githubusercontent.com/majek/d70297b9d72bc2e2b82145e122722a0c/raw/9e140bcedecc28d722022f1da142a379a9b7a7b0/double_timer_add_bug.c
> 
> Thanks for the report - and the reproducer. I am on PTO through Monday;
> I will take a look next week if no one else does.

Hi David and Marek,

looking at the reproducer it seems to me the issue is due to the use of
'NTF_USE' from userspace.
Should we unschedule the neigh timer if we are in IN_TIMER receiving this
flag from userspace? (taking appropriate locking)

Regards,
Lorenzo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2019-07-05 17:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04 21:59 NEIGH: BUG, double timer add, state is 8 Marek Majkowski
2019-07-05 14:28 ` David Ahern
2019-07-05 17:30   ` Lorenzo Bianconi [this message]
2019-07-10 22:18     ` David Ahern
2019-07-11  7:54       ` Lorenzo Bianconi

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=20190705173011.GA2882@localhost.localdomain \
    --to=lorenzo.bianconi@redhat.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=kernel-team@cloudflare.com \
    --cc=marek@cloudflare.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).