2021-03-26 14:40:54

by Christoph Hellwig

[permalink] [raw]
Subject: [PATCH 2/4] exec: remove compat_do_execve

Just call compat_do_execve instead.

Signed-off-by: Christoph Hellwig <[email protected]>
---
fs/exec.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index b63fb020909075..06e07278b456fa 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1990,21 +1990,6 @@ static int do_execveat(int fd, struct filename *filename,
}

#ifdef CONFIG_COMPAT
-static int compat_do_execve(struct filename *filename,
- const compat_uptr_t __user *__argv,
- const compat_uptr_t __user *__envp)
-{
- struct user_arg_ptr argv = {
- .is_compat = true,
- .ptr.compat = __argv,
- };
- struct user_arg_ptr envp = {
- .is_compat = true,
- .ptr.compat = __envp,
- };
- return do_execveat_common(AT_FDCWD, filename, argv, envp, 0);
-}
-
static int compat_do_execveat(int fd, struct filename *filename,
const compat_uptr_t __user *__argv,
const compat_uptr_t __user *__envp,
@@ -2072,7 +2057,7 @@ COMPAT_SYSCALL_DEFINE3(execve, const char __user *, filename,
const compat_uptr_t __user *, argv,
const compat_uptr_t __user *, envp)
{
- return compat_do_execve(getname(filename), argv, envp);
+ return compat_do_execveat(AT_FDCWD, getname(filename), argv, envp, 0);
}

COMPAT_SYSCALL_DEFINE5(execveat, int, fd,
--
2.30.1


2021-03-26 15:44:19

by Andreas Schwab

[permalink] [raw]
Subject: Re: [PATCH 2/4] exec: remove compat_do_execve

On Mär 26 2021, Christoph Hellwig wrote:

> Just call compat_do_execve instead.

ITYM compat_do_execveat here.

Andreas.

--
Andreas Schwab, [email protected]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."

2021-03-27 19:58:38

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH 2/4] exec: remove compat_do_execve

On 3/26/21 5:38 PM, Christoph Hellwig wrote:

> Just call compat_do_execve instead.

compat_do_execveat(), maybe?

> Signed-off-by: Christoph Hellwig <[email protected]>
> ---
> fs/exec.c | 17 +----------------
> 1 file changed, 1 insertion(+), 16 deletions(-)
>
> diff --git a/fs/exec.c b/fs/exec.c
> index b63fb020909075..06e07278b456fa 100644
> --- a/fs/exec.c
> +++ b/fs/exec.c
[...]
> @@ -2072,7 +2057,7 @@ COMPAT_SYSCALL_DEFINE3(execve, const char __user *, filename,
> const compat_uptr_t __user *, argv,
> const compat_uptr_t __user *, envp)
> {
> - return compat_do_execve(getname(filename), argv, envp);
> + return compat_do_execveat(AT_FDCWD, getname(filename), argv, envp, 0);
> }
>
> COMPAT_SYSCALL_DEFINE5(execveat, int, fd,

MBR, Sergei