]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
exec: Fix incorrect type for ret
authorXichao Zhao <zhao.xichao@vivo.com>
Mon, 25 Aug 2025 07:36:09 +0000 (15:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:03:09 +0000 (14:03 +0100)
[ 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 <zhao.xichao@vivo.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20250825073609.219855-1-zhao.xichao@vivo.com
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/exec.c

index 8395e7ff7b9403d1671cd5e3aa68b93a060a62dc..4d5defc2966bd42e3c1bd7559d76bf1e3095807a 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -746,7 +746,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;