Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332975
b: refs/heads/master
c: 38b983b
h: refs/heads/master
i:
  332973: e72b0ff
  332971: 7ec817f
  332967: 67051a3
  332959: a8a040c
v: v3
  • Loading branch information
Al Viro committed Oct 1, 2012
1 parent 17a3040 commit b7490db
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 282124d18626379a20b41d25e0c580f290cd09d4
refs/heads/master: 38b983b3461e7d3c64a981e2338bb34605c46f30
38 changes: 34 additions & 4 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ struct user_arg_ptr {
union {
const char __user *const __user *native;
#ifdef CONFIG_COMPAT
compat_uptr_t __user *compat;
const compat_uptr_t __user *compat;
#endif
} ptr;
};
Expand Down Expand Up @@ -1600,9 +1600,9 @@ int do_execve(const char *filename,
}

#ifdef CONFIG_COMPAT
int compat_do_execve(char *filename,
compat_uptr_t __user *__argv,
compat_uptr_t __user *__envp,
int compat_do_execve(const char *filename,
const compat_uptr_t __user *__argv,
const compat_uptr_t __user *__envp,
struct pt_regs *regs)
{
struct user_arg_ptr argv = {
Expand Down Expand Up @@ -2319,6 +2319,36 @@ int dump_seek(struct file *file, loff_t off)
}
EXPORT_SYMBOL(dump_seek);

#ifdef __ARCH_WANT_SYS_EXECVE
SYSCALL_DEFINE3(execve,
const char __user *, filename,
const char __user *const __user *, argv,
const char __user *const __user *, envp)
{
const char *path = getname(filename);
int error = PTR_ERR(path);
if (!IS_ERR(path)) {
error = do_execve(path, argv, envp, current_pt_regs());
putname(path);
}
return error;
}
#ifdef CONFIG_COMPAT
asmlinkage long compat_sys_execve(const char __user * filename,
const compat_uptr_t __user * argv,
const compat_uptr_t __user * envp)
{
const char *path = getname(filename);
int error = PTR_ERR(path);
if (!IS_ERR(path)) {
error = compat_do_execve(path, argv, envp, current_pt_regs());
putname(path);
}
return error;
}
#endif
#endif

#ifdef __ARCH_WANT_KERNEL_EXECVE
int kernel_execve(const char *filename,
const char *const argv[],
Expand Down
8 changes: 6 additions & 2 deletions trunk/include/linux/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,12 @@ asmlinkage ssize_t compat_sys_pwritev(unsigned long fd,
const struct compat_iovec __user *vec,
unsigned long vlen, u32 pos_low, u32 pos_high);

int compat_do_execve(char *filename, compat_uptr_t __user *argv,
compat_uptr_t __user *envp, struct pt_regs *regs);
int compat_do_execve(const char *filename, const compat_uptr_t __user *argv,
const compat_uptr_t __user *envp, struct pt_regs *regs);
#ifdef __ARCH_WANT_SYS_EXECVE
asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
const compat_uptr_t __user *envp);
#endif

asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
compat_ulong_t __user *outp, compat_ulong_t __user *exp,
Expand Down

0 comments on commit b7490db

Please sign in to comment.