new file mode 100644
@@ -0,0 +1,85 @@
+From e06931d982c4e681fe4dac9da94f34f09c95e137 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Costa?= <joaomarcos.costa@bootlin.com>
+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 <sanghyun.park.cnu@gmail.com>
+
+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) <joaomarcos.costa@bootlin.com>
+---
+ 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
+ }
+
@@ -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
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) <joaomarcos.costa@bootlin.com> --- .../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