Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332974
b: refs/heads/master
c: 282124d
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Sep 30, 2012
1 parent e72b0ff commit 17a3040
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a3460a59747cfddfa7be4758e5ef08bf5d751d59
refs/heads/master: 282124d18626379a20b41d25e0c580f290cd09d4
22 changes: 22 additions & 0 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2318,3 +2318,25 @@ int dump_seek(struct file *file, loff_t off)
return ret;
}
EXPORT_SYMBOL(dump_seek);

#ifdef __ARCH_WANT_KERNEL_EXECVE
int kernel_execve(const char *filename,
const char *const argv[],
const char *const envp[])
{
struct pt_regs *p = current_pt_regs();
int ret;

ret = do_execve(filename,
(const char __user *const __user *)argv,
(const char __user *const __user *)envp, p);
if (ret < 0)
return ret;

/*
* We were successful. We won't be returning to our caller, but
* instead to user space by manipulating the kernel stack.
*/
ret_from_kernel_execve(p);
}
#endif
5 changes: 5 additions & 0 deletions trunk/include/linux/binfmts.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct pt_regs;

#ifdef __KERNEL__
#include <linux/sched.h>
#include <linux/unistd.h>
#include <asm/exec.h>

#define CORENAME_MAX_SIZE 128
Expand Down Expand Up @@ -137,5 +138,9 @@ extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
extern void set_binfmt(struct linux_binfmt *new);
extern void free_bprm(struct linux_binprm *);

#ifdef __ARCH_WANT_KERNEL_EXECVE
extern void ret_from_kernel_execve(struct pt_regs *normal) __noreturn;
#endif

#endif /* __KERNEL__ */
#endif /* _LINUX_BINFMTS_H */

0 comments on commit 17a3040

Please sign in to comment.