new file mode 100644
@@ -0,0 +1,70 @@
+From 0efa89307bb63c456d25adfb352c3dcc48d8760b Mon Sep 17 00:00:00 2001
+From: Sanghyun Park <sanghyun.park.cnu@gmail.com>
+Date: Tue, 16 Jun 2026 12:19:27 +0900
+Subject: [PATCH] ash: fix stack overflow in evalfun()
+
+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.
+
+CVE: CVE-2026-38755
+Upstream-Status: Submitted [https://lists.busybox.net/pipermail/busybox/2026-June/092354.html]
+
+Signed-off-by: Sanghyun Park <sanghyun.park.cnu@gmail.com>
+Signed-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
+---
+ shell/ash.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/shell/ash.c b/shell/ash.c
+index bbd7307..a66d3cc 100644
+--- a/shell/ash.c
++++ b/shell/ash.c
+@@ -414,6 +414,7 @@ struct globals_misc {
+ int shlvl;
+ #define rootshell (!shlvl)
+ int errlinno;
++ unsigned func_depth;
+
+ char *minusc; /* argument to -c option */
+
+@@ -506,6 +507,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 )
+@@ -9920,6 +9922,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];
+@@ -9938,6 +9944,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;
+@@ -9959,6 +9966,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags)
+ }
+ funcline = savefuncline;
+ lineno = savelineno;
++ func_depth--;
+ freefunc(func);
+ freeparam(&shellparam);
+ shellparam = saveparam;
+--
+2.35.6
@@ -69,6 +69,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
file://CVE-2026-38752.patch \
file://CVE-2026-38753.patch \
file://CVE-2026-38754.patch \
+ file://CVE-2026-38755.patch \
"
SRC_URI:append:libc-musl = " file://musl.cfg"
SRC_URI:append:x86-64 = " file://sha_accel.cfg"