[PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2018-11-19 Thread Andrei Vagin
There are a few system calls (pselect, ppoll, etc) which replace a task sigmask while they are running in a kernel-space When a task calls one of these syscalls, the kernel saves a current sigmask in task->saved_sigmask and sets a syscall sigmask. On syscall-exit-stop, ptrace traps a task before

[RESEND PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2019-03-19 Thread Andrei Vagin
There are a few system calls (pselect, ppoll, etc) which replace a task sigmask while they are running in a kernel-space When a task calls one of these syscalls, the kernel saves a current sigmask in task->saved_sigmask and sets a syscall sigmask. On syscall-exit-stop, ptrace traps a task before

Re: [PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2018-11-21 Thread Andrew Morton
On Mon, 19 Nov 2018 22:06:16 -0800 Andrei Vagin wrote: > There are a few system calls (pselect, ppoll, etc) which replace a task > sigmask while they are running in a kernel-space > > When a task calls one of these syscalls, the kernel saves a current > sigmask in task->saved_sigmask and sets a

Re: [PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2019-02-02 Thread Andrei Vagin
On Wed, Nov 21, 2018 at 06:16:50PM -0800, Andrew Morton wrote: > On Mon, 19 Nov 2018 22:06:16 -0800 Andrei Vagin wrote: > > > There are a few system calls (pselect, ppoll, etc) which replace a task > > sigmask while they are running in a kernel-space > > > > When a task calls one of these syscal

Re: [PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2018-11-22 Thread Oleg Nesterov
On 11/19, Andrei Vagin wrote: > > case PTRACE_SETSIGMASK: { > sigset_t new_set; > @@ -962,6 +971,8 @@ int ptrace_request(struct task_struct *child, long > request, > child->blocked = new_set; > spin_unlock_irq(&child->sighand->siglock); > > +

Re: [PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2018-11-26 Thread Andrei Vagin
On Thu, Nov 22, 2018 at 12:47:52PM +0100, Oleg Nesterov wrote: > On 11/19, Andrei Vagin wrote: > > > > case PTRACE_SETSIGMASK: { > > sigset_t new_set; > > @@ -962,6 +971,8 @@ int ptrace_request(struct task_struct *child, long > > request, > > child->blocked = new_set; >

Re: [PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2018-11-27 Thread Oleg Nesterov
On 11/26, Andrei Vagin wrote: > > > IOW, could you please explain how PTRACE_SETSIGMASK should be used, and why > > it doesn't do something like > > > > CRIU uses PTRACE_SETSIGMASK when it injects a parasite code into a > target process. In this case, we have to be sure that when the process > is r

Re: [RESEND PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2019-03-19 Thread Dmitry V. Levin
On Tue, Mar 19, 2019 at 12:19:57PM -0700, Andrei Vagin wrote: > There are a few system calls (pselect, ppoll, etc) which replace a task > sigmask while they are running in a kernel-space > > When a task calls one of these syscalls, the kernel saves a current > sigmask in task->saved_sigmask and se

Re: [RESEND PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2019-03-19 Thread Andrew Morton
On Wed, 20 Mar 2019 01:32:53 +0300 "Dmitry V. Levin" wrote: > On Tue, Mar 19, 2019 at 12:19:57PM -0700, Andrei Vagin wrote: > > There are a few system calls (pselect, ppoll, etc) which replace a task > > sigmask while they are running in a kernel-space > > > > When a task calls one of these sysc

Re: [RESEND PATCH] ptrace: take into account saved_sigmask in PTRACE_{GET,SET}SIGMASK

2019-03-20 Thread Oleg Nesterov
On 03/19, Andrei Vagin wrote: > > There are a few system calls (pselect, ppoll, etc) which replace a task > sigmask while they are running in a kernel-space > > When a task calls one of these syscalls, the kernel saves a current > sigmask in task->saved_sigmask and sets a syscall sigmask. > > On sy