From e9cefe81b07f803ca87ae0f06123bca9c9528fbf Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 25 Mar 2026 11:37:21 +0000 Subject: libreboot-utils: usleep 100 on rand failure it's extremely unlikely that a 2nd call would also fail. this is fine. it mitigates DoS attacks (entropy exhaustion) Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/rand.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c index 0b156e51..9c1fa4e3 100644 --- a/util/libreboot-utils/lib/rand.c +++ b/util/libreboot-utils/lib/rand.c @@ -79,8 +79,10 @@ retry_rand: (char *)&rval + off, len - off, 0); if (rc < 0) { - if (errno == EINTR || errno == EAGAIN) + if (errno == EINTR || errno == EAGAIN) { + usleep(100); goto retry_rand; + } goto err; /* possibly unsupported by kernel */ } -- cgit v1.2.1