Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove parameter 'segflg' from the function *exec_copyin_args #1590

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions sys/compat/freebsd32/freebsd32_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ freebsd32_sigaltstack(struct thread *td,
*/
int
freebsd32_exec_copyin_args(struct image_args *args, const char *fname,
enum uio_seg segflg, uint32_t *argv, uint32_t *envv)
uint32_t *argv, uint32_t *envv)
{
char *argp, *envp;
uint32_t *p32, arg;
Expand All @@ -422,7 +422,7 @@ freebsd32_exec_copyin_args(struct image_args *args, const char *fname,
/*
* Copy the file name.
*/
error = exec_args_add_fname(args, fname, segflg);
error = exec_args_add_fname(args, fname, UIO_USERSPACE);
if (error != 0)
goto err_exit;

Expand Down Expand Up @@ -477,8 +477,8 @@ freebsd32_execve(struct thread *td, struct freebsd32_execve_args *uap)
error = pre_execve(td, &oldvmspace);
if (error != 0)
return (error);
error = freebsd32_exec_copyin_args(&eargs, uap->fname, UIO_USERSPACE,
uap->argv, uap->envv);
error = freebsd32_exec_copyin_args(&eargs, uap->fname, uap->argv,
uap->envv);
if (error == 0)
error = kern_execve(td, &eargs, NULL, oldvmspace);
post_execve(td, error, oldvmspace);
Expand All @@ -496,8 +496,7 @@ freebsd32_fexecve(struct thread *td, struct freebsd32_fexecve_args *uap)
error = pre_execve(td, &oldvmspace);
if (error != 0)
return (error);
error = freebsd32_exec_copyin_args(&eargs, NULL, UIO_SYSSPACE,
uap->argv, uap->envv);
error = freebsd32_exec_copyin_args(&eargs, NULL, uap->argv, uap->envv);
if (error == 0) {
eargs.fd = uap->fd;
error = kern_execve(td, &eargs, NULL, oldvmspace);
Expand Down
2 changes: 1 addition & 1 deletion sys/compat/freebsd32/freebsd32_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32);

struct image_args;
int freebsd32_exec_copyin_args(struct image_args *args, const char *fname,
enum uio_seg segflg, uint32_t *argv, uint32_t *envv);
uint32_t *argv, uint32_t *envv);

extern int compat_freebsd_32bit;

Expand Down
8 changes: 4 additions & 4 deletions sys/compat/linux/linux_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2612,7 +2612,7 @@ linux_seccomp(struct thread *td, struct linux_seccomp_args *args)
*/
static int
linux_exec_copyin_args(struct image_args *args, const char *fname,
enum uio_seg segflg, l_uintptr_t *argv, l_uintptr_t *envv)
l_uintptr_t *argv, l_uintptr_t *envv)
{
char *argp, *envp;
l_uintptr_t *ptr, arg;
Expand All @@ -2633,7 +2633,7 @@ linux_exec_copyin_args(struct image_args *args, const char *fname,
/*
* Copy the file name.
*/
error = exec_args_add_fname(args, fname, segflg);
error = exec_args_add_fname(args, fname, UIO_USERSPACE);
if (error != 0)
goto err_exit;

Expand Down Expand Up @@ -2696,8 +2696,8 @@ linux_execve(struct thread *td, struct linux_execve_args *args)

LINUX_CTR(execve);

error = linux_exec_copyin_args(&eargs, args->path, UIO_USERSPACE,
args->argp, args->envp);
error = linux_exec_copyin_args(&eargs, args->path, args->argp,
args->envp);
if (error == 0)
error = linux_common_execve(td, &eargs);
AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td);
Expand Down
13 changes: 5 additions & 8 deletions sys/kern/kern_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ sys_execve(struct thread *td, struct execve_args *uap)
error = pre_execve(td, &oldvmspace);
if (error != 0)
return (error);
error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE,
uap->argv, uap->envv);
error = exec_copyin_args(&args, uap->fname, uap->argv, uap->envv);
if (error == 0)
error = kern_execve(td, &args, NULL, oldvmspace);
post_execve(td, error, oldvmspace);
Expand All @@ -251,8 +250,7 @@ sys_fexecve(struct thread *td, struct fexecve_args *uap)
error = pre_execve(td, &oldvmspace);
if (error != 0)
return (error);
error = exec_copyin_args(&args, NULL, UIO_SYSSPACE,
uap->argv, uap->envv);
error = exec_copyin_args(&args, NULL, uap->argv, uap->envv);
if (error == 0) {
args.fd = uap->fd;
error = kern_execve(td, &args, NULL, oldvmspace);
Expand Down Expand Up @@ -282,8 +280,7 @@ sys___mac_execve(struct thread *td, struct __mac_execve_args *uap)
error = pre_execve(td, &oldvmspace);
if (error != 0)
return (error);
error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE,
uap->argv, uap->envv);
error = exec_copyin_args(&args, uap->fname, uap->argv, uap->envv);
if (error == 0)
error = kern_execve(td, &args, uap->mac_p, oldvmspace);
post_execve(td, error, oldvmspace);
Expand Down Expand Up @@ -1328,7 +1325,7 @@ exec_map_stack(struct image_params *imgp)
*/
int
exec_copyin_args(struct image_args *args, const char *fname,
enum uio_seg segflg, char **argv, char **envv)
char **argv, char **envv)
{
u_long arg, env;
int error;
Expand All @@ -1348,7 +1345,7 @@ exec_copyin_args(struct image_args *args, const char *fname,
/*
* Copy the file name.
*/
error = exec_args_add_fname(args, fname, segflg);
error = exec_args_add_fname(args, fname, UIO_USERSPACE);
if (error != 0)
goto err_exit;

Expand Down
3 changes: 1 addition & 2 deletions sys/sys/imgact.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ int exec_map_stack(struct image_params *);
int exec_new_vmspace(struct image_params *, struct sysentvec *);
void exec_setregs(struct thread *, struct image_params *, uintptr_t);
int exec_shell_imgact(struct image_params *);
int exec_copyin_args(struct image_args *, const char *, enum uio_seg,
char **, char **);
int exec_copyin_args(struct image_args *, const char *, char **, char **);
int pre_execve(struct thread *td, struct vmspace **oldvmspace);
void post_execve(struct thread *td, int error, struct vmspace *oldvmspace);
#endif
Expand Down
Loading