lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 02 Sep 2009 15:03:29 +0200
From:	Jens Rosenboom <me@...r.de>
To:	YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
Cc:	Linux Network Developers <netdev@...r.kernel.org>
Subject: Re: [RFC] net/core: Delay neighbor only if it has been used after
 confirmed

On Wed, 2009-09-02 at 21:22 +0900, YOSHIFUJI Hideaki wrote:
> Hello.
> 
> Jens Rosenboom wrote:
> > When doing some IPv6 testing with the router advertising a small (e.g. 5
> > seconds) reachable time, I noticed that after the traffic has stopped,
> > hosts continue to exchange ND packets every 10 seconds. This is due to
> > neigh_timer_handler() only checking neigh->used and puts a neighbor into
> > NUD_DELAY state even if neigh->confirmed may be >= neigh->used.
> 
> Well, as you can see in neigh_periodic_timer():
> |                if (time_before(n->used, n->confirmed))
> |                        n->used = n->confirmed;
> time_after_eq(n->used, n->confirmed) should be taken valid;
> confirmed <= used <= now <= jiffies

Isn't there a chance that neigh_timer_handler() is run before the
periodic timer fixes this? Otherwise I agree that the test could just
say (n->used != n->confirmed).

> > The following patch for net-next-2.6 fixes this behaviour for my IPv6
> > setup, however I would like to hear some opinion on whether this might
> > have some negative influence on other protocols that use this code.
> > 
> > I also think that it would make more sense to compute the time for the
> > delay timer starting from neigh->used instead of using now (second part
> > of the patch).
> 
> okay, but I would rather have this in another patch.
> 
> > diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> > index 5bc4ad5..ca20162 100644
> > --- a/net/core/neighbour.c
> > +++ b/net/core/neighbour.c
> > @@ -820,12 +820,13 @@ static void neigh_timer_handler(unsigned long arg)
> >  			NEIGH_PRINTK2("neigh %p is still alive.\n", neigh);
> >  			next = neigh->confirmed + neigh->parms->reachable_time;
> >  		} else if (time_before_eq(now,
> > -					  neigh->used + neigh->parms->delay_probe_time)) {
> > +					  neigh->used + neigh->parms->delay_probe_time) &&
> > +			   time_after(neigh->confirmed, neigh->used)) {
> >  			NEIGH_PRINTK2("neigh %p is delayed.\n", neigh);
> >  			neigh->nud_state = NUD_DELAY;
> 
> I think your change should be
> | time_after(neigh->used, neigh->confirmed)
> or
> | time_before(neigh->confirmed, neigh->used)
> 
> ("_eq" is removed because there is a little chance
> that the neighbor had been confirmed just before it was
> used.  It is not interesting for us at this moment.)
> 
> No?

Yes, you are right, this test should be reversed. But together with your
remarks above, this probably means that the whole stuff also works fine
if we completely remove this if-branch.

> And, this "if" for REACHABLE->DELAY may be completely needless.
> Timer in REACHABLE is only for state transition for toward REACHABLE
> or STALE.

Well, this part has been there for a long time, at least it looks pretty
much the same in the first git version, so I would be a bit reluctant to
completely remove it, but since that would probably also solve my
problem, I also wouldn't object that proposition. ;-)

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ