From patchwork Tue Dec 1 15:56:56 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: 106835 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.14822.1796141351114198215 for ; Tue, 01 Dec 2026 08:09:11 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bootlin.com header.s=dkim header.b=TV6hAZqh; spf=pass (domain: bootlin.com, ip: 185.246.85.4, mailfrom: joaomarcos.costa@bootlin.com) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 4A9964E417A5; Tue, 1 Dec 2026 16:09:09 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 21945603CB; Tue, 1 Dec 2026 16:09:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C153611EA26FD; Tue, 01 Dec 2026 17:09:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796141344; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=TgSjbwJG5XR2p5IWT3NOW1zeijScGUyKOhKxOEy2uCM=; b=TV6hAZqhWtULRg2wetx1hCUzPR47RJTyO+WLBtvTsJF2wUG1w20w/gf/MPtY2i/4bU1DVw GZRLCK2sbep9iJQzUmXWGJ7z2NISiHIVDAc+sqtmMVsuO3SKNt8hKYXfLJbUu7YiKtx2gO cE5yO7hLAd8uK9reyZU1SJgAK0q1e2daCj+5Qg+mcjYup9Z6MqFhjPJno8Nqm3tPmDRMXs NMKyeF3fmTtlWavC54/dbVHktXR2AiTCB3O/25U0Ox2MuVL0IqMzEiPiDlGFpV5JguQDzG WcFICEm2zyA4q8P+7C9I0t93trwgNW9yWsrt2ZIV70bxMSFtkOgGk4/8t76yjA== 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 3/3] busybox: fix CVE-2026-38753 Date: Tue, 1 Dec 2026 16:56:56 +0100 Message-ID: <20261201155656.839273-4-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:12 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251752 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/092354.html [2] https://nvd.nist.gov/vuln/detail/cve-2026-38755 Signed-off-by: João Marcos Costa (Schneider Electric) --- .../busybox/busybox/CVE-2026-38755.patch | 72 +++++++++++++++++++ meta/recipes-core/busybox/busybox_1.36.1.bb | 1 + 2 files changed, 73 insertions(+) create mode 100644 meta/recipes-core/busybox/busybox/CVE-2026-38755.patch diff --git a/meta/recipes-core/busybox/busybox/CVE-2026-38755.patch b/meta/recipes-core/busybox/busybox/CVE-2026-38755.patch new file mode 100644 index 0000000000..95a6303591 --- /dev/null +++ b/meta/recipes-core/busybox/busybox/CVE-2026-38755.patch @@ -0,0 +1,72 @@ +From cb2e18a92ca873780bf9a31f2070c4a4c8aa0f0a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Costa?= +Date: Tue, 1 Dec 2026 16:20:37 +0100 +Subject: [PATCH] ash: fix stack overflow in evalfun() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Recursive shell functions can repeatedly enter evalfun() until the +process stack is exhausted. Track active shell function calls and raise a +normal shell error when the recursion limit is reached. + +The counter is decremented through the existing funcdone cleanup path so +errors raised from inside the function body unwind it correctly. + +Signed-off-by: Sanghyun Park + +CVE: CVE-2026-38755 +Upstream-Status: Pending [https://lists.busybox.net/pipermail/busybox/2026-June/092354.html] + +Signed-off-by: João Marcos Costa (Schneider Electric) +--- + shell/ash.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/shell/ash.c b/shell/ash.c +index e77c8d19a..917798f0f 100644 +--- a/shell/ash.c ++++ b/shell/ash.c +@@ -402,6 +402,7 @@ struct globals_misc { + int shlvl; + #define rootshell (!shlvl) + int errlinno; ++ unsigned func_depth; + + char *minusc; /* argument to -c option */ + +@@ -489,6 +490,7 @@ extern struct globals_misc *BB_GLOBAL_CONST ash_ptr_to_globals_misc; + #define rootpid (G_misc.rootpid ) + #define shlvl (G_misc.shlvl ) + #define errlinno (G_misc.errlinno ) ++#define func_depth (G_misc.func_depth ) + #define minusc (G_misc.minusc ) + #define curdir (G_misc.curdir ) + #define physdir (G_misc.physdir ) +@@ -9918,6 +9920,10 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) + int savefuncline; + char *savefuncname; + char *savetrap = NULL; ++ enum { MAX_ASH_FUNC_DEPTH = 1000 }; ++ ++ if (func_depth >= MAX_ASH_FUNC_DEPTH) ++ ash_msg_and_raise_error("function recursion limit exceeded"); + + if (!Eflag) { + savetrap = trap[NTRAP_ERR]; +@@ -9936,6 +9942,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) + exception_handler = &jmploc; + shellparam.malloced = 0; + func->count++; ++ func_depth++; + funcname = func->n.ndefun.text; + funcline = func->n.ndefun.linno; + INT_ON; +@@ -9957,6 +9964,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) + } + funcline = savefuncline; + lineno = savelineno; ++ func_depth--; + freefunc(func); + freeparam(&shellparam); + shellparam = saveparam; diff --git a/meta/recipes-core/busybox/busybox_1.36.1.bb b/meta/recipes-core/busybox/busybox_1.36.1.bb index 68dea62557..606fe23375 100644 --- a/meta/recipes-core/busybox/busybox_1.36.1.bb +++ b/meta/recipes-core/busybox/busybox_1.36.1.bb @@ -70,6 +70,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \ file://CVE-2024-58251.patch \ file://CVE-2026-38752.patch \ file://CVE-2026-38753.patch \ + file://CVE-2026-38755.patch \ " SRC_URI:append:libc-musl = " file://musl.cfg " # TODO http://lists.busybox.net/pipermail/busybox/2023-January/090078.html