ceph: ensure RNG is seeded before using
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 8 Jun 2017 02:44:54 +0000 (22:44 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 20 Jun 2017 02:06:28 +0000 (22:06 -0400)
commitae5b806a3d3c23d9d3b57aecbe687a0bd82ab086
treeb5d8eb3b6f2d986cb3733ad19561a63961de0f93
parent6787ab81b29115b6d2e7d17fe8a8017da66197d6
ceph: ensure RNG is seeded before using

Ceph uses the RNG for various nonce generations, and it shouldn't accept
using bad randomness. So, we wait for the RNG to be properly seeded. We
do this by calling wait_for_random_bytes() in a function that is
certainly called in process context, early on, so that all subsequent
calls to get_random_bytes are necessarily acceptable.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: "Yan, Zheng" <zyan@redhat.com>
Cc: Sage Weil <sage@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
net/ceph/ceph_common.c