summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/seedrng.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/util-linux/seedrng.c b/util-linux/seedrng.c
index 2965f3d..04e52a9 100644
--- a/util-linux/seedrng.c
+++ b/util-linux/seedrng.c
@@ -56,7 +56,11 @@
enum {
MIN_SEED_LEN = SHA256_OUTSIZE,
- MAX_SEED_LEN = 512
+ /* kernels < 5.18 could return short reads from getrandom()
+ * if signal is pending and length is > 256.
+ * Let's limit our reads to 256 bytes.
+ */
+ MAX_SEED_LEN = 256,
};
static size_t determine_optimal_seed_len(void)