]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
random: convert to using fops->read_iter()
authorJens Axboe <axboe@kernel.dk>
Thu, 19 May 2022 23:31:36 +0000 (17:31 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 May 2022 07:24:09 +0000 (09:24 +0200)
commit09ea8bc7276aead310e5faa21ae29ceeecea87c9
treeea50ecbebfef5885db090cf3c3d2dbf0a26bf533
parent806afdc6d97fe17a9b96a8d6964f7d2da610ee58
random: convert to using fops->read_iter()

commit 1b388e7765f2eaa137cf5d92b47ef5925ad83ced upstream.

This is a pre-requisite to wiring up splice() again for the random
and urandom drivers. It also allows us to remove the INT_MAX check in
getrandom(), because import_single_range() applies capping internally.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
[Jason: rewrote get_random_bytes_user() to simplify and also incorporate
 additional suggestions from Al.]
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c