From: "George Spelvin" <linux@horizon.com>
To: davem@davemloft.net, linux@horizon.com
Cc: dan@doxpara.com, gerrit@erg.abdn.ac.uk,
herbert@gondor.hengli.com.au, linux-kernel@vger.kernel.org,
mpm@selenic.com, netdev@vger.kernel.org, w@1wt.eu
Subject: Re: [PATCH 0/2] Improve sequence number generation.
Date: 20 Aug 2011 20:49:39 -0400 [thread overview]
Message-ID: <20110821004939.10392.qmail@science.horizon.com> (raw)
In-Reply-To: <20110820.164436.684817976385970137.davem@davemloft.net>
>> While the increase to 32 bits is definitely desirable, and defends
>> against a much less sophisticated attack, I'm concerned that this is a
>> case of robbing Peter to pay Paul.
> I disagree, attacking this random number selection is much more theoretical
> than the brute force attacks possible on 24-bits of entropy.
Can you explain more precisely what you disagree with?
What you state after the comma appears to be agreeing with what I
wrote (it seems like a restatement of my first two clauses), so I'm
unenlightened as to where the disagreement is.
I'm not saying you didn't address a real problem, just that fixing
one problem exposed another, and it would be nice to address *both*.
> Show me a usable attack on a real system, then we can talk.
If you like. It's about a week of implementation work. (And I
don't have 1 week/week of free time, so more than that elapsed.)
> By comparison, real attacks against the 24-bit value have been
> demonstrated.
Anywhere that I can see?
>> 2) Do *both*: Use a fixed 32-bit offset *plus* a time-varing one.
>> They can be added together and provide the security advantages of
>> both. The only cost is having to compute two hashes per SYN.
>>
>> The main problem here is coming up with a hash function fast enough
>> that computing both hashes is no slower than one MD5 invocation.
> Doubling the hashing cost is a non-starter. Going to MD5 itself was
> a huge lose, and was right at the brink of acceptable performance loss.
>
> This whole change was nearly nixed because of the cost introduced
> merely by going to MD5.
Okay, I'll make certain a proposed solution is strictly faster than MD5.
I was asking about performance goals, and you've given me an answer.
Thank you very much!
The patch comment was fairly offhand about the performance cost, and
prior discussion was apparently private, so it wasn't clear how much
pain people experienced.
My only other question is whether IPv6 on x86-32 specificaly needs to be
faster than MD5. Is that negotiable, or is that also a hard limit?
(This is challenging because it's trying to hash 288 bits of address material
in 224 bits of available registers.)
Eureka! The possible source addresses are very limited. It's possible to
pre-hash them, then you only have 160 bits of per-connection variability,
which can fit in a second hash block.
This requires finding somewhere in the network stack to store the
pre-hashed IPv6 addresses, as well as a fallback to use when spoofing
other source addresses, but that shouldn't be TOO difficult.
>> 3) Extend the 24-bit time-varying hash to a 28-bit one.
>> This can cause the sequence numbers to wrap in 7/8 of the time
>> they would with a fixed offset, but that doesn't seem too bad.
>> (That's worst case; it's a triangular distribution centered
>> on 15/16.)
> I want to stay with a 32-bits of entropy, thank you very much.
My goal is to give you *both*. 32 bits fixed + 28 bits time-varying.
An attacker would have to cryptanalyze the 32 bits (which the 28 bits
makes harder) *and* brute-force the 28 bits.
(It's almost certainly simpler to brute-force 32 bits.)
Thank you for your response!
next prev parent reply other threads:[~2011-08-21 0:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20110816.021031.1778295949152117484.davem@davemloft.net>
2011-08-16 10:30 ` get_random_int() should use hash[1] George Spelvin
2011-08-20 23:39 ` [PATCH 0/2] Improve sequence number generation George Spelvin
2011-08-20 23:44 ` David Miller
2011-08-21 0:49 ` George Spelvin [this message]
2011-08-21 1:28 ` Willy Tarreau
2011-08-21 3:04 ` George Spelvin
2011-08-21 3:27 ` Ted Ts'o
2011-08-21 4:02 ` Herbert Xu
2011-08-22 2:06 ` George Spelvin
2011-08-07 1:50 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=20110821004939.10392.qmail@science.horizon.com \
--to=linux@horizon.com \
--cc=dan@doxpara.com \
--cc=davem@davemloft.net \
--cc=gerrit@erg.abdn.ac.uk \
--cc=herbert@gondor.hengli.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=netdev@vger.kernel.org \
--cc=w@1wt.eu \
/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
all inboxes | Powered by JetHome®