From: "George Spelvin" <linux@sciencehorizons.net>
To: Jason@zx2c4.com, vegard.nossum@gmail.com
Cc: djb@cr.yp.to, jeanphilippe.aumasson@gmail.com,
kernel-hardening@lists.openwall.com,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
linux@sciencehorizons.net, rusty@rustcorp.com.au,
torvalds@linux-foundation.org
Subject: Re: [PATCH] siphash: add cryptographically secure hashtable function
Date: 10 Dec 2016 10:35:17 -0500 [thread overview]
Message-ID: <20161210153517.30834.qmail@ns.sciencehorizons.net> (raw)
In-Reply-To: <CAOMGZ=HMTZhBOh0jTBT4cyMuK5s-D51FFUtWUWyMV7VX0U2L0w@mail.gmail.com>
> There's a 32-bit secret random salt (inet_ehash_secret) which means
> that in practice, inet_ehashfn() will select 1 out of 2^32 different
> hash functions at random each time you boot the kernel; without
> knowing which one it selected, how can a local or remote attacker can
> force IPv4 connections/whatever to go into a single hash bucket?
By figuring out the salt. The thing is, the timing of hash table lookups
*is externally visible*. If I create connections to the target, then
see which ones make responses on previous connections slightly slower,
I gain information about the salt.
I dont't know *where* in the hash table the collissions occur, but I
know *which* inputs collide, and that's enough for me to learn something.
(I need more connections than the size of the hash table, but even
with just one IP source I can use 64K ports on my end times however
many the target has open on its end.)
With enough information (google "unicity distance") I can recover the
entire salt. It's not like I care about the cryptographic strength of
the hash; simply trying all 4 billion possible seeds is pretty fast on
a 4 GHz processor.
Once that happens, I can choose a target connection whose timing I can't
observe directly and pack its hash chain without being obvious about it.
> I am happy to be proven wrong, but you make it sound very easy to
> exploit the current situation, so I would just like to ask whether you
> have a concrete way to do that?
I don't think anyone's implemented an attack on this particular hash
table yet, and the reason it hasn't been urgent is that it's just a mild
DoS attack it makes the computer noticeably slower withough disabling
it completely.
But the general style of attack is well known and has been repeatedly
demonstrated. Its practicality is not in question. The only question is
whether it's *more* practical that simpler techniques that don't depend
on any such algorithmic subtlety like brute-force flooding.
But if the history of Internet security has taught us one thing, it's
that naively hoping something won't be a problem is doomed.
The main issue is performance. IPv6 addresses are big, and although
SipHash is fast by the standard of cryptographic hashes, it's far slower
than jhash or any other non-cryptographic hash.
prev parent reply other threads:[~2016-12-10 15:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-09 18:36 Jason A. Donenfeld
2016-12-10 12:37 ` [kernel-hardening] " Greg KH
2016-12-11 15:30 ` Jason A. Donenfeld
2016-12-11 20:43 ` Greg KH
2016-12-12 3:48 ` [PATCH v2] " Jason A. Donenfeld
2016-12-12 4:01 ` Linus Torvalds
2016-12-12 5:48 ` Jason A. Donenfeld
2016-12-12 21:37 ` Linus Torvalds
2016-12-12 22:18 ` [PATCH v3] " Jason A. Donenfeld
2016-12-12 23:01 ` Andi Kleen
2016-12-13 8:39 ` Eric Biggers
2016-12-13 19:26 ` Linus Torvalds
2016-12-13 22:43 ` Jason A. Donenfeld
2016-12-13 22:48 ` [PATCH v4] " Jason A. Donenfeld
2016-12-12 5:42 ` [PATCH v2] " Eric Biggers
2016-12-12 21:17 ` Jason A. Donenfeld
2016-12-10 14:17 ` [PATCH] " Vegard Nossum
2016-12-10 15:35 ` George Spelvin [this message]
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=20161210153517.30834.qmail@ns.sciencehorizons.net \
--to=linux@sciencehorizons.net \
--cc=Jason@zx2c4.com \
--cc=djb@cr.yp.to \
--cc=jeanphilippe.aumasson@gmail.com \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=torvalds@linux-foundation.org \
--cc=vegard.nossum@gmail.com \
/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®