um: Store syscall number after syscall_trace_enter()

To support changing syscall numbers we have to store
it after syscall_trace_enter().

Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
Richard Weinberger
2015-10-25 19:54:33 +01:00
parent 44011b897a
commit 1d80f0cda1
3 changed files with 11 additions and 13 deletions

View File

@@ -137,9 +137,6 @@ static void handle_trap(int pid, struct uml_pt_regs *regs,
if ((UPT_IP(regs) >= STUB_START) && (UPT_IP(regs) < STUB_END))
fatal_sigsegv();
/* Mark this as a syscall */
UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->gp);
if (!local_using_sysemu)
{
err = ptrace(PTRACE_POKEUSER, pid, PT_SYSCALL_NR_OFFSET,
@@ -174,6 +171,13 @@ static void handle_trap(int pid, struct uml_pt_regs *regs,
handle_syscall(regs);
}
int get_syscall(struct uml_pt_regs *regs)
{
UPT_SYSCALL_NR(regs) = PT_SYSCALL_NR(regs->gp);
return UPT_SYSCALL_NR(regs);
}
extern char __syscall_stub_start[];
static int userspace_tramp(void *stack)