lkml.org 
[lkml]   [2012]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] syscalls, x86: Add __NR_kcmp syscall
On Fri, Jan 20, 2012 at 12:40:08PM +0400, Cyrill Gorcunov wrote:
...
> +
> +static __init int kcmp_cookie_init(void)
> +{
> + int i, j;
> +
> + for (i = 0; i < KCMP_TYPES; i++) {
> + for (j = 0; j < 2; j++) {
> + get_random_bytes(&cookies[i][j], sizeof(cookies[i][j]));
> +
> + if (cookies[i][j])
> + continue;
> +
> + /*
> + * This is impossible case but just to be sure.
> + */
> + cookies_valid = false;
> + WARN_ONCE(1, "Can't get random bytes for k-pointers\n");
> + }
> + }
> +
> + cookies_valid = true;

darn, this string of course should be on top,
i'll update don't complain on this nit.

> +
> + return 0;
> +}

Cyrill


\
 
 \ /
  Last update: 2012-01-20 10:05    [W:0.070 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site