History

random: make consistent use of buf and len

The current code was a mix of "nbytes", "count", "size", "buffer", "in", and so forth. Instead, let's clean this up by naming input parameters "buf" (or "ubuf") and "len", so that you always understand that you're reading this variety of function argument.

Jason A. Donenfeld committed 4 years ago

Commit a1940261 parent 7c3a8a12 files · +103 −108Browse files

Unified · Split

2 files
  1. drivers/char/random.c +97 −102
  2. include/linux/random.h +6 −6
drivers/char/random.c+97−102
@@ -209,7 +209,7 @@ static void _warn_unseeded_randomness(const char *func_name, void *caller) · 208 unmodified lines
209209 *
210210 * There are a few exported interfaces for use by other drivers:
211211 *
212− * void get_random_bytes(void *buf, size_t nbytes)
212+ * void get_random_bytes(void *buf, size_t len)
213213 * u32 get_random_u32()
214214 * u64 get_random_u64()
215215 * unsigned int get_random_int()
@@ -250,7 +250,7 @@ static DEFINE_PER_CPU(struct crng, crngs) = { · 34 unmodified lines
250250 };
251251
252252 /* Used by crng_reseed() and crng_make_state() to extract a new seed from the input pool. */
253−static void extract_entropy(void *buf, size_t nbytes);
253+static void extract_entropy(void *buf, size_t len);
254254
255255 /* This extracts a new crng key from the input pool. */
256256 static void crng_reseed(void)
@@ -404,24 +404,24 @@ static void crng_make_state(u32 chacha_state[CHACHA_STATE_WORDS], · 147 unmodified lines
404404 local_unlock_irqrestore(&crngs.lock, flags);
405405 }
406406
407−static void _get_random_bytes(void *buf, size_t nbytes)
407+static void _get_random_bytes(void *buf, size_t len)
408408 {
409409 u32 chacha_state[CHACHA_STATE_WORDS];
410410 u8 tmp[CHACHA_BLOCK_SIZE];
411− size_t len;
411+ size_t first_block_len;
412412
413− if (!nbytes)
413+ if (!len)
414414 return;
415415
416− len = min_t(size_t, 32, nbytes);
417− crng_make_state(chacha_state, buf, len);
418− nbytes -= len;
419− buf += len;
416+ first_block_len = min_t(size_t, 32, len);
417+ crng_make_state(chacha_state, buf, first_block_len);
418+ len -= first_block_len;
419+ buf += first_block_len;
420420
421− while (nbytes) {
422− if (nbytes < CHACHA_BLOCK_SIZE) {
421+ while (len) {
422+ if (len < CHACHA_BLOCK_SIZE) {
423423 chacha20_block(chacha_state, tmp);
424− memcpy(buf, tmp, nbytes);
424+ memcpy(buf, tmp, len);
425425 memzero_explicit(tmp, sizeof(tmp));
426426 break;
427427 }
@@ -429,7 +429,7 @@ static void _get_random_bytes(void *buf, size_t nbytes) · 1 unmodified line
429429 chacha20_block(chacha_state, buf);
430430 if (unlikely(chacha_state[12] == 0))
431431 ++chacha_state[13];
432− nbytes -= CHACHA_BLOCK_SIZE;
432+ len -= CHACHA_BLOCK_SIZE;
433433 buf += CHACHA_BLOCK_SIZE;
434434 }
435435
@@ -446,20 +446,20 @@ static void _get_random_bytes(void *buf, size_t nbytes) · 10 unmodified lines
446446 * wait_for_random_bytes() should be called and return 0 at least once
447447 * at any point prior.
448448 */
449−void get_random_bytes(void *buf, size_t nbytes)
449+void get_random_bytes(void *buf, size_t len)
450450 {
451451 warn_unseeded_randomness();
452− _get_random_bytes(buf, nbytes);
452+ _get_random_bytes(buf, len);
453453 }
454454 EXPORT_SYMBOL(get_random_bytes);
455455
456−static ssize_t get_random_bytes_user(void __user *buf, size_t nbytes)
456+static ssize_t get_random_bytes_user(void __user *ubuf, size_t len)
457457 {
458− size_t len, left, ret = 0;
458+ size_t block_len, left, ret = 0;
459459 u32 chacha_state[CHACHA_STATE_WORDS];
460460 u8 output[CHACHA_BLOCK_SIZE];
461461
462− if (!nbytes)
462+ if (!len)
463463 return 0;
464464
465465 /*
@@ -473,8 +473,8 @@ static ssize_t get_random_bytes_user(void __user *buf, size_t nbytes) · 7 unmodified lines
473473 * use chacha_state after, so we can simply return those bytes to
474474 * the user directly.
475475 */
476− if (nbytes <= CHACHA_KEY_SIZE) {
477− ret = nbytes - copy_to_user(buf, &chacha_state[4], nbytes);
476+ if (len <= CHACHA_KEY_SIZE) {
477+ ret = len - copy_to_user(ubuf, &chacha_state[4], len);
478478 goto out_zero_chacha;
479479 }
480480
@@ -483,17 +483,17 @@ static ssize_t get_random_bytes_user(void __user *buf, size_t nbytes) · 2 unmodified lines
483483 if (unlikely(chacha_state[12] == 0))
484484 ++chacha_state[13];
485485
486− len = min_t(size_t, nbytes, CHACHA_BLOCK_SIZE);
487− left = copy_to_user(buf, output, len);
486+ block_len = min_t(size_t, len, CHACHA_BLOCK_SIZE);
487+ left = copy_to_user(ubuf, output, block_len);
488488 if (left) {
489− ret += len - left;
489+ ret += block_len - left;
490490 break;
491491 }
492492
493− buf += len;
494− ret += len;
495− nbytes -= len;
496− if (!nbytes)
493+ ubuf += block_len;
494+ ret += block_len;
495+ len -= block_len;
496+ if (!len)
497497 break;
498498
499499 BUILD_BUG_ON(PAGE_SIZE % CHACHA_BLOCK_SIZE != 0);
@@ -667,24 +667,24 @@ unsigned long randomize_page(unsigned long start, unsigned long range) · 167 unmodified lines
667667 * use. Use get_random_bytes() instead. It returns the number of
668668 * bytes filled in.
669669 */
670−size_t __must_check get_random_bytes_arch(void *buf, size_t nbytes)
670+size_t __must_check get_random_bytes_arch(void *buf, size_t len)
671671 {
672− size_t left = nbytes;
672+ size_t left = len;
673673 u8 *p = buf;
674674
675675 while (left) {
676676 unsigned long v;
677− size_t chunk = min_t(size_t, left, sizeof(unsigned long));
677+ size_t block_len = min_t(size_t, left, sizeof(unsigned long));
678678
679679 if (!arch_get_random_long(&v))
680680 break;
681681
682− memcpy(p, &v, chunk);
683− p += chunk;
684− left -= chunk;
682+ memcpy(p, &v, block_len);
683+ p += block_len;
684+ left -= block_len;
685685 }
686686
687− return nbytes - left;
687+ return len - left;
688688 }
689689 EXPORT_SYMBOL(get_random_bytes_arch);
690690
@@ -695,15 +695,15 @@ EXPORT_SYMBOL(get_random_bytes_arch); · 4 unmodified lines
695695 *
696696 * Callers may add entropy via:
697697 *
698− * static void mix_pool_bytes(const void *in, size_t nbytes)
698+ * static void mix_pool_bytes(const void *buf, size_t len)
699699 *
700700 * After which, if added entropy should be credited:
701701 *
702− * static void credit_init_bits(size_t nbits)
702+ * static void credit_init_bits(size_t bits)
703703 *
704704 * Finally, extract entropy via:
705705 *
706− * static void extract_entropy(void *buf, size_t nbytes)
706+ * static void extract_entropy(void *buf, size_t len)
707707 *
708708 **********************************************************************/
709709
@@ -725,9 +725,9 @@ static struct { · 15 unmodified lines
725725 .lock = __SPIN_LOCK_UNLOCKED(input_pool.lock),
726726 };
727727
728−static void _mix_pool_bytes(const void *in, size_t nbytes)
728+static void _mix_pool_bytes(const void *buf, size_t len)
729729 {
730− blake2s_update(&input_pool.hash, in, nbytes);
730+ blake2s_update(&input_pool.hash, buf, len);
731731 }
732732
733733 /*
@@ -735,12 +735,12 @@ static void _mix_pool_bytes(const void *in, size_t nbytes) · 1 unmodified line
735735 * update the initialization bit counter; the caller should call
736736 * credit_init_bits if this is appropriate.
737737 */
738−static void mix_pool_bytes(const void *in, size_t nbytes)
738+static void mix_pool_bytes(const void *buf, size_t len)
739739 {
740740 unsigned long flags;
741741
742742 spin_lock_irqsave(&input_pool.lock, flags);
743− _mix_pool_bytes(in, nbytes);
743+ _mix_pool_bytes(buf, len);
744744 spin_unlock_irqrestore(&input_pool.lock, flags);
745745 }
746746
@@ -748,7 +748,7 @@ static void mix_pool_bytes(const void *in, size_t nbytes) · 1 unmodified line
748748 * This is an HKDF-like construction for using the hashed collected entropy
749749 * as a PRF key, that's then expanded block-by-block.
750750 */
751−static void extract_entropy(void *buf, size_t nbytes)
751+static void extract_entropy(void *buf, size_t len)
752752 {
753753 unsigned long flags;
754754 u8 seed[BLAKE2S_HASH_SIZE], next_key[BLAKE2S_HASH_SIZE];
@@ -777,12 +777,12 @@ static void extract_entropy(void *buf, size_t nbytes) · 22 unmodified lines
777777 spin_unlock_irqrestore(&input_pool.lock, flags);
778778 memzero_explicit(next_key, sizeof(next_key));
779779
780− while (nbytes) {
781− i = min_t(size_t, nbytes, BLAKE2S_HASH_SIZE);
780+ while (len) {
781+ i = min_t(size_t, len, BLAKE2S_HASH_SIZE);
782782 /* output = HASHPRF(seed, RDSEED || ++counter) */
783783 ++block.counter;
784784 blake2s(buf, (u8 *)&block, seed, i, sizeof(block), sizeof(seed));
785− nbytes -= i;
785+ len -= i;
786786 buf += i;
787787 }
788788
@@ -790,16 +790,16 @@ static void extract_entropy(void *buf, size_t nbytes) · 1 unmodified line
790790 memzero_explicit(&block, sizeof(block));
791791 }
792792
793−static void credit_init_bits(size_t nbits)
793+static void credit_init_bits(size_t bits)
794794 {
795795 static struct execute_work set_ready;
796796 unsigned int new, orig, add;
797797 unsigned long flags;
798798
799− if (crng_ready() || !nbits)
799+ if (crng_ready() || !bits)
800800 return;
801801
802− add = min_t(size_t, nbits, POOL_BITS);
802+ add = min_t(size_t, bits, POOL_BITS);
803803
804804 do {
805805 orig = READ_ONCE(input_pool.init_bits);
@@ -835,14 +835,12 @@ static void credit_init_bits(size_t nbits) · 29 unmodified lines
835835 * The following exported functions are used for pushing entropy into
836836 * the above entropy accumulation routines:
837837 *
838− * void add_device_randomness(const void *buf, size_t size);
839− * void add_hwgenerator_randomness(const void *buffer, size_t count,
840− * size_t entropy);
841− * void add_bootloader_randomness(const void *buf, size_t size);
842− * void add_vmfork_randomness(const void *unique_vm_id, size_t size);
838+ * void add_device_randomness(const void *buf, size_t len);
839+ * void add_hwgenerator_randomness(const void *buf, size_t len, size_t entropy);
840+ * void add_bootloader_randomness(const void *buf, size_t len);
841+ * void add_vmfork_randomness(const void *unique_vm_id, size_t len);
843842 * void add_interrupt_randomness(int irq);
844− * void add_input_randomness(unsigned int type, unsigned int code,
845− * unsigned int value);
843+ * void add_input_randomness(unsigned int type, unsigned int code, unsigned int value);
846844 * void add_disk_randomness(struct gendisk *disk);
847845 *
848846 * add_device_randomness() adds data to the input pool that
@@ -937,7 +935,7 @@ int __init random_init(const char *command_line) · 88 unmodified lines
937935 {
938936 ktime_t now = ktime_get_real();
939937 unsigned int i, arch_bytes;
940− unsigned long rv;
938+ unsigned long entropy;
941939
942940 #if defined(LATENT_ENTROPY_PLUGIN)
943941 static const u8 compiletime_seed[BLAKE2S_BLOCK_SIZE] __initconst __latent_entropy;
@@ -945,13 +943,13 @@ int __init random_init(const char *command_line) · 1 unmodified line
945943 #endif
946944
947945 for (i = 0, arch_bytes = BLAKE2S_BLOCK_SIZE;
948− i < BLAKE2S_BLOCK_SIZE; i += sizeof(rv)) {
949− if (!arch_get_random_seed_long_early(&rv) &&
950− !arch_get_random_long_early(&rv)) {
951− rv = random_get_entropy();
952− arch_bytes -= sizeof(rv);
946+ i < BLAKE2S_BLOCK_SIZE; i += sizeof(entropy)) {
947+ if (!arch_get_random_seed_long_early(&entropy) &&
948+ !arch_get_random_long_early(&entropy)) {
949+ entropy = random_get_entropy();
950+ arch_bytes -= sizeof(entropy);
953951 }
954− _mix_pool_bytes(&rv, sizeof(rv));
952+ _mix_pool_bytes(&entropy, sizeof(entropy));
955953 }
956954 _mix_pool_bytes(&now, sizeof(now));
957955 _mix_pool_bytes(utsname(), sizeof(*(utsname())));
@@ -978,14 +976,14 @@ int __init random_init(const char *command_line) · 20 unmodified lines
978976 * the entropy pool having similar initial state across largely
979977 * identical devices.
980978 */
981−void add_device_randomness(const void *buf, size_t size)
979+void add_device_randomness(const void *buf, size_t len)
982980 {
983981 unsigned long entropy = random_get_entropy();
984982 unsigned long flags;
985983
986984 spin_lock_irqsave(&input_pool.lock, flags);
987985 _mix_pool_bytes(&entropy, sizeof(entropy));
988− _mix_pool_bytes(buf, size);
986+ _mix_pool_bytes(buf, len);
989987 spin_unlock_irqrestore(&input_pool.lock, flags);
990988 }
991989 EXPORT_SYMBOL(add_device_randomness);
@@ -995,10 +993,9 @@ EXPORT_SYMBOL(add_device_randomness); · 3 unmodified lines
995993 * Those devices may produce endless random bits and will be throttled
996994 * when our pool is full.
997995 */
998−void add_hwgenerator_randomness(const void *buffer, size_t count,
999− size_t entropy)
996+void add_hwgenerator_randomness(const void *buf, size_t len, size_t entropy)
1000997 {
1001− mix_pool_bytes(buffer, count);
998+ mix_pool_bytes(buf, len);
1002999 credit_init_bits(entropy);
10031000
10041001 /*
@@ -1014,11 +1011,11 @@ EXPORT_SYMBOL_GPL(add_hwgenerator_randomness); · 9 unmodified lines
10141011 * Handle random seed passed by bootloader, and credit it if
10151012 * CONFIG_RANDOM_TRUST_BOOTLOADER is set.
10161013 */
1017−void add_bootloader_randomness(const void *buf, size_t size)
1014+void add_bootloader_randomness(const void *buf, size_t len)
10181015 {
1019− mix_pool_bytes(buf, size);
1016+ mix_pool_bytes(buf, len);
10201017 if (trust_bootloader)
1021− credit_init_bits(size * 8);
1018+ credit_init_bits(len * 8);
10221019 }
10231020 EXPORT_SYMBOL_GPL(add_bootloader_randomness);
10241021
@@ -1030,9 +1027,9 @@ static BLOCKING_NOTIFIER_HEAD(vmfork_chain); · 5 unmodified lines
10301027 * don't credit it, but we do immediately force a reseed after so
10311028 * that it's used by the crng posthaste.
10321029 */
1033−void add_vmfork_randomness(const void *unique_vm_id, size_t size)
1030+void add_vmfork_randomness(const void *unique_vm_id, size_t len)
10341031 {
1035− add_device_randomness(unique_vm_id, size);
1032+ add_device_randomness(unique_vm_id, len);
10361033 if (crng_ready()) {
10371034 crng_reseed();
10381035 pr_notice("crng reseeded due to virtual machine fork\n");
@@ -1252,8 +1249,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned int nu · 213 unmodified lines
12521249 credit_init_bits(bits);
12531250 }
12541251
1255−void add_input_randomness(unsigned int type, unsigned int code,
1256− unsigned int value)
1252+void add_input_randomness(unsigned int type, unsigned int code, unsigned int value)
12571253 {
12581254 static unsigned char last_value;
12591255 static struct timer_rand_state input_timer_state = { INITIAL_JIFFIES };
@@ -1388,8 +1384,7 @@ static void try_to_generate_entropy(void) · 128 unmodified lines
13881384 *
13891385 **********************************************************************/
13901386
1391−SYSCALL_DEFINE3(getrandom, char __user *, buf, size_t, count, unsigned int,
1392− flags)
1387+SYSCALL_DEFINE3(getrandom, char __user *, ubuf, size_t, len, unsigned int, flags)
13931388 {
13941389 if (flags & ~(GRND_NONBLOCK | GRND_RANDOM | GRND_INSECURE))
13951390 return -EINVAL;
@@ -1401,8 +1396,8 @@ SYSCALL_DEFINE3(getrandom, char __user *, buf, size_t, count, unsigned int, · 5 unmodified lines
14011396 if ((flags & (GRND_INSECURE | GRND_RANDOM)) == (GRND_INSECURE | GRND_RANDOM))
14021397 return -EINVAL;
14031398
1404− if (count > INT_MAX)
1405− count = INT_MAX;
1399+ if (len > INT_MAX)
1400+ len = INT_MAX;
14061401
14071402 if (!crng_ready() && !(flags & GRND_INSECURE)) {
14081403 int ret;
@@ -1413,7 +1408,7 @@ SYSCALL_DEFINE3(getrandom, char __user *, buf, size_t, count, unsigned int, · 4 unmodified lines
14131408 if (unlikely(ret))
14141409 return ret;
14151410 }
1416− return get_random_bytes_user(buf, count);
1411+ return get_random_bytes_user(ubuf, len);
14171412 }
14181413
14191414 static __poll_t random_poll(struct file *file, poll_table *wait)
@@ -1422,21 +1417,21 @@ static __poll_t random_poll(struct file *file, poll_table *wait) · 2 unmodified lines
14221417 return crng_ready() ? EPOLLIN | EPOLLRDNORM : EPOLLOUT | EPOLLWRNORM;
14231418 }
14241419
1425−static int write_pool(const char __user *ubuf, size_t count)
1420+static int write_pool(const char __user *ubuf, size_t len)
14261421 {
1427− size_t len;
1422+ size_t block_len;
14281423 int ret = 0;
14291424 u8 block[BLAKE2S_BLOCK_SIZE];
14301425
1431− while (count) {
1432− len = min(count, sizeof(block));
1433− if (copy_from_user(block, ubuf, len)) {
1426+ while (len) {
1427+ block_len = min(len, sizeof(block));
1428+ if (copy_from_user(block, ubuf, block_len)) {
14341429 ret = -EFAULT;
14351430 goto out;
14361431 }
1437− count -= len;
1438− ubuf += len;
1439− mix_pool_bytes(block, len);
1432+ len -= block_len;
1433+ ubuf += block_len;
1434+ mix_pool_bytes(block, block_len);
14401435 cond_resched();
14411436 }
14421437
@@ -1445,20 +1440,20 @@ out: · 2 unmodified lines
14451440 return ret;
14461441 }
14471442
1448−static ssize_t random_write(struct file *file, const char __user *buffer,
1449− size_t count, loff_t *ppos)
1443+static ssize_t random_write(struct file *file, const char __user *ubuf,
1444+ size_t len, loff_t *ppos)
14501445 {
14511446 int ret;
14521447
1453− ret = write_pool(buffer, count);
1448+ ret = write_pool(ubuf, len);
14541449 if (ret)
14551450 return ret;
14561451
1457− return (ssize_t)count;
1452+ return (ssize_t)len;
14581453 }
14591454
1460−static ssize_t urandom_read(struct file *file, char __user *buf, size_t nbytes,
1461− loff_t *ppos)
1455+static ssize_t urandom_read(struct file *file, char __user *ubuf,
1456+ size_t len, loff_t *ppos)
14621457 {
14631458 static int maxwarn = 10;
14641459
@@ -1475,22 +1470,22 @@ static ssize_t urandom_read(struct file *file, char __user *buf, size_t nbytes, · 10 unmodified lines
14751470 else if (ratelimit_disable || __ratelimit(&urandom_warning)) {
14761471 --maxwarn;
14771472 pr_notice("%s: uninitialized urandom read (%zd bytes read)\n",
1478− current->comm, nbytes);
1473+ current->comm, len);
14791474 }
14801475 }
14811476
1482− return get_random_bytes_user(buf, nbytes);
1477+ return get_random_bytes_user(ubuf, len);
14831478 }
14841479
1485−static ssize_t random_read(struct file *file, char __user *buf, size_t nbytes,
1486− loff_t *ppos)
1480+static ssize_t random_read(struct file *file, char __user *ubuf,
1481+ size_t len, loff_t *ppos)
14871482 {
14881483 int ret;
14891484
14901485 ret = wait_for_random_bytes();
14911486 if (ret != 0)
14921487 return ret;
1493− return get_random_bytes_user(buf, nbytes);
1488+ return get_random_bytes_user(ubuf, len);
14941489 }
14951490
14961491 static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
@@ -1615,7 +1610,7 @@ static u8 sysctl_bootid[UUID_SIZE]; · 118 unmodified lines
16151610 * UUID. The difference is in whether table->data is NULL; if it is,
16161611 * then a new UUID is generated and returned to the user.
16171612 */
1618−static int proc_do_uuid(struct ctl_table *table, int write, void *buffer,
1613+static int proc_do_uuid(struct ctl_table *table, int write, void *buf,
16191614 size_t *lenp, loff_t *ppos)
16201615 {
16211616 u8 tmp_uuid[UUID_SIZE], *uuid;
@@ -1642,14 +1637,14 @@ static int proc_do_uuid(struct ctl_table *table, int write, void *buffer, · 20 unmodified lines
16421637 }
16431638
16441639 snprintf(uuid_string, sizeof(uuid_string), "%pU", uuid);
1645− return proc_dostring(&fake_table, 0, buffer, lenp, ppos);
1640+ return proc_dostring(&fake_table, 0, buf, lenp, ppos);
16461641 }
16471642
16481643 /* The same as proc_dointvec, but writes don't change anything. */
1649−static int proc_do_rointvec(struct ctl_table *table, int write, void *buffer,
1644+static int proc_do_rointvec(struct ctl_table *table, int write, void *buf,
16501645 size_t *lenp, loff_t *ppos)
16511646 {
1652− return write ? 0 : proc_dointvec(table, 0, buffer, lenp, ppos);
1647+ return write ? 0 : proc_dointvec(table, 0, buf, lenp, ppos);
16531648 }
16541649
16551650 static struct ctl_table random_table[] = {
include/linux/random.h+6−6
@@ -12,12 +12,12 @@ · 11 unmodified lines
1212
1313 struct notifier_block;
1414
15−void add_device_randomness(const void *, size_t);
16−void add_bootloader_randomness(const void *, size_t);
15+void add_device_randomness(const void *buf, size_t len);
16+void add_bootloader_randomness(const void *buf, size_t len);
1717 void add_input_randomness(unsigned int type, unsigned int code,
1818 unsigned int value) __latent_entropy;
1919 void add_interrupt_randomness(int irq) __latent_entropy;
20−void add_hwgenerator_randomness(const void *buffer, size_t count, size_t entropy);
20+void add_hwgenerator_randomness(const void *buf, size_t len, size_t entropy);
2121
2222 #if defined(LATENT_ENTROPY_PLUGIN) && !defined(__CHECKER__)
2323 static inline void add_latent_entropy(void)
@@ -29,7 +29,7 @@ static inline void add_latent_entropy(void) { } · 5 unmodified lines
2929 #endif
3030
3131 #if IS_ENABLED(CONFIG_VMGENID)
32−void add_vmfork_randomness(const void *unique_vm_id, size_t size);
32+void add_vmfork_randomness(const void *unique_vm_id, size_t len);
3333 int register_random_vmfork_notifier(struct notifier_block *nb);
3434 int unregister_random_vmfork_notifier(struct notifier_block *nb);
3535 #else
@@ -37,8 +37,8 @@ static inline int register_random_vmfork_notifier(struct notifier_block *nb) { r · 1 unmodified line
3737 static inline int unregister_random_vmfork_notifier(struct notifier_block *nb) { return 0; }
3838 #endif
3939
40−void get_random_bytes(void *buf, size_t nbytes);
41−size_t __must_check get_random_bytes_arch(void *buf, size_t nbytes);
40+void get_random_bytes(void *buf, size_t len);
41+size_t __must_check get_random_bytes_arch(void *buf, size_t len);
4242 u32 get_random_u32(void);
4343 u64 get_random_u64(void);
4444 static inline unsigned int get_random_int(void)