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
This commit is contained in:
@@ -320,7 +320,7 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
|
||||
else
|
||||
executable_stack = EXSTACK_DEFAULT;
|
||||
|
||||
if (stack_size == 0) {
|
||||
if (stack_size == 0 && interp_params.flags & ELF_FDPIC_FLAG_PRESENT) {
|
||||
stack_size = interp_params.stack_size;
|
||||
if (interp_params.flags & ELF_FDPIC_FLAG_EXEC_STACK)
|
||||
executable_stack = EXSTACK_ENABLE_X;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -393,7 +393,7 @@ static int run_tests(void)
|
||||
static void prerequisites(void)
|
||||
{
|
||||
int fd;
|
||||
const char *script = "#!/bin/sh\nexit $*\n";
|
||||
const char *script = "#!/bin/bash\nexit $*\n";
|
||||
|
||||
/* Create ephemeral copies of files */
|
||||
exe_cp("execveat", "execveat.ephemeral");
|
||||
|
||||
Reference in New Issue
Block a user