Re: Algoritmic Complexity Attacks and 2.4.20 the dcache code

David S. Miller
2003-05-31T08:50:31Z

From: "David Schwartz" <davids@webmaster.com>
Date: Sat, 31 May 2003 01:58:09 -0700

It's a macro, and the way it inlines, it should be obvious in
most cases that 'a', 'b', and 'c' can't be in the same place in memory.

Not true at all in Willy's test case, which was:

void test(u32 *a, u32 *b, u32 *c)
{
__jhash_mix(*a, *b, *c);
}

And here you certainly have absolutely NO idea where a, b, and
c might point to.

One is to check if the input pointer happens to be aligned on
a double-word boundary,

The most generic jhash() frankly isn't very interesting for
kernel applications, %99 of uses there can use the u32 optimized
version.

Even for dcache strings we can't use it because for each character
we have to test it against some terminating value or translate
it somehow.

I wouldn't waste any time at all on this thing.