Skip to contentSkip to conversation

exec-force-single-empty-string-when-argv-is-empty-fix.patch removed from -mm tree

merged Andrew Morton 1 participant 1 message Feb 28, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The patch titled
Subject: exec: Fix min/max typo in stack space calculation
has been removed from the -mm tree. Its filename was
exec-force-single-empty-string-when-argv-is-empty-fix.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Kees Cook <[email protected]>
Subject: exec: Fix min/max typo in stack space calculation

When handling the argc == 0 case, the stack space calculation should be using max() not min().

Cc Michael Kerrisk <[email protected]>
Cc Ariadne Conill <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Rich Felker <[email protected]>
Cc Eric Biederman <[email protected]>
Cc Alexander Viro <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Yang Yingliang <[email protected]>

---

 fs/exec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/exec.c renamed from fs/exec.c~exec-force-single-empty-string-when-argv-is-empty-fix +1 -1
@@ -502,7 +502,7 @@ static int bprm_stack_limits(struct linu
 	 * argc can never be 0, to keep them from walking envp by accident.
 	 * See do_execveat_common().
 	 */
-	ptr_size = (min(bprm->argc, 1) + bprm->envc) * sizeof(void *);
+	ptr_size = (max(bprm->argc, 1) + bprm->envc) * sizeof(void *);
 	if (limit <= ptr_size)
 		return -E2BIG;
 	limit -= ptr_size;

_

Patches currently in -mm which might be from [email protected] are

kconfigdebug-make-debug_info-selectable-from-a-choice.patch kconfigdebug-make-debug_info-selectable-from-a-choice-fix.patch selftests-kselftest-framework-provide-finished-helper.patch