Re: Algoritmic Complexity Attacks and 2.4.20 the dcache code

From: David S. Miller (davem@redhat.com)
Date: Sat May 31 2003 - 04:07:08 EST


From: "David Schwartz" <davids@xxxxxxxxxxxxx>
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/