ANDROID: change function signatures for some random functions.
In 5.15.44 the functions add_device_randomness() and get_random_bytes()
want from:
void get_random_bytes(void *buf, int len);
->
void get_random_bytes(void *buf, size_t len);
void add_device_randomness(const void *buf, unsigned int len);
->
void add_device_randomness(const void *buf, size_t len);
As these functions are part of the GKI abi to be preserved, move them
back. As these are just lengths of the buffer, all is fine with the
size, they should never overflow.
Bug: 161946584
Fixes: 5dd066ade8 ("random: make more consistent use of integer types")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5430259958b9a904e6e8b950e11526332c919c0c
This commit is contained in:
@@ -445,7 +445,7 @@ static void _get_random_bytes(void *buf, size_t len)
|
||||
* wait_for_random_bytes() should be called and return 0 at least once
|
||||
* at any point prior.
|
||||
*/
|
||||
void get_random_bytes(void *buf, size_t len)
|
||||
void get_random_bytes(void *buf, int len)
|
||||
{
|
||||
warn_unseeded_randomness();
|
||||
_get_random_bytes(buf, len);
|
||||
@@ -864,7 +864,7 @@ int __init random_init(const char *command_line)
|
||||
* the entropy pool having similar initial state across largely
|
||||
* identical devices.
|
||||
*/
|
||||
void add_device_randomness(const void *buf, size_t len)
|
||||
void add_device_randomness(const void *buf, unsigned int len)
|
||||
{
|
||||
unsigned long entropy = random_get_entropy();
|
||||
unsigned long flags;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
struct notifier_block;
|
||||
|
||||
void add_device_randomness(const void *buf, size_t len);
|
||||
void add_device_randomness(const void *buf, unsigned int len);
|
||||
void add_bootloader_randomness(const void *buf, size_t len);
|
||||
void add_input_randomness(unsigned int type, unsigned int code,
|
||||
unsigned int value) __latent_entropy;
|
||||
@@ -28,7 +28,7 @@ static inline void add_latent_entropy(void)
|
||||
static inline void add_latent_entropy(void) { }
|
||||
#endif
|
||||
|
||||
void get_random_bytes(void *buf, size_t len);
|
||||
void get_random_bytes(void *buf, int len);
|
||||
size_t __must_check get_random_bytes_arch(void *buf, size_t len);
|
||||
u32 get_random_u32(void);
|
||||
u64 get_random_u64(void);
|
||||
|
||||
Reference in New Issue
Block a user