* [meta-oe][blacksail][PATCH] jq: backport CVE-2026-40164 entropy follow-up
@ 2026-11-24 9:40 Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco)
0 siblings, 0 replies; only message in thread
From: Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco) @ 2026-11-24 9:40 UTC (permalink / raw)
To: openembedded-devel
From: Devansh Patel <devanshp@cisco.com>
Backport the upstream follow-up to the CVE-2026-40164 hash seed fix.
Prefer getentropy() and try /dev/urandom if getentropy() fails.
Remove the redundant fixed-version entry so the patch CVE tag
reports the fix without a duplicate status warning.
https://github.com/jqlang/jq/commit/32580f5d83f4321588a1ebf8e3893f7fbecefe4e
Signed-off-by: Devansh Patel <devanshp@cisco.com>
---
.../jq/jq/CVE-2026-40164-follow-up.patch | 61 +++++++++++++++++++
meta-oe/recipes-devtools/jq/jq_1.8.2.bb | 3 +-
2 files changed, 63 insertions(+), 1 deletion(-)
create mode 100644 meta-oe/recipes-devtools/jq/jq/CVE-2026-40164-follow-up.patch
diff --git a/meta-oe/recipes-devtools/jq/jq/CVE-2026-40164-follow-up.patch b/meta-oe/recipes-devtools/jq/jq/CVE-2026-40164-follow-up.patch
new file mode 100644
index 0000000000000000000000000000000000000000..47ba4ddb1cfeadeb11137d76fddbec2c411becde
--- /dev/null
+++ b/meta-oe/recipes-devtools/jq/jq/CVE-2026-40164-follow-up.patch
@@ -0,0 +1,61 @@
+From fc85f740b3a926a385683a7ca08b4898858f7940 Mon Sep 17 00:00:00 2001
+From: Brandon <breakouttradersc@gmail.com>
+Date: Fri, 25 Sep 2026 03:39:06 -0400
+Subject: [PATCH] Prefer getentropy() over arc4random() to seed the string hash
+ (#3629)
+
+glibc's arc4random() aborts with "Fatal glibc error: cannot get entropy
+for arc4random" when the kernel lacks getrandom(2), so jq died on
+startup on older kernels once 0c7d133 began seeding the hash on every
+run. getentropy() merely returns -1/ENOSYS there, so prefer it, and
+route its failure through the existing `/dev/urandom` path - which works
+on precisely those kernels -- instead of a guessable `getpid() ^ time()`.
+
+CVE: CVE-2026-40164
+Upstream-Status: Backport [https://github.com/jqlang/jq/commit/32580f5d83f4321588a1ebf8e3893f7fbecefe4e]
+
+Signed-off-by: Devansh Patel <devanshp@cisco.com>
+---
+ src/jv.c | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/src/jv.c b/src/jv.c
+index 48a63e6e55cacc3b3ad316586469605c6978a805..76d2bf82fb62f9436dc134d86fae2ee26168ba58 100644
+--- a/src/jv.c
++++ b/src/jv.c
+@@ -1210,12 +1210,18 @@ static pthread_once_t hash_seed_once = PTHREAD_ONCE_INIT;
+
+ static void jvp_hash_seed_init(void) {
+ uint32_t seed;
+-#if defined(HAVE_ARC4RANDOM)
+- seed = arc4random();
+-#elif defined(HAVE_GETENTROPY)
+- if (getentropy(&seed, sizeof(seed)) != 0)
+- seed = (uint32_t)getpid() ^ (uint32_t)time(NULL);
+-#else
++ /* Prefer getentropy() over arc4random(): glibc's arc4random() aborts the
++ * process when the kernel lacks getrandom(2) (#3584), while getentropy()
++ * merely fails, letting us fall back to /dev/urandom. */
++#if defined(HAVE_GETENTROPY)
++ if (getentropy(&seed, sizeof(seed)) == 0) {
++ hash_seed = seed;
++ return;
++ }
++#elif defined(HAVE_ARC4RANDOM)
++ hash_seed = arc4random();
++ return;
++#endif
+ int fd = open("/dev/urandom", O_RDONLY);
+ if (fd >= 0) {
+ if (read(fd, &seed, sizeof(seed)) != 4)
+@@ -1224,7 +1230,6 @@ static void jvp_hash_seed_init(void) {
+ } else {
+ seed = (uint32_t)getpid() ^ (uint32_t)time(NULL);
+ }
+-#endif
+ hash_seed = seed;
+ }
+
+--
+2.35.6
+
diff --git a/meta-oe/recipes-devtools/jq/jq_1.8.2.bb b/meta-oe/recipes-devtools/jq/jq_1.8.2.bb
index 9f586eb18d32419f6f71a7e80d63545d1aa8bb9f..1c2e73eed5403720e26f24045f9437cb21daa280 100644
--- a/meta-oe/recipes-devtools/jq/jq_1.8.2.bb
+++ b/meta-oe/recipes-devtools/jq/jq_1.8.2.bb
@@ -12,6 +12,7 @@ SRCREV = "34f7186b86743a083a589741b6cea95293524108"
SRC_URI = "git://github.com/jqlang/jq.git;protocol=https;branch=master;tag=jq-${PV} \
file://run-ptest \
+ file://CVE-2026-40164-follow-up.patch \
"
CVE_PRODUCT = "jq_project:jq jqlang:jq"
@@ -51,4 +52,4 @@ BBCLASSEXTEND = "native"
CVE_STATUS_GROUPS += "CVE_STATUS_FIXED_ALREADY"
CVE_STATUS_FIXED_ALREADY[status] = "fixed-version: The issue is fixed in v1.8.2"
-CVE_STATUS_FIXED_ALREADY = "CVE-2026-33948 CVE-2026-39979 CVE-2026-40164 CVE-2026-44777"
+CVE_STATUS_FIXED_ALREADY = "CVE-2026-33948 CVE-2026-39979 CVE-2026-44777"
--
2.35.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-24 9:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-24 9:40 [meta-oe][blacksail][PATCH] jq: backport CVE-2026-40164 entropy follow-up Devansh Patel -X (devanshp - E INFOCHIPS PRIVATE LIMITED at Cisco)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.