From patchwork Tue Dec 1 15:56:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jo=C3=A3o_Marcos_Costa_=28Schneider_Electric=29?= X-Patchwork-Id: 106833 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.14370.1796141339078836458 for ; Tue, 01 Dec 2026 08:08:59 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=vKjYCJpF; spf=pass (domain: bootlin.com, ip: 185.246.84.56, mailfrom: joaomarcos.costa@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 3BF8A1A18AF for ; Tue, 1 Dec 2026 16:08:57 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 0B344603CB; Tue, 1 Dec 2026 16:08:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 2459311EA26FD; Tue, 01 Dec 2026 17:08:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796141332; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=0a6SfH5XPvo3Um/GIXNU4flK3VVrtOVrdUmDqeBBoZs=; b=vKjYCJpFUwZTMzcj5++hlZJAUN7un2BTC64Lyjbi8I7BNiYN7758H+W4vOSuzsby2bu5JL mDg5Msw9fY6T9DkaAGTO8zsLhGq9BQ5iDXJ01VqfaAA7TAEoYCKquwau0AUEtD/EIS//BT zH0V3ipqPvT2Mp9JqGmAKlD/xTQnpcWyF4W1zFL6s89ZbMnpXTFStoFuPXOdE2QiNaJdcy XlBWk0K0xkqCkSZuiuD8VdroTGyFzOysG5QuGoL7+BcQV83OLEUjHMGQx3CLTdUNxmvVpH 2t1FWzjmB9Q6N1k0rzLruHCsuZve0ylzbWp5j8+qAxiRLYJoTuryklO/LYaeuA== From: =?utf-8?q?Jo=C3=A3o_Marcos_Costa_=28Schneider_Electric=29?= To: openembedded-core@lists.openembedded.org Cc: thomas.petazzoni@bootlin.com, yoann.congal@smile.fr, =?utf-8?q?Jo=C3=A3o?= =?utf-8?q?_Marcos_Costa_=28Schneider_Electric=29?= Subject: [scarthgap][PATCH 1/3] busybox: fix CVE-2026-38752 Date: Tue, 1 Dec 2026 16:56:54 +0100 Message-ID: <20261201155656.839273-2-joaomarcos.costa@bootlin.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261201155656.839273-1-joaomarcos.costa@bootlin.com> References: <20261201155656.839273-1-joaomarcos.costa@bootlin.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 01 Dec 2026 16:09:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251750 A patch [1] to fix this vulnerability, marked as High [2], was submitted to Busybox's mailing list, but not yet merged. Backport the fix to busybox 1.36.1, and mark it as 'Pending'. [1] https://lists.busybox.net/pipermail/busybox/2026-June/092351.html [2] https://nvd.nist.gov/vuln/detail/cve-2026-38752 Signed-off-by: João Marcos Costa (Schneider Electric) --- .../busybox/busybox/CVE-2026-38752.patch | 85 +++++++++++++++++++ meta/recipes-core/busybox/busybox_1.36.1.bb | 1 + 2 files changed, 86 insertions(+) create mode 100644 meta/recipes-core/busybox/busybox/CVE-2026-38752.patch diff --git a/meta/recipes-core/busybox/busybox/CVE-2026-38752.patch b/meta/recipes-core/busybox/busybox/CVE-2026-38752.patch new file mode 100644 index 0000000000..618c80e75a --- /dev/null +++ b/meta/recipes-core/busybox/busybox/CVE-2026-38752.patch @@ -0,0 +1,85 @@ +From e06931d982c4e681fe4dac9da94f34f09c95e137 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Costa?= +Date: Tue, 1 Dec 2026 16:00:24 +0100 +Subject: [PATCH] awk: fix stack overflow in evaluate() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Recursive awk functions can keep re-entering evaluate() until the +process stack is exhausted. Track active function-call depth and report a +normal awk error once the limit is reached instead of overflowing the +stack. + +Signed-off-by: Sanghyun Park + +CVE: CVE-2026-38752 +Upstream-Status: Pending [https://lists.busybox.net/pipermail/busybox/2026-June/092351.html] + +Signed-off-by: João Marcos Costa (Schneider Electric) +--- + editors/awk.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/editors/awk.c b/editors/awk.c +index a53b1933f..137e9d194 100644 +--- a/editors/awk.c ++++ b/editors/awk.c +@@ -591,6 +591,7 @@ struct globals2 { + smalluint exitcode; + + unsigned evaluate__seed; ++ unsigned evaluate__func_depth; + var *evaluate__fnargs; + regex_t evaluate__sreg; + +@@ -661,6 +662,7 @@ static const char EMSG_UNEXP_TOKEN[] ALIGN1 = "Unexpected token"; + static const char EMSG_DIV_BY_ZERO[] ALIGN1 = "Division by zero"; + static const char EMSG_INV_FMT[] ALIGN1 = "Invalid format specifier"; + static const char EMSG_TOO_FEW_ARGS[] ALIGN1 = "Too few arguments"; ++static const char EMSG_RECURSION[] ALIGN1 = "Recursion limit exceeded"; + static const char EMSG_NOT_ARRAY[] ALIGN1 = "Not an array"; + static const char EMSG_POSSIBLE_ERROR[] ALIGN1 = "Possible syntax error"; + static const char EMSG_UNDEF_FUNC[] ALIGN1 = "Call to undefined function"; +@@ -2899,6 +2901,7 @@ static var *evaluate(node *op, var *res) + #define fnargs (G.evaluate__fnargs) + /* seed is initialized to 1 */ + #define seed (G.evaluate__seed) ++#define func_depth (G.evaluate__func_depth) + #define sreg (G.evaluate__sreg) + + var *tmpvars; +@@ -3211,13 +3214,17 @@ static var *evaluate(node *op, var *res) + var *argvars, *sv_fnargs; + const char *sv_progname; + int nargs, i; ++ enum { MAX_AWK_FUNC_DEPTH = 1000 }; + + debug_printf_eval("FUNC\n"); + + if (!op->r.f->defined) + syntax_error(EMSG_UNDEF_FUNC); ++ if (func_depth >= MAX_AWK_FUNC_DEPTH) ++ syntax_error(EMSG_RECURSION); + + /* The body might be empty, still has to eval the args */ ++ func_depth++; + nargs = op->r.f->nargs; + argvars = nvalloc(nargs); + i = 0; +@@ -3245,6 +3252,7 @@ static var *evaluate(node *op, var *res) + + g_progname = sv_progname; + fnargs = sv_fnargs; ++ func_depth--; + + break; + } +@@ -3600,6 +3608,7 @@ static var *evaluate(node *op, var *res) + return res; + #undef fnargs + #undef seed ++#undef func_depth + #undef sreg + } + diff --git a/meta/recipes-core/busybox/busybox_1.36.1.bb b/meta/recipes-core/busybox/busybox_1.36.1.bb index 70d984b7c6..629fe758f6 100644 --- a/meta/recipes-core/busybox/busybox_1.36.1.bb +++ b/meta/recipes-core/busybox/busybox_1.36.1.bb @@ -68,6 +68,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://CVE-2026-29004-02.patch \ file://CVE-2026-38754.patch \ file://CVE-2024-58251.patch \ + file://CVE-2026-38752.patch \ " SRC_URI:append:libc-musl = " file://musl.cfg " # TODO http://lists.busybox.net/pipermail/busybox/2023-January/090078.html