summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOla x Nilsson <olani@axis.com>2024-10-14 16:38:18 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-10-15 11:47:24 +0100
commit01d0ef0bcc822cace4364e5e68e984ba794ce743 (patch)
treeeae9692e16f2acc2e9bdc1cc30cd339d299b957a
parentacd8c9528f825e05eac570ba69b360b222dea45d (diff)
downloadpoky-01d0ef0bcc822cace4364e5e68e984ba794ce743.tar.gz
glibc: Fix missing randomness in __gen_tempname
Backport the fix for glibc bug 32214. The missing randomness in early boot may cause some systemd services to fail when they occasionally try to create tempdirs like /run/systemd/namespace-aaaaaa at the same time. The error messages can contain things like "Failed to set up mount namespacing". (From OE-Core rev: 0bb6aa06db5bf2e89d1c499e84a0a8cedbd8f0a7) Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/glibc/glibc/0024-Fix-missing-randomness-in-__gen_tempname-bug-32214.patch29
-rw-r--r--meta/recipes-core/glibc/glibc_2.40.bb1
2 files changed, 30 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc/0024-Fix-missing-randomness-in-__gen_tempname-bug-32214.patch b/meta/recipes-core/glibc/glibc/0024-Fix-missing-randomness-in-__gen_tempname-bug-32214.patch
new file mode 100644
index 0000000000..c9f3e32f58
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0024-Fix-missing-randomness-in-__gen_tempname-bug-32214.patch
@@ -0,0 +1,29 @@
1From 9d30d58c32fe9d5f8ec6cda79fb11159e6789bcf Mon Sep 17 00:00:00 2001
2From: Andreas Schwab <schwab@suse.de>
3Date: Wed, 25 Sep 2024 11:49:30 +0200
4Subject: [PATCH] Fix missing randomness in __gen_tempname (bug 32214)
5
6Make sure to update the random value also if getrandom fails.
7
8Fixes: 686d542025 ("posix: Sync tempname with gnulib")
9
10Upstream-Status: Backport [https://sourceware.org/git/?p=glibc.git;a=commit;h=5f62cf88c4530c11904482775b7582bd7f6d80d2]
11
12Signed-off-by: Ola x Nilsson <olani@axis.com>
13---
14 sysdeps/posix/tempname.c | 2 ++
15 1 file changed, 2 insertions(+)
16
17diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c
18index c00fe0c181..fc30958a0c 100644
19--- a/sysdeps/posix/tempname.c
20+++ b/sysdeps/posix/tempname.c
21@@ -117,6 +117,8 @@ random_bits (random_value *r, random_value s)
22 succeed. */
23 #if !_LIBC
24 *r = mix_random_values (v, clock ());
25+#else
26+ *r = v;
27 #endif
28 return false;
29 }
diff --git a/meta/recipes-core/glibc/glibc_2.40.bb b/meta/recipes-core/glibc/glibc_2.40.bb
index 71b89ac9ff..3e855b19d8 100644
--- a/meta/recipes-core/glibc/glibc_2.40.bb
+++ b/meta/recipes-core/glibc/glibc_2.40.bb
@@ -53,6 +53,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
53 file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \ 53 file://0021-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \
54 file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \ 54 file://0022-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \
55 file://0023-tests-Skip-2-qemu-tests-that-can-hang-in-oe-selftest.patch \ 55 file://0023-tests-Skip-2-qemu-tests-that-can-hang-in-oe-selftest.patch \
56 file://0024-Fix-missing-randomness-in-__gen_tempname-bug-32214.patch \
56" 57"
57S = "${WORKDIR}/git" 58S = "${WORKDIR}/git"
58B = "${WORKDIR}/build-${TARGET_SYS}" 59B = "${WORKDIR}/build-${TARGET_SYS}"