All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: linux-kernel@vger.kernel.org, rjw@rjwysocki.net,
	mingo@kernel.org, vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de,
	bigeasy@linutronix.de, Will Deacon <will@kernel.org>,
	tj@kernel.org, linux-pm@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-um@lists.infradead.org, Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>,
	linux-xtensa@linux-xtensa.org, Kees Cook <keescook@chromium.org>,
	Jann Horn <jannh@google.com>,
	linux-ia64@vger.kernel.org
Subject: Re: [PATCH v2 07/12] ptrace: Don't change __state
Date: Wed, 04 May 2022 13:28:56 -0500	[thread overview]
Message-ID: <87tua5b193.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <87h765ci7w.fsf@email.froward.int.ebiederm.org> (Eric W. Biederman's message of "Wed, 04 May 2022 12:37:07 -0500")

"Eric W. Biederman" <ebiederm@xmission.com> writes:

> Oleg Nesterov <oleg@redhat.com> writes:
>
>> On 05/03, Eric W. Biederman wrote:
>>>
>>> Oleg Nesterov <oleg@redhat.com> writes:
>>>
>>> > But why is it bad if the tracee doesn't sleep in schedule ? If it races
>>> > with SIGKILL. I still can't understand this.
>>> >
>>> > Yes, wait_task_inactive() can fail, so you need to remove WARN_ON_ONCE()
>>> > in 11/12.
>>>
>>> >
>>> > Why is removing TASK_WAKEKILL from TASK_TRACED and complicating
>>> > *signal_wake_up() better?
>>>
>>> Not changing __state is better because it removes special cases
>>> from the scheduler that only apply to ptrace.
>>
>> Hmm. But I didn't argue with that? I like the idea of JOBCTL_TASK_FROZEN.
>>
>> I meant, I do not think that removing KILLABLE from TASK_TRACED (not
>> from __state) and complicating *signal_wake_up() (I mean, compared
>> to your previous version) is a good idea.
>>
>> And. At least in context of this series it is fine if the JOBCTL_TASK_FROZEN
>> tracee do not block in schedule(), just you need to remove WARN_ON_ONCE()
>> around wait_task_inactive().
>>
>>> > And even if we need to ensure the tracee will always block after
>>> > ptrace_freeze_traced(), we can change signal_pending_state() to
>>> > return false if JOBCTL_PTRACE_FROZEN. Much simpler, imo. But still
>>> > looks unnecessary to me.
>>>
>>> We still need to change signal_wake_up in that case.  Possibly
>>> signal_wake_up_state.
>>
>> Of course. See above.
>>
>>> >> if we depend on wait_task_inactive failing if the process is in the
>>> >> wrong state.
>>> >
>>> > OK, I guess this is what I do not understand. Could you spell please?
>>> >
>>> > And speaking of RT, wait_task_inactive() still can fail because
>>> > cgroup_enter_frozen() takes css_set_lock? And it is called under
>>> > preempt_disable() ? I don't understand the plan :/
>>>
>>> Let me describe his freezer change as that is much easier to get to the
>>> final result.  RT has more problems as it turns all spin locks into
>>> sleeping locks.  When a task is frozen
>>
>> [...snip...]
>>
>> Oh, thanks Eric, but I understand this part. But I still can't understand
>> why is it that critical to block in schedule... OK, I need to think about
>> it. Lets assume this is really necessary.
>>
>> Anyway. I'd suggest to not change TASK_TRACED in this series and not
>> complicate signal_wake_up() more than you did in your previous version:
>>
>> 	static inline void signal_wake_up(struct task_struct *t, bool resume)
>> 	{
>> 		bool wakekill = resume && !(t->jobctl & JOBCTL_DELAY_WAKEKILL);
>> 		signal_wake_up_state(t, wakekill ? TASK_WAKEKILL : 0);
>> 	}
>
> If your concern is signal_wake_up there is no reason it can't be:
>
> 	static inline void signal_wake_up(struct task_struct *t, bool fatal)
>         {
>         	fatal = fatal && !(t->jobctl & JOBCTL_PTRACE_FROZEN);
>                 signal_wake_up_state(t, fatal ? TASK_WAKEKILL | TASK_TRACED : 0);
>         }
>
> I guess I was more targeted in this version, which lead to more if
> statements but as there is only one place in the code that can be
> JOBCTL_PTRACE_FROZEN and TASK_TRACED there is no point in setting
> TASK_WAKEKILL without also setting TASK_TRACED in the wake-up.
>
> So yes. I can make the code as simple as my earlier version of
> signal_wake_up.
>
>> JOBCTL_PTRACE_FROZEN is fine.
>>
>> ptrace_check_attach() can do
>>
>> 	if (!ret && !ignore_state &&
>> 	    /*
>> 	     * This can only fail if the frozen tracee races with
>> 	     * SIGKILL and enters schedule() with fatal_signal_pending
>> 	     */
>> 	    !wait_task_inactive(child, __TASK_TRACED))
>> 		ret = -ESRCH;
>>
>> 	return ret;
>>
>>
>> Now. If/when we really need to ensure that the frozen tracee always
>> blocks and wait_task_inactive() never fails, we can just do
>>
>> 	- add the fatal_signal_pending() check into ptrace_stop()
>> 	  (like this patch does)
>>
>> 	- say, change signal_pending_state:
>>
>> 	static inline int signal_pending_state(unsigned int state, struct task_struct *p)
>> 	{
>> 		if (!(state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL)))
>> 			return 0;
>> 		if (!signal_pending(p))
>> 			return 0;
>> 		if (p->jobctl & JOBCTL_TASK_FROZEN)
>> 			return 0;
>> 		return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
>> 	}
>>
>> in a separate patch which should carefully document the need for this
>> change.
>>
>>> > I didn't look at JOBCTL_PTRACE_SIGNR yet. But this looks minor to me,
>>> > I mean, I am not sure it worth the trouble.
>>>
>>> The immediate problem the JOBCTL_PTRACE_SIGNR patch solves is:
>>> - stopping in ptrace_report_syscall.
>>> - Not having PT_TRACESYSGOOD set.
>>> - The tracee being killed with a fatal signal
>>         ^^^^^^
>>         tracer ?
>
> Both actually.
>
>>> - The tracee sending SIGTRAP to itself.
>>
>> Oh, but this is clear. But do we really care? If the tracer exits
>> unexpectedly, the tracee can have a lot more problems, I don't think
>> that this particular one is that important.
>
> I don't know of complaints, and if you haven't heard them either
> that that is a good indication that in practice we don't care.
>
> At a practical level I just don't want that silly case that sets
> TASK_TRACED to TASK_RUNNING without stopping at all in ptrace_stop to
> remain.  It just seems to make everything more complicated for no real
> reason anymore.  The deadlocks may_ptrace_stop was guarding against are
> gone.
>
> Plus the test is so racy we case can happen after we drop siglock
> before we schedule, or shortly after we have stopped so we really
> don't reliably catch the condition the code is trying to catch.
>
> I think the case I care most about is ptrace_signal, which pretty much
> requires the tracer to wait and clear exit_code before being terminated
> to cause problems.  We don't handle that at all today.
>
> So yeah.  I think the code handles so little at this point we can just
> remove the code and simplify things, if we actually care we can come
> back and implement JOBCTL_PTRACE_SIGNR or the like.

The original explanation for handling this is:

commit 66519f549ae516e7ff2f24a8a5134713411a4a58
Author: Roland McGrath <roland@redhat.com>
Date:   Tue Jan 4 05:38:15 2005 -0800

    [PATCH] fix ptracer death race yielding bogus BUG_ON
    
    There is a BUG_ON in ptrace_stop that hits if the thread is not ptraced.
    However, there is no synchronization between a thread deciding to do a
    ptrace stop and so going here, and its ptracer dying and so detaching from
    it and clearing its ->ptrace field.
    
    The RHEL3 2.4-based kernel has a backport of a slightly older version of
    the 2.6 signals code, which has a different but equivalent BUG_ON.  This
    actually bit users in practice (when the debugger dies), but was
    exceedingly difficult to reproduce in contrived circumstances.  We moved
    forward in RHEL3 just by removing the BUG_ON, and that fixed the real user
    problems even though I was never able to reproduce the scenario myself.
    So, to my knowledge this scenario has never actually been seen in practice
    under 2.6.  But it's plain to see from the code that it is indeed possible.
    
    This patch removes that BUG_ON, but also goes further and tries to handle
    this case more gracefully than simply avoiding the crash.  By removing the
    BUG_ON alone, it becomes possible for the real parent of a process to see
    spurious SIGCHLD notifications intended for the debugger that has just
    died, and have its child wind up stopped unexpectedly.  This patch avoids
    that possibility by detecting the case when we are about to do the ptrace
    stop but our ptracer has gone away, and simply eliding that ptrace stop
    altogether as if we hadn't been ptraced when we hit the interesting event
    (signal or ptrace_notify call for syscall tracing or something like that).
    
    Signed-off-by: Roland McGrath <roland@redhat.com>
    Signed-off-by: Andrew Morton <akpm@osdl.org>
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>

And it was all about
	BUG_ON(!(current->ptrace & PT_PTRACED));
At the beginning of ptrace_stop.

Which seems like a bit of buggy overkill.

>
> I will chew on that a bit and see if I can find any reasons for keeping
> the code in ptrace_stop at all.

Still chewing.

Eric

WARNING: multiple messages have this Message-ID (diff)
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: linux-kernel@vger.kernel.org, rjw@rjwysocki.net,
	mingo@kernel.org, vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de,
	bigeasy@linutronix.de, Will Deacon <will@kernel.org>,
	tj@kernel.org, linux-pm@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-um@lists.infradead.org, Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>,
	linux-xtensa@linux-xtensa.org, Kees Cook <keescook@chromium.org>,
	Jann Horn <jannh@google.com>,
	linux-ia64@vger.kernel.org
Subject: Re: [PATCH v2 07/12] ptrace: Don't change __state
Date: Wed, 04 May 2022 13:28:56 -0500	[thread overview]
Message-ID: <87tua5b193.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <87h765ci7w.fsf@email.froward.int.ebiederm.org> (Eric W. Biederman's message of "Wed, 04 May 2022 12:37:07 -0500")

"Eric W. Biederman" <ebiederm@xmission.com> writes:

> Oleg Nesterov <oleg@redhat.com> writes:
>
>> On 05/03, Eric W. Biederman wrote:
>>>
>>> Oleg Nesterov <oleg@redhat.com> writes:
>>>
>>> > But why is it bad if the tracee doesn't sleep in schedule ? If it races
>>> > with SIGKILL. I still can't understand this.
>>> >
>>> > Yes, wait_task_inactive() can fail, so you need to remove WARN_ON_ONCE()
>>> > in 11/12.
>>>
>>> >
>>> > Why is removing TASK_WAKEKILL from TASK_TRACED and complicating
>>> > *signal_wake_up() better?
>>>
>>> Not changing __state is better because it removes special cases
>>> from the scheduler that only apply to ptrace.
>>
>> Hmm. But I didn't argue with that? I like the idea of JOBCTL_TASK_FROZEN.
>>
>> I meant, I do not think that removing KILLABLE from TASK_TRACED (not
>> from __state) and complicating *signal_wake_up() (I mean, compared
>> to your previous version) is a good idea.
>>
>> And. At least in context of this series it is fine if the JOBCTL_TASK_FROZEN
>> tracee do not block in schedule(), just you need to remove WARN_ON_ONCE()
>> around wait_task_inactive().
>>
>>> > And even if we need to ensure the tracee will always block after
>>> > ptrace_freeze_traced(), we can change signal_pending_state() to
>>> > return false if JOBCTL_PTRACE_FROZEN. Much simpler, imo. But still
>>> > looks unnecessary to me.
>>>
>>> We still need to change signal_wake_up in that case.  Possibly
>>> signal_wake_up_state.
>>
>> Of course. See above.
>>
>>> >> if we depend on wait_task_inactive failing if the process is in the
>>> >> wrong state.
>>> >
>>> > OK, I guess this is what I do not understand. Could you spell please?
>>> >
>>> > And speaking of RT, wait_task_inactive() still can fail because
>>> > cgroup_enter_frozen() takes css_set_lock? And it is called under
>>> > preempt_disable() ? I don't understand the plan :/
>>>
>>> Let me describe his freezer change as that is much easier to get to the
>>> final result.  RT has more problems as it turns all spin locks into
>>> sleeping locks.  When a task is frozen
>>
>> [...snip...]
>>
>> Oh, thanks Eric, but I understand this part. But I still can't understand
>> why is it that critical to block in schedule... OK, I need to think about
>> it. Lets assume this is really necessary.
>>
>> Anyway. I'd suggest to not change TASK_TRACED in this series and not
>> complicate signal_wake_up() more than you did in your previous version:
>>
>> 	static inline void signal_wake_up(struct task_struct *t, bool resume)
>> 	{
>> 		bool wakekill = resume && !(t->jobctl & JOBCTL_DELAY_WAKEKILL);
>> 		signal_wake_up_state(t, wakekill ? TASK_WAKEKILL : 0);
>> 	}
>
> If your concern is signal_wake_up there is no reason it can't be:
>
> 	static inline void signal_wake_up(struct task_struct *t, bool fatal)
>         {
>         	fatal = fatal && !(t->jobctl & JOBCTL_PTRACE_FROZEN);
>                 signal_wake_up_state(t, fatal ? TASK_WAKEKILL | TASK_TRACED : 0);
>         }
>
> I guess I was more targeted in this version, which lead to more if
> statements but as there is only one place in the code that can be
> JOBCTL_PTRACE_FROZEN and TASK_TRACED there is no point in setting
> TASK_WAKEKILL without also setting TASK_TRACED in the wake-up.
>
> So yes. I can make the code as simple as my earlier version of
> signal_wake_up.
>
>> JOBCTL_PTRACE_FROZEN is fine.
>>
>> ptrace_check_attach() can do
>>
>> 	if (!ret && !ignore_state &&
>> 	    /*
>> 	     * This can only fail if the frozen tracee races with
>> 	     * SIGKILL and enters schedule() with fatal_signal_pending
>> 	     */
>> 	    !wait_task_inactive(child, __TASK_TRACED))
>> 		ret = -ESRCH;
>>
>> 	return ret;
>>
>>
>> Now. If/when we really need to ensure that the frozen tracee always
>> blocks and wait_task_inactive() never fails, we can just do
>>
>> 	- add the fatal_signal_pending() check into ptrace_stop()
>> 	  (like this patch does)
>>
>> 	- say, change signal_pending_state:
>>
>> 	static inline int signal_pending_state(unsigned int state, struct task_struct *p)
>> 	{
>> 		if (!(state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL)))
>> 			return 0;
>> 		if (!signal_pending(p))
>> 			return 0;
>> 		if (p->jobctl & JOBCTL_TASK_FROZEN)
>> 			return 0;
>> 		return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
>> 	}
>>
>> in a separate patch which should carefully document the need for this
>> change.
>>
>>> > I didn't look at JOBCTL_PTRACE_SIGNR yet. But this looks minor to me,
>>> > I mean, I am not sure it worth the trouble.
>>>
>>> The immediate problem the JOBCTL_PTRACE_SIGNR patch solves is:
>>> - stopping in ptrace_report_syscall.
>>> - Not having PT_TRACESYSGOOD set.
>>> - The tracee being killed with a fatal signal
>>         ^^^^^^
>>         tracer ?
>
> Both actually.
>
>>> - The tracee sending SIGTRAP to itself.
>>
>> Oh, but this is clear. But do we really care? If the tracer exits
>> unexpectedly, the tracee can have a lot more problems, I don't think
>> that this particular one is that important.
>
> I don't know of complaints, and if you haven't heard them either
> that that is a good indication that in practice we don't care.
>
> At a practical level I just don't want that silly case that sets
> TASK_TRACED to TASK_RUNNING without stopping at all in ptrace_stop to
> remain.  It just seems to make everything more complicated for no real
> reason anymore.  The deadlocks may_ptrace_stop was guarding against are
> gone.
>
> Plus the test is so racy we case can happen after we drop siglock
> before we schedule, or shortly after we have stopped so we really
> don't reliably catch the condition the code is trying to catch.
>
> I think the case I care most about is ptrace_signal, which pretty much
> requires the tracer to wait and clear exit_code before being terminated
> to cause problems.  We don't handle that at all today.
>
> So yeah.  I think the code handles so little at this point we can just
> remove the code and simplify things, if we actually care we can come
> back and implement JOBCTL_PTRACE_SIGNR or the like.

The original explanation for handling this is:

commit 66519f549ae516e7ff2f24a8a5134713411a4a58
Author: Roland McGrath <roland@redhat.com>
Date:   Tue Jan 4 05:38:15 2005 -0800

    [PATCH] fix ptracer death race yielding bogus BUG_ON
    
    There is a BUG_ON in ptrace_stop that hits if the thread is not ptraced.
    However, there is no synchronization between a thread deciding to do a
    ptrace stop and so going here, and its ptracer dying and so detaching from
    it and clearing its ->ptrace field.
    
    The RHEL3 2.4-based kernel has a backport of a slightly older version of
    the 2.6 signals code, which has a different but equivalent BUG_ON.  This
    actually bit users in practice (when the debugger dies), but was
    exceedingly difficult to reproduce in contrived circumstances.  We moved
    forward in RHEL3 just by removing the BUG_ON, and that fixed the real user
    problems even though I was never able to reproduce the scenario myself.
    So, to my knowledge this scenario has never actually been seen in practice
    under 2.6.  But it's plain to see from the code that it is indeed possible.
    
    This patch removes that BUG_ON, but also goes further and tries to handle
    this case more gracefully than simply avoiding the crash.  By removing the
    BUG_ON alone, it becomes possible for the real parent of a process to see
    spurious SIGCHLD notifications intended for the debugger that has just
    died, and have its child wind up stopped unexpectedly.  This patch avoids
    that possibility by detecting the case when we are about to do the ptrace
    stop but our ptracer has gone away, and simply eliding that ptrace stop
    altogether as if we hadn't been ptraced when we hit the interesting event
    (signal or ptrace_notify call for syscall tracing or something like that).
    
    Signed-off-by: Roland McGrath <roland@redhat.com>
    Signed-off-by: Andrew Morton <akpm@osdl.org>
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>

And it was all about
	BUG_ON(!(current->ptrace & PT_PTRACED));
At the beginning of ptrace_stop.

Which seems like a bit of buggy overkill.

>
> I will chew on that a bit and see if I can find any reasons for keeping
> the code in ptrace_stop at all.

Still chewing.

Eric

_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


WARNING: multiple messages have this Message-ID (diff)
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: linux-kernel@vger.kernel.org, rjw@rjwysocki.net,
	mingo@kernel.org, vincent.guittot@linaro.org,
	dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de,
	bigeasy@linutronix.de, Will Deacon <will@kernel.org>,
	tj@kernel.org, linux-pm@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-um@lists.infradead.org, Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>,
	linux-xtensa@linux-xtensa.org, Kees Cook <keescook@chromium.org>,
	Jann Horn <jannh@google.com>,
	linux-ia64@vger.kernel.org
Subject: Re: [PATCH v2 07/12] ptrace: Don't change __state
Date: Wed, 04 May 2022 18:28:56 +0000	[thread overview]
Message-ID: <87tua5b193.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <87h765ci7w.fsf@email.froward.int.ebiederm.org> (Eric W. Biederman's message of "Wed, 04 May 2022 12:37:07 -0500")

"Eric W. Biederman" <ebiederm@xmission.com> writes:

> Oleg Nesterov <oleg@redhat.com> writes:
>
>> On 05/03, Eric W. Biederman wrote:
>>>
>>> Oleg Nesterov <oleg@redhat.com> writes:
>>>
>>> > But why is it bad if the tracee doesn't sleep in schedule ? If it races
>>> > with SIGKILL. I still can't understand this.
>>> >
>>> > Yes, wait_task_inactive() can fail, so you need to remove WARN_ON_ONCE()
>>> > in 11/12.
>>>
>>> >
>>> > Why is removing TASK_WAKEKILL from TASK_TRACED and complicating
>>> > *signal_wake_up() better?
>>>
>>> Not changing __state is better because it removes special cases
>>> from the scheduler that only apply to ptrace.
>>
>> Hmm. But I didn't argue with that? I like the idea of JOBCTL_TASK_FROZEN.
>>
>> I meant, I do not think that removing KILLABLE from TASK_TRACED (not
>> from __state) and complicating *signal_wake_up() (I mean, compared
>> to your previous version) is a good idea.
>>
>> And. At least in context of this series it is fine if the JOBCTL_TASK_FROZEN
>> tracee do not block in schedule(), just you need to remove WARN_ON_ONCE()
>> around wait_task_inactive().
>>
>>> > And even if we need to ensure the tracee will always block after
>>> > ptrace_freeze_traced(), we can change signal_pending_state() to
>>> > return false if JOBCTL_PTRACE_FROZEN. Much simpler, imo. But still
>>> > looks unnecessary to me.
>>>
>>> We still need to change signal_wake_up in that case.  Possibly
>>> signal_wake_up_state.
>>
>> Of course. See above.
>>
>>> >> if we depend on wait_task_inactive failing if the process is in the
>>> >> wrong state.
>>> >
>>> > OK, I guess this is what I do not understand. Could you spell please?
>>> >
>>> > And speaking of RT, wait_task_inactive() still can fail because
>>> > cgroup_enter_frozen() takes css_set_lock? And it is called under
>>> > preempt_disable() ? I don't understand the plan :/
>>>
>>> Let me describe his freezer change as that is much easier to get to the
>>> final result.  RT has more problems as it turns all spin locks into
>>> sleeping locks.  When a task is frozen
>>
>> [...snip...]
>>
>> Oh, thanks Eric, but I understand this part. But I still can't understand
>> why is it that critical to block in schedule... OK, I need to think about
>> it. Lets assume this is really necessary.
>>
>> Anyway. I'd suggest to not change TASK_TRACED in this series and not
>> complicate signal_wake_up() more than you did in your previous version:
>>
>> 	static inline void signal_wake_up(struct task_struct *t, bool resume)
>> 	{
>> 		bool wakekill = resume && !(t->jobctl & JOBCTL_DELAY_WAKEKILL);
>> 		signal_wake_up_state(t, wakekill ? TASK_WAKEKILL : 0);
>> 	}
>
> If your concern is signal_wake_up there is no reason it can't be:
>
> 	static inline void signal_wake_up(struct task_struct *t, bool fatal)
>         {
>         	fatal = fatal && !(t->jobctl & JOBCTL_PTRACE_FROZEN);
>                 signal_wake_up_state(t, fatal ? TASK_WAKEKILL | TASK_TRACED : 0);
>         }
>
> I guess I was more targeted in this version, which lead to more if
> statements but as there is only one place in the code that can be
> JOBCTL_PTRACE_FROZEN and TASK_TRACED there is no point in setting
> TASK_WAKEKILL without also setting TASK_TRACED in the wake-up.
>
> So yes. I can make the code as simple as my earlier version of
> signal_wake_up.
>
>> JOBCTL_PTRACE_FROZEN is fine.
>>
>> ptrace_check_attach() can do
>>
>> 	if (!ret && !ignore_state &&
>> 	    /*
>> 	     * This can only fail if the frozen tracee races with
>> 	     * SIGKILL and enters schedule() with fatal_signal_pending
>> 	     */
>> 	    !wait_task_inactive(child, __TASK_TRACED))
>> 		ret = -ESRCH;
>>
>> 	return ret;
>>
>>
>> Now. If/when we really need to ensure that the frozen tracee always
>> blocks and wait_task_inactive() never fails, we can just do
>>
>> 	- add the fatal_signal_pending() check into ptrace_stop()
>> 	  (like this patch does)
>>
>> 	- say, change signal_pending_state:
>>
>> 	static inline int signal_pending_state(unsigned int state, struct task_struct *p)
>> 	{
>> 		if (!(state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL)))
>> 			return 0;
>> 		if (!signal_pending(p))
>> 			return 0;
>> 		if (p->jobctl & JOBCTL_TASK_FROZEN)
>> 			return 0;
>> 		return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
>> 	}
>>
>> in a separate patch which should carefully document the need for this
>> change.
>>
>>> > I didn't look at JOBCTL_PTRACE_SIGNR yet. But this looks minor to me,
>>> > I mean, I am not sure it worth the trouble.
>>>
>>> The immediate problem the JOBCTL_PTRACE_SIGNR patch solves is:
>>> - stopping in ptrace_report_syscall.
>>> - Not having PT_TRACESYSGOOD set.
>>> - The tracee being killed with a fatal signal
>>         ^^^^^^
>>         tracer ?
>
> Both actually.
>
>>> - The tracee sending SIGTRAP to itself.
>>
>> Oh, but this is clear. But do we really care? If the tracer exits
>> unexpectedly, the tracee can have a lot more problems, I don't think
>> that this particular one is that important.
>
> I don't know of complaints, and if you haven't heard them either
> that that is a good indication that in practice we don't care.
>
> At a practical level I just don't want that silly case that sets
> TASK_TRACED to TASK_RUNNING without stopping at all in ptrace_stop to
> remain.  It just seems to make everything more complicated for no real
> reason anymore.  The deadlocks may_ptrace_stop was guarding against are
> gone.
>
> Plus the test is so racy we case can happen after we drop siglock
> before we schedule, or shortly after we have stopped so we really
> don't reliably catch the condition the code is trying to catch.
>
> I think the case I care most about is ptrace_signal, which pretty much
> requires the tracer to wait and clear exit_code before being terminated
> to cause problems.  We don't handle that at all today.
>
> So yeah.  I think the code handles so little at this point we can just
> remove the code and simplify things, if we actually care we can come
> back and implement JOBCTL_PTRACE_SIGNR or the like.

The original explanation for handling this is:

commit 66519f549ae516e7ff2f24a8a5134713411a4a58
Author: Roland McGrath <roland@redhat.com>
Date:   Tue Jan 4 05:38:15 2005 -0800

    [PATCH] fix ptracer death race yielding bogus BUG_ON
    
    There is a BUG_ON in ptrace_stop that hits if the thread is not ptraced.
    However, there is no synchronization between a thread deciding to do a
    ptrace stop and so going here, and its ptracer dying and so detaching from
    it and clearing its ->ptrace field.
    
    The RHEL3 2.4-based kernel has a backport of a slightly older version of
    the 2.6 signals code, which has a different but equivalent BUG_ON.  This
    actually bit users in practice (when the debugger dies), but was
    exceedingly difficult to reproduce in contrived circumstances.  We moved
    forward in RHEL3 just by removing the BUG_ON, and that fixed the real user
    problems even though I was never able to reproduce the scenario myself.
    So, to my knowledge this scenario has never actually been seen in practice
    under 2.6.  But it's plain to see from the code that it is indeed possible.
    
    This patch removes that BUG_ON, but also goes further and tries to handle
    this case more gracefully than simply avoiding the crash.  By removing the
    BUG_ON alone, it becomes possible for the real parent of a process to see
    spurious SIGCHLD notifications intended for the debugger that has just
    died, and have its child wind up stopped unexpectedly.  This patch avoids
    that possibility by detecting the case when we are about to do the ptrace
    stop but our ptracer has gone away, and simply eliding that ptrace stop
    altogether as if we hadn't been ptraced when we hit the interesting event
    (signal or ptrace_notify call for syscall tracing or something like that).
    
    Signed-off-by: Roland McGrath <roland@redhat.com>
    Signed-off-by: Andrew Morton <akpm@osdl.org>
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>

And it was all about
	BUG_ON(!(current->ptrace & PT_PTRACED));
At the beginning of ptrace_stop.

Which seems like a bit of buggy overkill.

>
> I will chew on that a bit and see if I can find any reasons for keeping
> the code in ptrace_stop at all.

Still chewing.

Eric

  reply	other threads:[~2022-05-04 18:38 UTC|newest]

Thread overview: 572+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 15:02 [PATCH v2 0/5] ptrace-vs-PREEMPT_RT and freezer rewrite Peter Zijlstra
2022-04-21 15:02 ` [PATCH v2 1/5] sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state Peter Zijlstra
2022-04-26 23:34   ` Eric W. Biederman
2022-04-28 10:00     ` Peter Zijlstra
2022-04-21 15:02 ` [PATCH v2 2/5] sched,ptrace: Fix ptrace_check_attach() vs PREEMPT_RT Peter Zijlstra
2022-04-21 18:23   ` Oleg Nesterov
2022-04-21 19:58     ` Peter Zijlstra
2022-04-21 18:40   ` Eric W. Biederman
2022-04-26 22:50     ` [PATCH 0/9] ptrace: cleaning up ptrace_stop Eric W. Biederman
2022-04-26 22:50       ` Eric W. Biederman
2022-04-26 22:52       ` [PATCH 1/9] signal: Rename send_signal send_signal_locked Eric W. Biederman
2022-04-26 22:52         ` Eric W. Biederman
2022-04-28 10:27         ` Peter Zijlstra
2022-04-28 10:27           ` Peter Zijlstra
2022-04-26 22:52       ` [PATCH 2/9] signal: Replace __group_send_sig_info with send_signal_locked Eric W. Biederman
2022-04-26 22:52         ` Eric W. Biederman
2022-04-26 22:52       ` [PATCH 3/9] ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP Eric W. Biederman
2022-04-26 22:52         ` Eric W. Biederman
2022-04-27  7:10         ` Johannes Berg
2022-04-27  7:10           ` Johannes Berg
2022-04-27 13:50           ` Eric W. Biederman
2022-04-27 13:50             ` Eric W. Biederman
2022-04-26 22:52       ` [PATCH 4/9] ptrace/xtensa: Replace PT_SINGLESTEP " Eric W. Biederman
2022-04-26 22:52         ` Eric W. Biederman
2022-04-26 23:33         ` Max Filippov
2022-04-26 23:33           ` Max Filippov
2022-04-26 22:52       ` [PATCH 5/9] signal: Protect parent child relationships by childs siglock Eric W. Biederman
2022-04-26 22:52         ` Eric W. Biederman
2022-04-27  6:40         ` Sebastian Andrzej Siewior
2022-04-27  6:40           ` Sebastian Andrzej Siewior
2022-04-27 13:35           ` Eric W. Biederman
2022-04-27 13:35             ` Eric W. Biederman
2022-04-26 22:52       ` [PATCH 6/9] signal: Always call do_notify_parent_cldstop with siglock held Eric W. Biederman
2022-04-26 22:52         ` Eric W. Biederman
2022-04-27 14:10         ` Oleg Nesterov
2022-04-27 14:10           ` Oleg Nesterov
2022-04-27 14:20           ` Eric W. Biederman
2022-04-27 14:20             ` Eric W. Biederman
2022-04-27 14:43             ` Oleg Nesterov
2022-04-27 14:43               ` Oleg Nesterov
2022-04-27 14:47             ` Eric W. Biederman
2022-04-27 14:47               ` Eric W. Biederman
2022-04-28 17:44               ` Peter Zijlstra
2022-04-28 17:44                 ` Peter Zijlstra
2022-04-28 18:22                 ` Oleg Nesterov
2022-04-28 18:22                   ` Oleg Nesterov
2022-04-28 18:37                 ` Eric W. Biederman
2022-04-28 18:37                   ` Eric W. Biederman
2022-04-28 20:49                   ` Eric W. Biederman
2022-04-28 20:49                     ` Eric W. Biederman
2022-04-28 22:19                     ` Peter Zijlstra
2022-04-28 22:19                       ` Peter Zijlstra
2022-04-27 14:56         ` Oleg Nesterov
2022-04-27 14:56           ` Oleg Nesterov
2022-04-27 15:00           ` Oleg Nesterov
2022-04-27 15:00             ` Oleg Nesterov
2022-04-27 21:52             ` Eric W. Biederman
2022-04-27 21:52               ` Eric W. Biederman
2022-04-28 10:38         ` Peter Zijlstra
2022-04-28 10:38           ` Peter Zijlstra
2022-04-26 22:52       ` [PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach Eric W. Biederman
2022-04-26 22:52         ` Eric W. Biederman
2022-04-27 13:42         ` Eric W. Biederman
2022-04-27 13:42           ` Eric W. Biederman
2022-04-27 14:27           ` Eric W. Biederman
2022-04-27 14:27             ` Eric W. Biederman
2022-04-27 15:14         ` Oleg Nesterov
2022-04-27 15:14           ` Oleg Nesterov
2022-04-28 10:42           ` Peter Zijlstra
2022-04-28 10:42             ` Peter Zijlstra
2022-04-28 11:19             ` Oleg Nesterov
2022-04-28 11:19               ` Oleg Nesterov
2022-04-28 13:54               ` Peter Zijlstra
2022-04-28 13:54                 ` Peter Zijlstra
2022-04-28 14:57                 ` Oleg Nesterov
2022-04-28 14:57                   ` Oleg Nesterov
2022-04-28 16:09                   ` Peter Zijlstra
2022-04-28 16:09                     ` Peter Zijlstra
2022-04-28 16:19                     ` Oleg Nesterov
2022-04-28 16:19                       ` Oleg Nesterov
2022-04-26 22:52       ` [PATCH 8/9] ptrace: Use siglock instead of tasklist_lock " Eric W. Biederman
2022-04-26 22:52         ` Eric W. Biederman
2022-04-27 15:20         ` Oleg Nesterov
2022-04-27 15:20           ` Oleg Nesterov
2022-04-26 22:52       ` [PATCH 9/9] ptrace: Don't change __state Eric W. Biederman
2022-04-26 22:52         ` Eric W. Biederman
2022-04-27 15:41         ` Oleg Nesterov
2022-04-27 15:41           ` Oleg Nesterov
2022-04-27 22:35           ` Eric W. Biederman
2022-04-27 22:35             ` Eric W. Biederman
2022-04-27 16:09         ` Oleg Nesterov
2022-04-27 16:33           ` Eric W. Biederman
2022-04-27 17:18             ` Oleg Nesterov
2022-04-27 17:18               ` Oleg Nesterov
2022-04-27 17:21               ` Oleg Nesterov
2022-04-27 17:21                 ` Oleg Nesterov
2022-04-27 17:31                 ` Eric W. Biederman
2022-04-27 17:31                   ` Eric W. Biederman
2022-04-27 23:05         ` Eric W. Biederman
2022-04-27 23:05           ` Eric W. Biederman
2022-04-28 15:11           ` Oleg Nesterov
2022-04-28 15:11             ` Oleg Nesterov
2022-04-28 16:50             ` Eric W. Biederman
2022-04-28 16:50               ` Eric W. Biederman
2022-04-28 18:53               ` Oleg Nesterov
2022-04-28 18:53                 ` Oleg Nesterov
2022-04-28 10:07       ` [PATCH 0/9] ptrace: cleaning up ptrace_stop Peter Zijlstra
2022-04-28 10:07         ` Peter Zijlstra
2022-04-29 21:46       ` [PATCH 0/12] " Eric W. Biederman
2022-04-29 21:46         ` Eric W. Biederman
2022-04-29 21:46         ` Eric W. Biederman
2022-04-29 21:48         ` [PATCH v2 01/12] signal: Rename send_signal send_signal_locked Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-05-02  7:50           ` Sebastian Andrzej Siewior
2022-05-02  7:50             ` Sebastian Andrzej Siewior
2022-05-02  7:50             ` Sebastian Andrzej Siewior
2022-04-29 21:48         ` [PATCH v2 02/12] signal: Replace __group_send_sig_info with send_signal_locked Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-05-02  7:58           ` Sebastian Andrzej Siewior
2022-05-02  7:58             ` Sebastian Andrzej Siewior
2022-05-02  7:58             ` Sebastian Andrzej Siewior
2022-04-29 21:48         ` [PATCH v2 03/12] ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48         ` [PATCH v2 04/12] ptrace/xtensa: Replace PT_SINGLESTEP " Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48         ` [PATCH v2 05/12] signal: Use lockdep_assert_held instead of assert_spin_locked Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48         ` [PATCH v2 06/12] ptrace: Reimplement PTRACE_KILL by always sending SIGKILL Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-05-02 14:37           ` Oleg Nesterov
2022-05-02 14:37             ` Oleg Nesterov
2022-05-02 14:37             ` Oleg Nesterov
2022-05-03 19:36             ` Eric W. Biederman
2022-05-03 19:36               ` Eric W. Biederman
2022-05-03 19:36               ` Eric W. Biederman
2022-04-29 21:48         ` [PATCH v2 07/12] ptrace: Don't change __state Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 22:27           ` Peter Zijlstra
2022-04-29 22:27             ` Peter Zijlstra
2022-04-29 22:27             ` Peter Zijlstra
2022-05-02  8:59           ` Sebastian Andrzej Siewior
2022-05-02  8:59             ` Sebastian Andrzej Siewior
2022-05-02  8:59             ` Sebastian Andrzej Siewior
2022-05-02 15:39           ` Oleg Nesterov
2022-05-02 15:39             ` Oleg Nesterov
2022-05-02 15:39             ` Oleg Nesterov
2022-05-02 16:35             ` Eric W. Biederman
2022-05-02 16:35               ` Eric W. Biederman
2022-05-02 16:35               ` Eric W. Biederman
2022-05-03 13:41               ` Oleg Nesterov
2022-05-03 13:41                 ` Oleg Nesterov
2022-05-03 13:41                 ` Oleg Nesterov
2022-05-03 20:45                 ` Eric W. Biederman
2022-05-03 20:45                   ` Eric W. Biederman
2022-05-03 20:45                   ` Eric W. Biederman
2022-05-04 14:02                   ` Oleg Nesterov
2022-05-04 14:02                     ` Oleg Nesterov
2022-05-04 14:02                     ` Oleg Nesterov
2022-05-04 17:37                     ` Eric W. Biederman
2022-05-04 17:37                       ` Eric W. Biederman
2022-05-04 17:37                       ` Eric W. Biederman
2022-05-04 18:28                       ` Eric W. Biederman [this message]
2022-05-04 18:28                         ` Eric W. Biederman
2022-05-04 18:28                         ` Eric W. Biederman
2022-05-02 15:47           ` Oleg Nesterov
2022-05-02 15:47             ` Oleg Nesterov
2022-05-02 15:47             ` Oleg Nesterov
2022-04-29 21:48         ` [PATCH v2 08/12] ptrace: Remove arch_ptrace_attach Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48         ` [PATCH v2 09/12] ptrace: Always take siglock in ptrace_resume Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48         ` [PATCH v2 10/12] ptrace: Only return signr from ptrace_stop if it was provided Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-05-02 10:08           ` Sebastian Andrzej Siewior
2022-05-02 10:08             ` Sebastian Andrzej Siewior
2022-05-02 10:08             ` Sebastian Andrzej Siewior
2022-04-29 21:48         ` [PATCH v2 11/12] ptrace: Always call schedule in ptrace_stop Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48         ` [PATCH v2 12/12] sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state Eric W. Biederman
2022-04-29 21:48           ` Eric W. Biederman
2022-04-29 21:48           ` [PATCH v2 12/12] sched, signal, ptrace: " Eric W. Biederman
2022-05-02 10:18           ` [PATCH v2 12/12] sched,signal,ptrace: " Sebastian Andrzej Siewior
2022-05-02 10:18             ` Sebastian Andrzej Siewior
2022-05-02 10:18             ` Sebastian Andrzej Siewior
2022-05-02 13:38         ` [PATCH 0/12] ptrace: cleaning up ptrace_stop Sebastian Andrzej Siewior
2022-05-02 13:38           ` Sebastian Andrzej Siewior
2022-05-02 13:38           ` Sebastian Andrzej Siewior
2022-05-04 22:39         ` [PATCH v3 0/11] " Eric W. Biederman
2022-05-04 22:39           ` Eric W. Biederman
2022-05-04 22:39           ` Eric W. Biederman
2022-05-04 22:40           ` [PATCH v3 01/11] signal: Rename send_signal send_signal_locked Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40           ` [PATCH v3 02/11] signal: Replace __group_send_sig_info with send_signal_locked Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40           ` [PATCH v3 03/11] ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40           ` [PATCH v3 04/11] ptrace/xtensa: Replace PT_SINGLESTEP " Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40           ` [PATCH v3 05/11] ptrace: Remove arch_ptrace_attach Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40           ` [PATCH v3 06/11] signal: Use lockdep_assert_held instead of assert_spin_locked Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40           ` [PATCH v3 07/11] ptrace: Reimplement PTRACE_KILL by always sending SIGKILL Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40           ` [PATCH v3 08/11] ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-05 14:57             ` Oleg Nesterov
2022-05-05 14:57               ` Oleg Nesterov
2022-05-05 14:57               ` Oleg Nesterov
2022-05-05 16:59               ` Eric W. Biederman
2022-05-05 16:59                 ` Eric W. Biederman
2022-05-05 16:59                 ` Eric W. Biederman
2022-05-05 15:01             ` Oleg Nesterov
2022-05-05 15:01               ` Oleg Nesterov
2022-05-05 15:01               ` Oleg Nesterov
2022-05-05 17:21               ` Eric W. Biederman
2022-05-05 17:21                 ` Eric W. Biederman
2022-05-05 17:21                 ` Eric W. Biederman
2022-05-05 17:27                 ` Oleg Nesterov
2022-05-05 17:27                   ` Oleg Nesterov
2022-05-05 17:27                   ` Oleg Nesterov
2022-05-05 15:28             ` Oleg Nesterov
2022-05-05 15:28               ` Oleg Nesterov
2022-05-05 15:28               ` Oleg Nesterov
2022-05-05 17:53               ` Eric W. Biederman
2022-05-05 17:53                 ` Eric W. Biederman
2022-05-05 17:53                 ` Eric W. Biederman
2022-05-05 18:10                 ` Oleg Nesterov
2022-05-05 18:10                   ` Oleg Nesterov
2022-05-05 18:10                   ` Oleg Nesterov
2022-05-04 22:40           ` [PATCH v3 09/11] ptrace: Don't change __state Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-05 12:50             ` Sebastian Andrzej Siewior
2022-05-05 12:50               ` Sebastian Andrzej Siewior
2022-05-05 12:50               ` Sebastian Andrzej Siewior
2022-05-05 16:48               ` Eric W. Biederman
2022-05-05 16:48                 ` Eric W. Biederman
2022-05-05 16:48                 ` Eric W. Biederman
2022-05-04 22:40           ` [PATCH v3 10/11] ptrace: Always take siglock in ptrace_resume Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40           ` [PATCH v3 11/11] sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state Eric W. Biederman
2022-05-04 22:40             ` Eric W. Biederman
2022-05-04 22:40             ` [PATCH v3 11/11] sched, signal, ptrace: " Eric W. Biederman
2022-05-05 18:25           ` [PATCH v4 0/12] ptrace: cleaning up ptrace_stop Eric W. Biederman
2022-05-05 18:25             ` Eric W. Biederman
2022-05-05 18:25             ` Eric W. Biederman
2022-05-05 18:26             ` [PATCH v4 01/12] signal: Rename send_signal send_signal_locked Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26             ` [PATCH v4 02/12] signal: Replace __group_send_sig_info with send_signal_locked Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26             ` [PATCH v4 03/12] ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26             ` [PATCH v4 04/12] ptrace/xtensa: Replace PT_SINGLESTEP " Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26             ` [PATCH v4 05/12] ptrace: Remove arch_ptrace_attach Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26             ` [PATCH v4 06/12] signal: Use lockdep_assert_held instead of assert_spin_locked Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26             ` [PATCH v4 07/12] ptrace: Reimplement PTRACE_KILL by always sending SIGKILL Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26             ` [PATCH v4 08/12] ptrace: Document that wait_task_inactive can't fail Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-06  6:55               ` Sebastian Andrzej Siewior
2022-05-06  6:55                 ` Sebastian Andrzej Siewior
2022-05-06  6:55                 ` Sebastian Andrzej Siewior
2022-05-05 18:26             ` [PATCH v4 09/12] ptrace: Admit ptrace_stop can generate spuriuos SIGTRAPs Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26             ` [PATCH v4 10/12] ptrace: Don't change __state Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-06 15:09               ` Oleg Nesterov
2022-05-06 15:09                 ` Oleg Nesterov
2022-05-06 15:09                 ` Oleg Nesterov
2022-05-06 19:42                 ` Eric W. Biederman
2022-05-06 19:42                   ` Eric W. Biederman
2022-05-06 19:42                   ` Eric W. Biederman
2022-05-10 14:23               ` Oleg Nesterov
2022-05-10 14:23                 ` Oleg Nesterov
2022-05-10 14:23                 ` Oleg Nesterov
2022-05-10 15:17                 ` Eric W. Biederman
2022-05-10 15:17                   ` Eric W. Biederman
2022-05-10 15:17                   ` Eric W. Biederman
2022-05-10 15:34                   ` Oleg Nesterov
2022-05-10 15:34                     ` Oleg Nesterov
2022-05-10 15:34                     ` Oleg Nesterov
2022-05-05 18:26             ` [PATCH v4 11/12] ptrace: Always take siglock in ptrace_resume Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26             ` [PATCH v4 12/12] sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state Eric W. Biederman
2022-05-05 18:26               ` Eric W. Biederman
2022-05-05 18:26               ` [PATCH v4 12/12] sched, signal, ptrace: " Eric W. Biederman
2022-06-21 13:00               ` [PATCH v4 12/12] sched,signal,ptrace: " Alexander Gordeev
2022-06-21 13:00                 ` Alexander Gordeev
2022-06-21 13:00                 ` Alexander Gordeev
2022-06-21 14:02                 ` Eric W. Biederman
2022-06-21 14:02                   ` Eric W. Biederman
2022-06-21 15:15                   ` Alexander Gordeev
2022-06-21 15:15                     ` Alexander Gordeev
2022-06-21 15:15                     ` Alexander Gordeev
2022-06-21 17:47                     ` Eric W. Biederman
2022-06-21 17:47                       ` Eric W. Biederman
2022-06-21 17:47                       ` Eric W. Biederman
2022-06-25 16:34                     ` Eric W. Biederman
2022-06-25 16:34                       ` Eric W. Biederman
2022-06-25 16:34                       ` Eric W. Biederman
2022-06-28 18:36                       ` Alexander Gordeev
2022-06-28 18:36                         ` Alexander Gordeev
2022-06-28 18:36                         ` Alexander Gordeev
2022-06-28 22:42                         ` Eric W. Biederman
2022-06-28 22:42                           ` Eric W. Biederman
2022-06-28 22:48                           ` Steven Rostedt
2022-06-28 22:48                             ` Steven Rostedt
2022-06-29  3:39                             ` Eric W. Biederman
2022-06-29  3:39                               ` Eric W. Biederman
2022-06-29  3:39                               ` Eric W. Biederman
2022-06-29 20:25                               ` Alexander Gordeev
2022-06-29 20:25                                 ` Alexander Gordeev
2022-06-29 20:25                                 ` Alexander Gordeev
2022-07-05 15:44                               ` Peter Zijlstra
2022-07-05 15:44                                 ` Peter Zijlstra
2022-07-05 15:44                                 ` Peter Zijlstra
2022-07-06  6:56                                 ` Alexander Gordeev
2022-07-06  6:56                                   ` Alexander Gordeev
2022-07-06  6:56                                   ` Alexander Gordeev
2022-06-28 23:15                     ` Steven Rostedt
2022-06-28 23:15                       ` Steven Rostedt
2022-06-28 23:15                       ` Steven Rostedt
2022-07-05 13:47                       ` Sven Schnelle
2022-07-05 13:47                         ` Sven Schnelle
2022-07-05 13:47                         ` Sven Schnelle
2022-07-05 17:28                         ` Sven Schnelle
2022-07-05 17:28                           ` Sven Schnelle
2022-07-05 17:28                           ` Sven Schnelle
2022-07-05 19:25                           ` Peter Zijlstra
2022-07-05 19:25                             ` Peter Zijlstra
2022-07-05 19:25                             ` Peter Zijlstra
2022-07-06  7:58                             ` Sven Schnelle
2022-07-06  7:58                               ` Sven Schnelle
2022-07-06  7:58                               ` Sven Schnelle
2022-07-06  8:59                               ` Peter Zijlstra
2022-07-06  8:59                                 ` Peter Zijlstra
2022-07-06  8:59                                 ` Peter Zijlstra
2022-07-06  9:27                                 ` Sven Schnelle
2022-07-06  9:27                                   ` Sven Schnelle
2022-07-06  9:27                                   ` Sven Schnelle
2022-07-06 10:11                                   ` Peter Zijlstra
2022-07-06 10:11                                     ` Peter Zijlstra
2022-05-06 14:14             ` [PATCH v4 0/12] ptrace: cleaning up ptrace_stop Oleg Nesterov
2022-05-06 14:14               ` Oleg Nesterov
2022-05-06 14:14               ` Oleg Nesterov
2022-05-06 14:38               ` Eric W. Biederman
2022-05-06 14:38                 ` Eric W. Biederman
2022-05-06 14:38                 ` Eric W. Biederman
2022-05-06 21:26             ` Kees Cook
2022-05-06 21:26               ` Kees Cook
2022-05-06 21:59               ` Eric W. Biederman
2022-05-06 21:59                 ` Eric W. Biederman
2022-05-06 21:59                 ` Eric W. Biederman
2022-05-10 14:11             ` Oleg Nesterov
2022-05-10 14:11               ` Oleg Nesterov
2022-05-10 14:11               ` Oleg Nesterov
2022-05-10 14:26               ` Eric W. Biederman
2022-05-10 14:26                 ` Eric W. Biederman
2022-05-10 14:26                 ` Eric W. Biederman
2022-05-10 14:45                 ` Sebastian Andrzej Siewior
2022-05-10 14:45                   ` Sebastian Andrzej Siewior
2022-05-10 14:45                   ` Sebastian Andrzej Siewior
2022-05-10 15:18                   ` Eric W. Biederman
2022-05-10 15:18                     ` Eric W. Biederman
2022-05-10 15:18                     ` Eric W. Biederman
2022-05-11 20:00                 ` Eric W. Biederman
2022-05-11 20:00                   ` Eric W. Biederman
2022-05-11 20:00                   ` Eric W. Biederman
2022-05-18 22:49             ` [PATCH 00/16] ptrace: cleanups and calling do_cldstop with only siglock Eric W. Biederman
2022-05-18 22:49               ` Eric W. Biederman
2022-05-18 22:49               ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 01/16] signal/alpha: Remove unused definition of TASK_REAL_PARENT Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 02/16] signal/ia64: Remove unused definition of IA64_TASK_REAL_PARENT_OFFSET Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 03/16] kdb: Use real_parent when displaying a list of processes Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-19  7:56                 ` Peter Zijlstra
2022-05-19  7:56                   ` Peter Zijlstra
2022-05-19  7:56                   ` Peter Zijlstra
2022-05-19 18:06                   ` Eric W. Biederman
2022-05-19 18:06                     ` Eric W. Biederman
2022-05-19 18:06                     ` Eric W. Biederman
2022-05-19 20:52                 ` Doug Anderson
2022-05-19 20:52                   ` Doug Anderson
2022-05-19 20:52                   ` Doug Anderson
2022-05-19 23:48                   ` Eric W. Biederman
2022-05-19 23:48                     ` Eric W. Biederman
2022-05-19 23:48                     ` Eric W. Biederman
2022-05-20 23:01                     ` Doug Anderson
2022-05-20 23:01                       ` Doug Anderson
2022-05-20 23:01                       ` Doug Anderson
2022-05-18 22:53               ` [PATCH 04/16] powerpc/xmon: " Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 05/16] ptrace: Remove dead code from __ptrace_detach Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-24 11:42                 ` Oleg Nesterov
2022-05-24 11:42                   ` Oleg Nesterov
2022-05-24 11:42                   ` Oleg Nesterov
2022-05-25 14:33                   ` Oleg Nesterov
2022-05-25 14:33                     ` Oleg Nesterov
2022-05-25 14:33                     ` Oleg Nesterov
2022-06-06 16:06                     ` Eric W. Biederman
2022-06-06 16:06                       ` Eric W. Biederman
2022-06-06 16:06                       ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 06/16] ptrace: Remove unnecessary locking in ptrace_(get|set)siginfo Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-24 13:25                 ` Oleg Nesterov
2022-05-24 13:25                   ` Oleg Nesterov
2022-05-24 13:25                   ` Oleg Nesterov
2022-05-18 22:53               ` [PATCH 07/16] signal: Wake up the designated parent Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-24 13:25                 ` Oleg Nesterov
2022-05-24 13:25                   ` Oleg Nesterov
2022-05-24 13:25                   ` Oleg Nesterov
2022-05-24 16:28                   ` Oleg Nesterov
2022-05-24 16:28                     ` Oleg Nesterov
2022-05-24 16:28                     ` Oleg Nesterov
2022-05-25 14:28                     ` Oleg Nesterov
2022-05-25 14:28                       ` Oleg Nesterov
2022-05-25 14:28                       ` Oleg Nesterov
2022-06-06 22:10                       ` Eric W. Biederman
2022-06-06 22:10                         ` Eric W. Biederman
2022-06-06 22:10                         ` Eric W. Biederman
2022-06-07 15:26                         ` Oleg Nesterov
2022-06-07 15:26                           ` Oleg Nesterov
2022-06-07 15:26                           ` Oleg Nesterov
2022-05-18 22:53               ` [PATCH 08/16] ptrace: Only populate last_siginfo from ptrace Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-24 15:27                 ` Oleg Nesterov
2022-05-24 15:27                   ` Oleg Nesterov
2022-05-24 15:27                   ` Oleg Nesterov
2022-06-06 22:16                   ` Eric W. Biederman
2022-06-06 22:16                     ` Eric W. Biederman
2022-06-06 22:16                     ` Eric W. Biederman
2022-06-07 15:29                     ` Oleg Nesterov
2022-06-07 15:29                       ` Oleg Nesterov
2022-06-07 15:29                       ` Oleg Nesterov
2022-05-18 22:53               ` [PATCH 09/16] ptrace: In ptrace_setsiginfo deal with invalid si_signo Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 10/16] ptrace: In ptrace_signal look at what the debugger did with siginfo Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 11/16] ptrace: Use si_sino as the signal number to resume with Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 12/16] ptrace: Stop protecting ptrace_set_signr with tasklist_lock Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 13/16] ptrace: Document why ptrace_setoptions does not need a lock Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 14/16] signal: Protect parent child relationships by childs siglock Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 15/16] ptrace: Use siglock instead of tasklist_lock in ptrace_check_attach Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53               ` [PATCH 16/16] signal: Always call do_notify_parent_cldstop with siglock held Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-18 22:53                 ` Eric W. Biederman
2022-05-20 16:19                 ` kernel test robot
2022-05-20 16:19                   ` kernel test robot
2022-05-20 16:19                   ` kernel test robot
     [not found]               ` <CALWUPBdFDLuT7JaNGSJ_UXbHf8y9uKdC-SkAqzd=FQC0MX4nNQ@mail.gmail.com>
2022-05-19  6:19                 ` [PATCH 00/16] ptrace: cleanups and calling do_cldstop with only siglock Sebastian Andrzej Siewior
2022-05-19  6:19                   ` Sebastian Andrzej Siewior
2022-05-19  6:19                   ` Sebastian Andrzej Siewior
2022-05-19 18:05                   ` Eric W. Biederman
2022-05-19 18:05                     ` Eric W. Biederman
2022-05-19 18:05                     ` Eric W. Biederman
2022-05-20  5:24                     ` Kyle Huey
2022-05-20  5:24                       ` Kyle Huey
2022-05-20  5:24                       ` Kyle Huey
2022-06-06 16:12                       ` Eric W. Biederman
2022-06-06 16:12                         ` Eric W. Biederman
2022-06-09 19:59                         ` Kyle Huey
2022-06-09 19:59                           ` Kyle Huey
2022-06-09 19:59                           ` Kyle Huey
2022-05-20  7:33               ` Sebastian Andrzej Siewior
2022-05-20  7:33                 ` Sebastian Andrzej Siewior
2022-05-20  7:33                 ` Sebastian Andrzej Siewior
2022-05-20 19:32                 ` Eric W. Biederman
2022-05-20 19:32                   ` Eric W. Biederman
2022-05-20 19:32                   ` Eric W. Biederman
2022-05-20 19:58                   ` Peter Zijlstra
2022-05-20 19:58                     ` Peter Zijlstra
2022-05-20 19:58                     ` Peter Zijlstra
2022-05-20  9:19               ` Sebastian Andrzej Siewior
2022-05-20  9:19                 ` Sebastian Andrzej Siewior
2022-05-20  9:19                 ` Sebastian Andrzej Siewior
2022-06-22 16:43             ` [PATCH 0/3] ptrace: Stop supporting SIGKILL for PTRACE_EVENT_EXIT Eric W. Biederman
2022-06-22 16:45               ` [PATCH 1/3] signal: Ensure SIGNAL_GROUP_EXIT gets set in do_group_exit Eric W. Biederman
2022-06-22 16:46               ` [PATCH 2/3] signal: Guarantee that SIGNAL_GROUP_EXIT is set on process exit Eric W. Biederman
2022-06-23  7:49                 ` kernel test robot
2022-06-22 16:47               ` [PATCH 3/3] signal: Drop signals received after a fatal signal has been processed Eric W. Biederman
2022-06-23 15:12               ` [PATCH 0/3] ptrace: Stop supporting SIGKILL for PTRACE_EVENT_EXIT Alexander Gordeev
2022-06-23 21:55                 ` Eric W. Biederman
2022-07-08 22:25               ` Eric W. Biederman
2022-07-08 23:22                 ` Keno Fischer
2022-07-12 20:03                   ` Eric W. Biederman
2022-07-16 21:29                     ` Eric W. Biederman
2022-07-16 23:21                       ` Kyle Huey
2022-04-25 14:35   ` [PATCH v2 2/5] sched,ptrace: Fix ptrace_check_attach() vs PREEMPT_RT Oleg Nesterov
2022-04-25 18:33     ` Peter Zijlstra
2022-04-26  0:38       ` Eric W. Biederman
2022-04-26  5:51         ` Oleg Nesterov
2022-04-26 17:19           ` Eric W. Biederman
2022-04-26 18:11             ` Oleg Nesterov
2022-04-25 17:47   ` Oleg Nesterov
2022-04-27  0:24     ` Eric W. Biederman
2022-04-28 20:29       ` Peter Zijlstra
2022-04-28 20:59         ` Oleg Nesterov
2022-04-28 22:21           ` Peter Zijlstra
2022-04-28 22:50             ` Oleg Nesterov
2022-04-27 15:53   ` Oleg Nesterov
2022-04-27 21:57     ` Eric W. Biederman
2022-04-21 15:02 ` [PATCH v2 3/5] freezer: Have {,un}lock_system_sleep() save/restore flags Peter Zijlstra
2022-04-21 15:02 ` [PATCH v2 4/5] freezer,umh: Clean up freezer/initrd interaction Peter Zijlstra
2022-04-21 15:02 ` [PATCH v2 5/5] freezer,sched: Rewrite core freezer logic Peter Zijlstra
2022-04-21 17:26   ` Eric W. Biederman
2022-04-21 17:57     ` Oleg Nesterov
2022-04-21 19:55     ` Peter Zijlstra
2022-04-21 20:07       ` Peter Zijlstra
2022-04-22 15:52         ` Eric W. Biederman
2022-04-22 17:43 ` [PATCH v2 0/5] ptrace-vs-PREEMPT_RT and freezer rewrite Sebastian Andrzej Siewior
2022-04-22 19:15   ` Eric W. Biederman
2022-04-22 21:13     ` Sebastian Andrzej Siewior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tua5b193.fsf@email.froward.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=bigeasy@linutronix.de \
    --cc=chris@zankel.net \
    --cc=dietmar.eggemann@arm.com \
    --cc=jannh@google.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=keescook@chromium.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=richard@nod.at \
    --cc=rjw@rjwysocki.net \
    --cc=rostedt@goodmis.org \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.