mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Cc: Ilya Dryomov <[email protected]> Cc: "Yan, Zheng" <[email protected]> Cc: Sage Weil <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
This commit is contained in:
parent
6787ab81b2
commit
ae5b806a3d
1 changed files with 5 additions and 1 deletions
|
|
@ -611,7 +611,11 @@ struct ceph_client *ceph_create_client(struct ceph_options *opt, void *private)
|
|||
{
|
||||
struct ceph_client *client;
|
||||
struct ceph_entity_addr *myaddr = NULL;
|
||||
int err = -ENOMEM;
|
||||
int err;
|
||||
|
||||
err = wait_for_random_bytes();
|
||||
if (err < 0)
|
||||
return ERR_PTR(err);
|
||||
|
||||
client = kzalloc(sizeof(*client), GFP_KERNEL);
|
||||
if (client == NULL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue