netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@tuxdriver.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org,
	kaber@trash.net
Subject: Re: [PATCH] ipv4: remove ip_rt_secret timer (v3)
Date: Fri, 7 May 2010 19:15:43 -0400	[thread overview]
Message-ID: <20100507231543.GB2098@localhost.localdomain> (raw)
In-Reply-To: <1273266271.2325.16.camel@edumazet-laptop>

On Fri, May 07, 2010 at 11:04:31PM +0200, Eric Dumazet wrote:
> Le vendredi 07 mai 2010 à 15:55 -0400, Neil Horman a écrit :
> > Hey-
> > 	Sorry for the delay, but I got interested in Erics suggestion of
> > changing how we update rt_genid, and had a few thoughts.  Heres version 3 of
> > this patch:
> > 
> 
> We have time, no hurry Neil.
> 
Yeah, but if I don't keep on top of they slip off my todo list pretty quick :)

> > Change Notes:
> > 
> > 1) Removed the secret_interval binary interface entry in the list (forgot to do
> > that before)
> > 
> > 2) Took Erics Suggestion to change the update for net->ipv4.rt_genid.  Now
> > instead of doing a small incremental change, we simply grab 32 new random bits.
> > 
> 
> My suggestion was to initialize _once_ at boot time, the _full_ 32bits.
> 
Apologies, my read of your statement was that you wanted to randomize the genid
every iteration, not just the first, to avoid the genid n+1 being within 256 of
the last genid.

> Not to change the perturbations, they are very fine, and need no extra
> CONFIG_SOME_MAGICAL_SWITCH.
> 
> We have a guarantee that no duplicates are delivered unless you perform
> 2^24 generations in a short period of time.
> 
Yes, I mentioned that, thats why I added the index check.

> But because you want to change full 32bits, you need a complex dupcheck
> thing ?
> 
We don't _need_ it, thats why I made it configurable.

> > 3) The change in (2) got me thinking that part of the reason we used the Jenkins
> > hash in rt_genid was to ensure non-repetion of id's in a short time period
> > (which is important, so as not to inadvertently reuse route cache entries that
> > should be getting expired).  While extra randomness makes it harder for
> > attackers to guess the secret, it makes it possible to return to previously
> > guessed values as well (if they're lucky).  As such, I created a configurable
> > option, CONFIG_GENID_DUPCHECK.  With this option on, the low order 8 bits of the
> > genid are replaced with a rolling counter, that increments on each new genid.
> > This creates in effect, a 256 deep list of previously used genid values.  In
> > rt_drop we compare the genids for duplicates.  If we find that 2 genid values
> > have different indexes, but idential remaining bits, they are noted as a repeat
> > genid, and we call rt_cache_invalidate to generate a new genid and avoid the
> > duplication problem.
> > 
> > 
> 
> This is not necessary and over engineering if you ask me.
> 
I can't say I disagree, but I was looking at this change based on your
suggestion.

> You now rely on probabilistic rules, and depends on get_random_bytes()
> be really random, or a new CONFIG setting...
> 
> What exact problem do you want to solve Neil ?
> 
You know good and well what I'm trying to do here, don't be thick.  The only
reason I was making changes to the genid in the first place was because you were
asking for them.  I'm more than happy to make a simpler version of this.
Apologies for not interpreting your previous request the way you had intended.

> Please submit your initial patch, with the small changes :
> 
> 1) Remove the secret_interval binary interface entry in the list 
> 
> 2) Initialize full 32bits at struct net init time.
> 
Yeah, ok.  I'll repost on monday.


Thanks
Neil




  reply	other threads:[~2010-05-07 23:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06 17:16 [PATCH] ipv4: remove ip_rt_secret timer Neil Horman
2010-05-06 17:32 ` Eric Dumazet
2010-05-06 18:02   ` Neil Horman
2010-05-06 18:33     ` Eric Dumazet
2010-05-06 19:54       ` Neil Horman
2010-05-06 20:10         ` Eric Dumazet
2010-05-06 20:25           ` Neil Horman
2010-05-06 20:29 ` [PATCH] ipv4: remove ip_rt_secret timer (v2) Neil Horman
2010-05-06 21:08   ` Eric Dumazet
2010-05-07  0:02     ` nhorman
2010-05-07 19:55 ` [PATCH] ipv4: remove ip_rt_secret timer (v3) Neil Horman
2010-05-07 21:04   ` Eric Dumazet
2010-05-07 23:15     ` Neil Horman [this message]
2010-05-08  1:01 ` [PATCH] ipv4: remove ip_rt_secret timer (v4) Neil Horman
2010-05-08  6:36   ` Eric Dumazet
2010-05-08  8:58     ` David Miller
2010-05-08 12:54     ` Neil Horman

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=20100507231543.GB2098@localhost.localdomain \
    --to=nhorman@tuxdriver.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.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).