diff options
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 5e2ba634ea15..bb17bd9334fb 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -236,6 +236,32 @@ int sys_vfork(struct pt_regs *regs) | |||
236 | 236 | ||
237 | 237 | ||
238 | /* | 238 | /* |
239 | * sys_execve() executes a new program. | ||
240 | */ | ||
241 | long sys_execve(char __user *name, char __user * __user *argv, | ||
242 | char __user * __user *envp, struct pt_regs *regs) | ||
243 | { | ||
244 | long error; | ||
245 | char *filename; | ||
246 | |||
247 | filename = getname(name); | ||
248 | error = PTR_ERR(filename); | ||
249 | if (IS_ERR(filename)) | ||
250 | return error; | ||
251 | error = do_execve(filename, argv, envp, regs); | ||
252 | |||
253 | #ifdef CONFIG_X86_32 | ||
254 | if (error == 0) { | ||
255 | /* Make sure we don't return using sysenter.. */ | ||
256 | set_thread_flag(TIF_IRET); | ||
257 | } | ||
258 | #endif | ||
259 | |||
260 | putname(filename); | ||
261 | return error; | ||
262 | } | ||
263 | |||
264 | /* | ||
239 | * Idle related variables and functions | 265 | * Idle related variables and functions |
240 | */ | 266 | */ |
241 | unsigned long boot_option_idle_override = 0; | 267 | unsigned long boot_option_idle_override = 0; |