x86, um/x86: switch to generic sys_execve and kernel_execve
32bit wrapper is lost on that; 64bit one is *not*, since we need to arrange for full pt_regs on stack when we call sys_execve() and we need to load callee-saved ones from there afterwards. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include "mem_user.h"
|
||||
#include "skas.h"
|
||||
#include "os.h"
|
||||
#include "internal.h"
|
||||
|
||||
void flush_thread(void)
|
||||
{
|
||||
@@ -49,27 +48,7 @@ void start_thread(struct pt_regs *regs, unsigned long eip, unsigned long esp)
|
||||
}
|
||||
EXPORT_SYMBOL(start_thread);
|
||||
|
||||
long um_execve(const char *file, const char __user *const __user *argv, const char __user *const __user *env)
|
||||
void __noreturn ret_from_kernel_execve(struct pt_regs *unused)
|
||||
{
|
||||
long err;
|
||||
|
||||
err = do_execve(file, argv, env, ¤t->thread.regs);
|
||||
if (!err)
|
||||
UML_LONGJMP(current->thread.exec_buf, 1);
|
||||
return err;
|
||||
}
|
||||
|
||||
long sys_execve(const char __user *file, const char __user *const __user *argv,
|
||||
const char __user *const __user *env)
|
||||
{
|
||||
long error;
|
||||
char *filename;
|
||||
|
||||
filename = getname(file);
|
||||
error = PTR_ERR(filename);
|
||||
if (IS_ERR(filename)) goto out;
|
||||
error = do_execve(filename, argv, env, ¤t->thread.regs);
|
||||
putname(filename);
|
||||
out:
|
||||
return error;
|
||||
UML_LONGJMP(current->thread.exec_buf, 1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user