Re: [RFC] syscalls, x86: Add __NR_kcmp syscall

From: H. Peter Anvin
Date: Fri Jan 20 2012 - 11:58:10 EST


On 01/20/2012 08:29 AM, Cyrill Gorcunov wrote:

We've had kind of emergency pool before which were used in such cases.
These legitime cases can happen not that frequently, so I guess -- can
we use it again?

if (cookies[i][j])
continue;
else
cookies[i][j] = some-value;

One wont know which exactly values we were using.


I would not worry about get_random_bytes() returning nothing... if so, a lot of other places in the kernel would be broken.

The other thing is that for the multiplicative cookie you should OR in
the value (~(~0UL>> 1) | 1) in order to make sure that the value is (a)
large and (b) odd.


I see, i'll update (at first, I occasionally translated odd as 'even' which
made me really scratching the head, until I realized it's 'odd'! :)

Cyrill

--
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/