summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-04-16 16:42:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-04-16 16:42:53 -0700
commit92edbe32e3822f7b66e471c7e0bd5ee5d63bf4b8 (patch)
tree6e86bb46c91c6437f3938a12aab0842c6e4b79e0 /include
parent90ea17a9e27b5778ec517efb1ce0b81d36905654 (diff)
parent35a33ff3807d3adb9daaf937f5bca002ffa9f84e (diff)
downloadlinux-92edbe32e3822f7b66e471c7e0bd5ee5d63bf4b8.tar.bz2
Merge tag 'random-5.18-rc3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random
Pull random number generator fixes from Jason Donenfeld: - Per your suggestion, random reads now won't fail if there's a page fault after some non-zero amount of data has been read, which makes the behavior consistent with all other reads in the kernel. - Rather than an inconsistent mix of random_get_entropy() returning an unsigned long or a cycles_t, now it just returns an unsigned long. - A memcpy() was replaced with an memmove(), because the addresses are sometimes overlapping. In practice the destination is always before the source, so not really an issue, but better to be correct than not. * tag 'random-5.18-rc3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: use memmove instead of memcpy for remaining 32 bytes random: make random_get_entropy() return an unsigned long random: allow partial reads if later user copies fail
Diffstat (limited to 'include')
-rw-r--r--include/linux/timex.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 059b18eb1f1f..5745c90c8800 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -75,7 +75,7 @@
* By default we use get_cycles() for this purpose, but individual
* architectures may override this in their asm/timex.h header file.
*/
-#define random_get_entropy() get_cycles()
+#define random_get_entropy() ((unsigned long)get_cycles())
#endif
/*