diff options
Diffstat (limited to 'arch/um/kernel/exec.c')
-rw-r--r-- | arch/um/kernel/exec.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index 6cade9366364..8c82786da823 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c | |||
@@ -39,34 +39,21 @@ void flush_thread(void) | |||
39 | 39 | ||
40 | void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) | 40 | void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp) |
41 | { | 41 | { |
42 | get_safe_registers(regs->regs.gp, regs->regs.fp); | ||
42 | PT_REGS_IP(regs) = eip; | 43 | PT_REGS_IP(regs) = eip; |
43 | PT_REGS_SP(regs) = esp; | 44 | PT_REGS_SP(regs) = esp; |
44 | } | 45 | current->ptrace &= ~PT_DTRACE; |
45 | EXPORT_SYMBOL(start_thread); | ||
46 | |||
47 | static long execve1(const char *file, | ||
48 | const char __user *const __user *argv, | ||
49 | const char __user *const __user *env) | ||
50 | { | ||
51 | long error; | ||
52 | |||
53 | error = do_execve(file, argv, env, ¤t->thread.regs); | ||
54 | if (error == 0) { | ||
55 | task_lock(current); | ||
56 | current->ptrace &= ~PT_DTRACE; | ||
57 | #ifdef SUBARCH_EXECVE1 | 46 | #ifdef SUBARCH_EXECVE1 |
58 | SUBARCH_EXECVE1(¤t->thread.regs.regs); | 47 | SUBARCH_EXECVE1(regs->regs); |
59 | #endif | 48 | #endif |
60 | task_unlock(current); | ||
61 | } | ||
62 | return error; | ||
63 | } | 49 | } |
50 | EXPORT_SYMBOL(start_thread); | ||
64 | 51 | ||
65 | long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env) | 52 | long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env) |
66 | { | 53 | { |
67 | long err; | 54 | long err; |
68 | 55 | ||
69 | err = execve1(file, argv, env); | 56 | err = do_execve(file, argv, env, ¤t->thread.regs); |
70 | if (!err) | 57 | if (!err) |
71 | UML_LONGJMP(current->thread.exec_buf, 1); | 58 | UML_LONGJMP(current->thread.exec_buf, 1); |
72 | return err; | 59 | return err; |
@@ -81,7 +68,7 @@ long sys_execve(const char __user *file, const char __user *const __user *argv, | |||
81 | filename = getname(file); | 68 | filename = getname(file); |
82 | error = PTR_ERR(filename); | 69 | error = PTR_ERR(filename); |
83 | if (IS_ERR(filename)) goto out; | 70 | if (IS_ERR(filename)) goto out; |
84 | error = execve1(filename, argv, env); | 71 | error = do_execve(filename, argv, env, ¤t->thread.regs); |
85 | putname(filename); | 72 | putname(filename); |
86 | out: | 73 | out: |
87 | return error; | 74 | return error; |