Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-13 Thread AKASHI Takahiro
Ulrich, Arnd, thank you for your discussions: On 11/14/2014 07:25 AM, Arnd Bergmann wrote: On Thursday 13 November 2014 15:49:20 Ulrich Weigand wrote: Arnd Bergmann wrote on 13.11.2014 11:21:28: I have to admit that I don't really understand gdb internals, but from a first look I get the imp

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-13 Thread Arnd Bergmann
On Thursday 13 November 2014 15:49:20 Ulrich Weigand wrote: > Arnd Bergmann wrote on 13.11.2014 11:21:28: > > > I have to admit that I don't really understand gdb internals, but from > > a first look I get the impression that it will just do the right thing > > if you reuse NT_S390_SYSTEM_CALL on

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-13 Thread Ulrich Weigand
Arnd Bergmann wrote on 13.11.2014 11:21:28: > I have to admit that I don't really understand gdb internals, but from > a first look I get the impression that it will just do the right thing > if you reuse NT_S390_SYSTEM_CALL on ARM64 with the same semantics. There's an interface between BFD and

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-13 Thread Arnd Bergmann
On Thursday 13 November 2014 16:02:49 AKASHI Takahiro wrote: > On 11/12/2014 08:19 PM, Arnd Bergmann wrote: > > On Wednesday 12 November 2014 11:13:52 Will Deacon wrote: > >> On Wed, Nov 12, 2014 at 11:06:59AM +, AKASHI Takahiro wrote: > >>> On 11/12/2014 08:00 PM, Will Deacon wrote: > On

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-12 Thread AKASHI Takahiro
On 11/12/2014 08:19 PM, Arnd Bergmann wrote: On Wednesday 12 November 2014 11:13:52 Will Deacon wrote: On Wed, Nov 12, 2014 at 11:06:59AM +, AKASHI Takahiro wrote: On 11/12/2014 08:00 PM, Will Deacon wrote: On Wed, Nov 12, 2014 at 10:46:01AM +, AKASHI Takahiro wrote: On 11/07/2014 11:

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-12 Thread Russell King - ARM Linux
On Wed, Nov 12, 2014 at 12:19:26PM +0100, Arnd Bergmann wrote: > On Wednesday 12 November 2014 11:13:52 Will Deacon wrote: > > Just do arm64. We already have the dedicated request for arch/arm/. > > I wonder if we should define NT_ARM64_SYSTEM_CALL to the same value > as NT_S390_SYSTEM_CALL (0x307

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-12 Thread Arnd Bergmann
On Wednesday 12 November 2014 11:13:52 Will Deacon wrote: > On Wed, Nov 12, 2014 at 11:06:59AM +, AKASHI Takahiro wrote: > > On 11/12/2014 08:00 PM, Will Deacon wrote: > > > On Wed, Nov 12, 2014 at 10:46:01AM +, AKASHI Takahiro wrote: > > >> On 11/07/2014 11:04 PM, Oleg Nesterov wrote: > >

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-12 Thread Will Deacon
On Wed, Nov 12, 2014 at 11:06:59AM +, AKASHI Takahiro wrote: > On 11/12/2014 08:00 PM, Will Deacon wrote: > > On Wed, Nov 12, 2014 at 10:46:01AM +, AKASHI Takahiro wrote: > >> On 11/07/2014 11:04 PM, Oleg Nesterov wrote: > >>> To me the fact that PTRACE_SET_SYSCALL can be undefined and > >

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-12 Thread AKASHI Takahiro
On 11/12/2014 08:00 PM, Will Deacon wrote: On Wed, Nov 12, 2014 at 10:46:01AM +, AKASHI Takahiro wrote: On 11/07/2014 11:04 PM, Oleg Nesterov wrote: To me the fact that PTRACE_SET_SYSCALL can be undefined and syscall_set_nr() is very much arch-dependant (but most probably trivial) means tha

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-12 Thread Will Deacon
On Wed, Nov 12, 2014 at 10:46:01AM +, AKASHI Takahiro wrote: > On 11/07/2014 11:04 PM, Oleg Nesterov wrote: > > To me the fact that PTRACE_SET_SYSCALL can be undefined and syscall_set_nr() > > is very much arch-dependant (but most probably trivial) means that this > > code > > should live in

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-12 Thread AKASHI Takahiro
Will, On 11/07/2014 11:04 PM, Oleg Nesterov wrote: On 11/07, AKASHI Takahiro wrote: --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -853,11 +853,6 @@ long arch_ptrace(struct task_struct *child, long request, datap);

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-09 Thread AKASHI Takahiro
On 11/07/2014 09:27 PM, Will Deacon wrote: On Fri, Nov 07, 2014 at 12:03:00PM +, Arnd Bergmann wrote: On Friday 07 November 2014 11:55:51 Will Deacon wrote: On Fri, Nov 07, 2014 at 09:30:53AM +, Arnd Bergmann wrote: On Friday 07 November 2014 16:47:23 AKASHI Takahiro wrote: This patch

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Roland McGrath
Not that I'm actually involved any more, but I'd endorse the user_regset approach and not the new request. On many (most?) machines, it's already part of the main integer regset (orig_rax et al) and adding another mechanism is redundant. Using user_regset also means there won't be a word of hidde

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Kees Cook
On Fri, Nov 7, 2014 at 6:30 AM, Arnd Bergmann wrote: > On Friday 07 November 2014 13:11:30 Will Deacon wrote: >> >> > It's not that I care strongly about the interface, my main point is >> > that the changelog doesn't describe why one interface was used instead >> > the other. >> >> I suspect the

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Arnd Bergmann
On Friday 07 November 2014 13:11:30 Will Deacon wrote: > > > It's not that I care strongly about the interface, my main point is > > that the changelog doesn't describe why one interface was used instead > > the other. > > I suspect the current approach was taken because it follows the same schem

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Oleg Nesterov
On 11/07, AKASHI Takahiro wrote: > > --- a/arch/arm/kernel/ptrace.c > +++ b/arch/arm/kernel/ptrace.c > @@ -853,11 +853,6 @@ long arch_ptrace(struct task_struct *child, long request, > datap); > break; > > - case PTRACE_SET_SYS

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Will Deacon
On Fri, Nov 07, 2014 at 12:44:07PM +, Arnd Bergmann wrote: > On Friday 07 November 2014 12:11:19 Russell King - ARM Linux wrote: > > On Fri, Nov 07, 2014 at 01:03:00PM +0100, Arnd Bergmann wrote: > > > On Friday 07 November 2014 11:55:51 Will Deacon wrote: > > > > We need this for arm64 and, si

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Arnd Bergmann
On Friday 07 November 2014 12:11:19 Russell King - ARM Linux wrote: > On Fri, Nov 07, 2014 at 01:03:00PM +0100, Arnd Bergmann wrote: > > On Friday 07 November 2014 11:55:51 Will Deacon wrote: > > > We need this for arm64 and, since all architectures seem to have a > > > mechanism > > > for setting

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Will Deacon
On Fri, Nov 07, 2014 at 12:03:00PM +, Arnd Bergmann wrote: > On Friday 07 November 2014 11:55:51 Will Deacon wrote: > > On Fri, Nov 07, 2014 at 09:30:53AM +, Arnd Bergmann wrote: > > > On Friday 07 November 2014 16:47:23 AKASHI Takahiro wrote: > > > > This patch adds a new generic ptrace re

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Russell King - ARM Linux
On Fri, Nov 07, 2014 at 01:03:00PM +0100, Arnd Bergmann wrote: > On Friday 07 November 2014 11:55:51 Will Deacon wrote: > > We need this for arm64 and, since all architectures seem to have a mechanism > > for setting a system call via ptrace, moving it to generic code should make > > sense for new

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Arnd Bergmann
On Friday 07 November 2014 11:55:51 Will Deacon wrote: > On Fri, Nov 07, 2014 at 09:30:53AM +, Arnd Bergmann wrote: > > On Friday 07 November 2014 16:47:23 AKASHI Takahiro wrote: > > > This patch adds a new generic ptrace request, PTRACE_SET_SYSCALL. > > > It can be used to change a system call

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Will Deacon
On Fri, Nov 07, 2014 at 09:30:53AM +, Arnd Bergmann wrote: > On Friday 07 November 2014 16:47:23 AKASHI Takahiro wrote: > > This patch adds a new generic ptrace request, PTRACE_SET_SYSCALL. > > It can be used to change a system call number as follows: > > ret = ptrace(pid, PTRACE_SET_SYSCAL

Re: [RFC] ptrace: add generic SET_SYSCALL request

2014-11-07 Thread Arnd Bergmann
On Friday 07 November 2014 16:47:23 AKASHI Takahiro wrote: > This patch adds a new generic ptrace request, PTRACE_SET_SYSCALL. > It can be used to change a system call number as follows: > ret = ptrace(pid, PTRACE_SET_SYSCALL, null, new_syscall_no); > 'new_syscall_no' can be -1 to skip this sys