Re: [PATCH v2 04/10] random: group initialization wait functions

From: Dominik Brodowski
Date: Sun Feb 13 2022 - 01:57:26 EST


> +/*
> + * Returns whether or not the urandom pool has been seeded and thus guaranteed
> + * to supply cryptographically secure random numbers. This applies to: the
> + * /dev/urandom device, the get_random_bytes function, and the get_random_{u32,
> + * ,u64,int,long} family of functions.
> + *
> + * Returns: true if the urandom pool has been seeded.
> + * false if the urandom pool has not been seeded.

I think this comment should be updated, as there is no "urandom pool";
instead we should refer to the "random pool" or the "random base pool".

> +/*
> + * Wait for the urandom pool to be seeded and thus guaranteed to supply
> + * cryptographically secure random numbers. This applies to: the /dev/urandom
> + * device, the get_random_bytes function, and the get_random_{u32,u64,int,long}
> + * family of functions. Using any of these functions without first calling
> + * this function forfeits the guarantee of security.
> + *
> + * Returns: 0 if the urandom pool has been seeded.
> + * -ERESTARTSYS if the function was interrupted by a signal.

Same here.

> +/*
> + * Add a callback function that will be invoked when the nonblocking
> + * pool is initialised.

Same here ("nonblocking pool").

Other than that, looks fine.

Thanks,
Dominik