RE: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-05 Thread David Laight
From: Oleg Nesterov [mailto:o...@redhat.com] > Sent: 05 June 2019 10:25 > On 06/05, David Laight wrote: > > > > epoll() would have: > > if (restore_user_sigmask(xxx.sigmask, &sigsaved, !ret || ret == -EINTR)) > > ret = -EINTR; > > I don't think so but lets discuss this later. I ce

Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-05 Thread Oleg Nesterov
On 06/05, David Laight wrote: > > epoll() would have: > if (restore_user_sigmask(xxx.sigmask, &sigsaved, !ret || ret == -EINTR)) > ret = -EINTR; I don't think so but lets discuss this later. > I also think it could be simplified if code that loaded the 'user sigmask' > saved t

Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-05 Thread Oleg Nesterov
On 06/04, Eric W. Biederman wrote: > > >> - restore_user_sigmask(ksig.sigmask, &sigsaved); > >> - if (signal_pending(current) && !ret) > >> + > >> + interrupted = signal_pending(current); > >> + restore_user_sigmask(ksig.sigmask, &sigsaved, interrupted); > >> + if (int

RE: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-05 Thread David Laight
From: Linus Torvalds > Sent: 04 June 2019 22:27 > Ugh. I htink this is correct, but I wish we had a better and more > intuitive interface. > > In particular, since restore_user_sigmask() basically wants to check > for "signal_pending()" anyway (to decide if the mask should be > restored by signal

Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-05 Thread Oleg Nesterov
On 06/04, Linus Torvalds wrote: > > On Tue, Jun 4, 2019 at 6:41 AM Oleg Nesterov wrote: > > > > This is the minimal fix for stable, I'll send cleanups later. > > Ugh. I htink this is correct, but I wish we had a better and more > intuitive interface. Yes, > In particular, since restore_user_sigm

Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-04 Thread Eric W. Biederman
Linus Torvalds writes: > On Tue, Jun 4, 2019 at 6:41 AM Oleg Nesterov wrote: >> >> This is the minimal fix for stable, I'll send cleanups later. > > Ugh. I htink this is correct, but I wish we had a better and more > intuitive interface. > > In particular, since restore_user_sigmask() basically

Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-04 Thread Eric Wong
Linus Torvalds wrote: > On Tue, Jun 4, 2019 at 6:41 AM Oleg Nesterov wrote: > > > > This is the minimal fix for stable, I'll send cleanups later. > > Ugh. I htink this is correct, but I wish we had a better and more > intuitive interface. I had the same thoughts, but am not a regular kernel hac

Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-04 Thread Linus Torvalds
On Tue, Jun 4, 2019 at 6:41 AM Oleg Nesterov wrote: > > This is the minimal fix for stable, I'll send cleanups later. Ugh. I htink this is correct, but I wish we had a better and more intuitive interface. In particular, since restore_user_sigmask() basically wants to check for "signal_pending()"

Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-04 Thread Eric Wong
Oleg Nesterov wrote: > This is the minimal fix for stable, I'll send cleanups later. > > The commit 854a6ed56839a40f6b5d02a2962f48841482eec4 ("signal: Add > restore_user_sigmask()") introduced the visible change which breaks > user-space: a signal temporary unblocked by set_user_sigmask() can > b

Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-04 Thread Deepa Dinamani
> On Tue, Jun 4, 2019 at 3:41 PM Oleg Nesterov wrote: > > > > This is the minimal fix for stable, I'll send cleanups later. > > > > The commit 854a6ed56839a40f6b5d02a2962f48841482eec4 ("signal: Add > > restore_user_sigmask()") introduced the visible change which breaks > > user-space: a signal tem

Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-04 Thread Arnd Bergmann
On Tue, Jun 4, 2019 at 3:41 PM Oleg Nesterov wrote: > > This is the minimal fix for stable, I'll send cleanups later. > > The commit 854a6ed56839a40f6b5d02a2962f48841482eec4 ("signal: Add > restore_user_sigmask()") introduced the visible change which breaks > user-space: a signal temporary unblock

RE: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-04 Thread David Laight
From: Eric W. Biederman > Sent: 04 June 2019 16:32 ... > Michael is there any chance we can get this guarantee of the linux > implementation of pselect and friends clearly documented. The guarantee > that if the system call completes successfully we are guaranteed that > no signal that is unblocke

Re: [PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-04 Thread Eric W. Biederman
Oleg Nesterov writes: > This is the minimal fix for stable, I'll send cleanups later. > > The commit 854a6ed56839a40f6b5d02a2962f48841482eec4 ("signal: Add > restore_user_sigmask()") introduced the visible change which breaks > user-space: a signal temporary unblocked by set_user_sigmask() can >

[PATCH] signal: remove the wrong signal_pending() check in restore_user_sigmask()

2019-06-04 Thread Oleg Nesterov
This is the minimal fix for stable, I'll send cleanups later. The commit 854a6ed56839a40f6b5d02a2962f48841482eec4 ("signal: Add restore_user_sigmask()") introduced the visible change which breaks user-space: a signal temporary unblocked by set_user_sigmask() can be delivered even if the caller ret