From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: References: <1450656209-2676-1-git-send-email-mic@digikod.net> <1450656209-2676-2-git-send-email-mic@digikod.net> From: Richard Weinberger Message-ID: <567745E3.1030509@nod.at> Date: Mon, 21 Dec 2015 01:20:51 +0100 MIME-Version: 1.0 In-Reply-To: <1450656209-2676-2-git-send-email-mic@digikod.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Sender: linux-kernel-owner@vger.kernel.org Subject: Re: [PATCH v1 1/4] um: Fix ptrace GETREGS/SETREGS bugs To: =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , linux-kernel@vger.kernel.org Cc: Jonathan Corbet , Jeff Dike , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, Kees Cook , Andy Lutomirski , Will Drewry , Shuah Khan , Chris Metcalf , Michael Ellerman , Andrew Morton , James Hogan , Thomas Meyer , Nicolas Iooss , Anton Ivanov , linux-doc@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net, user-mode-linux-user@lists.sourceforge.net, linux-api@vger.kernel.org, Meredydd Luff , David Drysdale List-ID: Am 21.12.2015 um 01:03 schrieb Micka=C3=ABl Sala=C3=BCn: > This fix two related bugs: > * PTRACE_GETREGS doesn't get the right orig_ax (syscall) value > * PTRACE_SETREGS can't set the orig_ax value (erased by initial value= ) >=20 > Remove the now useless and error-prone get_syscall(). >=20 > Signed-off-by: Micka=C3=ABl Sala=C3=BCn > Cc: Jeff Dike > Cc: Richard Weinberger > Cc: Thomas Gleixner > Cc: Kees Cook > Cc: Andy Lutomirski > Cc: Will Drewry > Cc: Thomas Meyer > Cc: Nicolas Iooss > Cc: Anton Ivanov > Cc: linux-kernel@vger.kernel.org > Cc: user-mode-linux-devel@lists.sourceforge.net > Cc: user-mode-linux-user@lists.sourceforge.net > Cc: Meredydd Luff > Cc: David Drysdale > --- > arch/um/kernel/skas/syscall.c | 7 ++++++- > arch/um/os-Linux/skas/process.c | 7 ------- > 2 files changed, 6 insertions(+), 8 deletions(-) >=20 > diff --git a/arch/um/kernel/skas/syscall.c b/arch/um/kernel/skas/sysc= all.c > index 1683b8e..65f0d1a 100644 > --- a/arch/um/kernel/skas/syscall.c > +++ b/arch/um/kernel/skas/syscall.c > @@ -7,6 +7,7 @@ > #include > #include > #include > +#include > #include > #include > =20 > @@ -16,12 +17,16 @@ void handle_syscall(struct uml_pt_regs *r) > long result; > int syscall; > =20 > + /* Save the syscall register. */ > + UPT_SYSCALL_NR(r) =3D PT_SYSCALL_NR(r->gp); > + > if (syscall_trace_enter(regs)) { > result =3D -ENOSYS; > goto out; > } > =20 > - syscall =3D get_syscall(r); > + /* Get the syscall after being potentially updated with ptrace. */ > + syscall =3D UPT_SYSCALL_NR(r); Doesn't this break the support for changing syscall numbers using PTRAC= E_SETREGS? Thanks, //richard -- To unsubscribe from this list: send the line "unsubscribe linux-kernel"= in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/