提交 3d03d8fb 编写于 作者: J Jason A. Donenfeld 提交者: Zheng Zengkai

random: re-add removed comment about get_random_{u32,u64} reseeding

stable inclusion
from stable-v5.10.119
commit bb563d06c5bc3d08bd5c8665d6b1da6865114cfd
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6BB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bb563d06c5bc3d08bd5c8665d6b1da6865114cfd

--------------------------------

commit dd7aa36e upstream.

The comment about get_random_{u32,u64}() not invoking reseeding got
added in an unrelated commit, that then was recently reverted by
0313bc27 ("Revert "random: block in /dev/urandom""). So this adds
that little comment snippet back, and improves the wording a bit too.
Reviewed-by: NDominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 9938dd14
...@@ -226,9 +226,10 @@ static void _warn_unseeded_randomness(const char *func_name, void *caller, void ...@@ -226,9 +226,10 @@ static void _warn_unseeded_randomness(const char *func_name, void *caller, void
* *
* These interfaces will return the requested number of random bytes * These interfaces will return the requested number of random bytes
* into the given buffer or as a return value. This is equivalent to * into the given buffer or as a return value. This is equivalent to
* a read from /dev/urandom. The integer family of functions may be * a read from /dev/urandom. The u32, u64, int, and long family of
* higher performance for one-off random integers, because they do a * functions may be higher performance for one-off random integers,
* bit of buffering. * because they do a bit of buffering and do not invoke reseeding
* until the buffer is emptied.
* *
*********************************************************************/ *********************************************************************/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册