All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Where exactly will arch_fast_hash be used
@ 2014-12-07  5:20 George Spelvin
  2014-12-07  9:28 ` Herbert Xu
  2014-12-07 13:14 ` Hannes Frederic Sowa
  0 siblings, 2 replies; 26+ messages in thread
From: George Spelvin @ 2014-12-07  5:20 UTC (permalink / raw)
  To: herbert; +Cc: dborkman, hannes, linux, linux-kernel, netdev, tgraf

If you want DoS-resistant hash tables, I'm working on adding SipHash
to the kernel.

This is a keyed pseudo-random function designed specifically for that
application.  I am starting with ext4 directory hashes, and then intended
to expand to secure sequence numbers (since it's far faster than MD5).

(I'm trying to figure out a good interface, since the crypto API
is a bit heavy for something to heavily optimized.)

But one comment caught my eye:
> Even if security wasn't an issue, straight CRC32 has really poor
> lower-order bit distribution, which makes it a terrible choice for
> a hash table that simply uses the lower-order bits.

Er... huh?  That's the first time I've heard that claim, and while I'm not
Philip Koopman or Guy Castagnoli, I thought I understood CRCs pretty well.

CRCs generally mix bits pretty well.  The sparse 16-bit CRCs chosen
for implementation simplicity had some limitations, but the Castagnoli
polynomial is quite dense.

And their mathematical symmetry means that the low bits really shouldn't
be any different from any other bits.  But if it is an issue, it's just
as easy work to shift down the correct number of high bits rather than
using the low.

Can you point me to a source for that statement?

^ permalink raw reply	[flat|nested] 26+ messages in thread
* Where exactly will arch_fast_hash be used
@ 2014-12-04  8:11 Herbert Xu
  2014-12-04 12:34 ` Hannes Frederic Sowa
  2014-12-04 15:26 ` Thomas Graf
  0 siblings, 2 replies; 26+ messages in thread
From: Herbert Xu @ 2014-12-04  8:11 UTC (permalink / raw)
  To: Thomas Graf, Daniel Borkmann, David S. Miller, Theodore Ts'o,
	netdev, Linux Kernel Mailing List

Hi:

While working on rhashtable it came to me that this whole concept
of arch_fast_hash is flawed.  CRCs are linear functions so it's
fairly easy for an attacker to identify collisions or at least
eliminate a large amount of search space (e.g., controlling the
last bit of the hash result is almost trivial, even when you add
a random seed).

So what exactly are we going to use arch_fast_hash for? Presumably
it's places where security is never goint to be an issue, right?

Even if security wasn't an issue, straight CRC32 has really poor
lower-order bit distribution, which makes it a terrible choice for
a hash table that simply uses the lower-order bits.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2014-12-09 14:25 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-07  5:20 Where exactly will arch_fast_hash be used George Spelvin
2014-12-07  9:28 ` Herbert Xu
2014-12-07 10:02   ` George Spelvin
2014-12-07 12:51     ` Herbert Xu
2014-12-07 13:23       ` George Spelvin
2014-12-07 14:06         ` Hannes Frederic Sowa
2014-12-07 21:33           ` George Spelvin
2014-12-08 11:25             ` Hannes Frederic Sowa
2014-12-08 16:19               ` George Spelvin
2014-12-08 16:32                 ` Hannes Frederic Sowa
2014-12-09 14:24         ` Herbert Xu
2014-12-07 13:14 ` Hannes Frederic Sowa
2014-12-07 13:30   ` George Spelvin
2014-12-07 13:41     ` Hannes Frederic Sowa
2014-12-07 13:52       ` Hannes Frederic Sowa
  -- strict thread matches above, loose matches on Subject: below --
2014-12-04  8:11 Herbert Xu
2014-12-04 12:34 ` Hannes Frederic Sowa
2014-12-04 13:14   ` Daniel Borkmann
2014-12-04 15:26 ` Thomas Graf
2014-12-04 15:29   ` Herbert Xu
2014-12-04 15:39     ` Thomas Graf
2014-12-04 15:43       ` Daniel Borkmann
2014-12-04 15:47         ` Herbert Xu
2014-12-04 15:51           ` Daniel Borkmann
2014-12-04 15:56           ` David Laight
2014-12-04 16:10             ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.