diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-03-12 14:45:12 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-03-12 14:45:12 -0700 |
commit | b32273ee89a866b01b316b9a8de407efde01090c (patch) | |
tree | 61c1bff2de438cc4a644ea34a7531807fc4b0cd6 /fs/exec.c | |
parent | 41cb8c332bb904cd2108250075d195e060e1fdc7 (diff) | |
parent | 725d50261285ccf02501f2a1a6d10b31ce014597 (diff) |
Merge tag 'execve-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull execve updates from Kees Cook:
- Drop needless error path code in remove_arg_zero() (Li kunyu, Kees
Cook)
- binfmt_elf_efpic: Don't use missing interpreter's properties (Max
Filippov)
- Use /bin/bash for execveat selftests
* tag 'execve-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
exec: Simplify remove_arg_zero() error path
selftests/exec: Perform script checks with /bin/bash
exec: Delete unnecessary statements in remove_arg_zero()
fs: binfmt_elf_efpic: don't use missing interpreter's properties
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/exec.c b/fs/exec.c index ece3ab0998e1..ff6f26671cfc 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1719,7 +1719,6 @@ static int prepare_binprm(struct linux_binprm *bprm) */ int remove_arg_zero(struct linux_binprm *bprm) { - int ret = 0; unsigned long offset; char *kaddr; struct page *page; @@ -1730,10 +1729,8 @@ int remove_arg_zero(struct linux_binprm *bprm) do { offset = bprm->p & ~PAGE_MASK; page = get_arg_page(bprm, bprm->p, 0); - if (!page) { - ret = -EFAULT; - goto out; - } + if (!page) + return -EFAULT; kaddr = kmap_local_page(page); for (; offset < PAGE_SIZE && kaddr[offset]; @@ -1746,10 +1743,8 @@ int remove_arg_zero(struct linux_binprm *bprm) bprm->p++; bprm->argc--; - ret = 0; -out: - return ret; + return 0; } EXPORT_SYMBOL(remove_arg_zero); |