From: Xichao Zhao Date: Mon, 25 Aug 2025 07:36:09 +0000 (+0800) Subject: exec: Fix incorrect type for ret X-Git-Tag: v6.1.158~92 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=df4d7faa8ba25e43423d25d4c0750e85cd905c6e;p=thirdparty%2Fkernel%2Fstable.git exec: Fix incorrect type for ret [ Upstream commit 5e088248375d171b80c643051e77ade6b97bc386 ] In the setup_arg_pages(), ret is declared as an unsigned long. The ret might take a negative value. Therefore, its type should be changed to int. Signed-off-by: Xichao Zhao Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20250825073609.219855-1-zhao.xichao@vivo.com Signed-off-by: Kees Cook Signed-off-by: Sasha Levin --- diff --git a/fs/exec.c b/fs/exec.c index b65af8f9a4f9..a4d21a67723d 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -750,7 +750,7 @@ int setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, int executable_stack) { - unsigned long ret; + int ret; unsigned long stack_shift; struct mm_struct *mm = current->mm; struct vm_area_struct *vma = bprm->vma;