All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] signal: Remove outdated __send_signal references in  do_notify_parent
@ 2025-07-28  8:24 fan.yu9
  2025-07-28  9:54 ` [PATCH linux-next] signal: Remove outdated __send_signal references in? do_notify_parent Oleg Nesterov
  2025-07-28 14:58 ` [PATCH linux-next] signal: Remove outdated __send_signal references in do_notify_parent Thomas Gleixner
  0 siblings, 2 replies; 5+ messages in thread
From: fan.yu9 @ 2025-07-28  8:24 UTC (permalink / raw)
  To: tglx, frederic, peterz, oleg, brauner, iro, joel.granados,
	lorenzo.stoakes
  Cc: linux-kernel, xu.xin16, yang.yang29

From: Fan Yu <fan.yu9@zte.com.cn>

The function __send_signal was renamed to __send_signal_locked in
commit 157cc18122b4 ("signal: Rename send_signal send_signal_locked"),
making the existing comments in do_notify_parent obsolete.

This patch removes these outdated references to maintain code clarity
and prevent confusion about the current implementation.

Signed-off-by: Fan Yu <fan.yu9@zte.com.cn>
---
 kernel/signal.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index e2c928de7d2c..30a52d884f87 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2251,10 +2251,7 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
 		if (psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN)
 			sig = 0;
 	}
-	/*
-	 * Send with __send_signal as si_pid and si_uid are in the
-	 * parent's namespaces.
-	 */
+
 	if (valid_signal(sig) && sig)
 		__send_signal_locked(sig, &info, tsk->parent, PIDTYPE_TGID, false);
 	__wake_up_parent(tsk, tsk->parent);
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH linux-next] signal: Remove outdated __send_signal references in? do_notify_parent
  2025-07-28  8:24 [PATCH linux-next] signal: Remove outdated __send_signal references in do_notify_parent fan.yu9
@ 2025-07-28  9:54 ` Oleg Nesterov
  2025-07-28 14:58 ` [PATCH linux-next] signal: Remove outdated __send_signal references in do_notify_parent Thomas Gleixner
  1 sibling, 0 replies; 5+ messages in thread
From: Oleg Nesterov @ 2025-07-28  9:54 UTC (permalink / raw)
  To: fan.yu9, Andrew Morton
  Cc: tglx, frederic, peterz, brauner, iro, joel.granados,
	lorenzo.stoakes, linux-kernel, xu.xin16, yang.yang29

On 07/28, fan.yu9@zte.com.cn wrote:
>
> From: Fan Yu <fan.yu9@zte.com.cn>
>
> The function __send_signal was renamed to __send_signal_locked in
> commit 157cc18122b4 ("signal: Rename send_signal send_signal_locked"),
> making the existing comments in do_notify_parent obsolete.
>
> This patch removes these outdated references to maintain code clarity
> and prevent confusion about the current implementation.
>
> Signed-off-by: Fan Yu <fan.yu9@zte.com.cn>
> ---
>  kernel/signal.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/kernel/signal.c b/kernel/signal.c
> index e2c928de7d2c..30a52d884f87 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -2251,10 +2251,7 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
>  		if (psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN)
>  			sig = 0;
>  	}
> -	/*
> -	 * Send with __send_signal as si_pid and si_uid are in the
> -	 * parent's namespaces.
> -	 */
> +
>  	if (valid_signal(sig) && sig)
>  		__send_signal_locked(sig, &info, tsk->parent, PIDTYPE_TGID, false);
>  	__wake_up_parent(tsk, tsk->parent);

Acked-by: Oleg Nesterov <oleg@redhat.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH linux-next] signal: Remove outdated __send_signal references in  do_notify_parent
  2025-07-28  8:24 [PATCH linux-next] signal: Remove outdated __send_signal references in do_notify_parent fan.yu9
  2025-07-28  9:54 ` [PATCH linux-next] signal: Remove outdated __send_signal references in? do_notify_parent Oleg Nesterov
@ 2025-07-28 14:58 ` Thomas Gleixner
  2025-07-28 15:58   ` Oleg Nesterov
  2025-07-29  7:04   ` fan.yu9
  1 sibling, 2 replies; 5+ messages in thread
From: Thomas Gleixner @ 2025-07-28 14:58 UTC (permalink / raw)
  To: fan.yu9, frederic, peterz, oleg, brauner, iro, joel.granados,
	lorenzo.stoakes
  Cc: linux-kernel, xu.xin16, yang.yang29

On Mon, Jul 28 2025 at 16:24, fan wrote:
> From: Fan Yu <fan.yu9@zte.com.cn>
>
> The function __send_signal was renamed to __send_signal_locked in

Just use __send_signal() and __send_signal_locked() which makes it
entirely clear that this is about functions, so you can spare 'The
function'. Same for the subject.

> commit 157cc18122b4 ("signal: Rename send_signal send_signal_locked"),
> making the existing comments in do_notify_parent obsolete.
>
> This patch removes these outdated references to maintain code clarity

# git grep 'This patch' Documentation/process/

> and prevent confusion about the current implementation.
>
> Signed-off-by: Fan Yu <fan.yu9@zte.com.cn>
> ---
>  kernel/signal.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/kernel/signal.c b/kernel/signal.c
> index e2c928de7d2c..30a52d884f87 100644
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -2251,10 +2251,7 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
>  		if (psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN)
>  			sig = 0;
>  	}
> -	/*
> -	 * Send with __send_signal as si_pid and si_uid are in the
> -	 * parent's namespaces.
> -	 */
> +

Why are you removing the complete comment instead of just renaming the
stale reference? 

commit 61e713bdca36 ("signal: Avoid corrupting si_pid and si_uid in
do_notify_parent") put that comment there for a reason.

Thanks

        tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH linux-next] signal: Remove outdated __send_signal references in  do_notify_parent
  2025-07-28 14:58 ` [PATCH linux-next] signal: Remove outdated __send_signal references in do_notify_parent Thomas Gleixner
@ 2025-07-28 15:58   ` Oleg Nesterov
  2025-07-29  7:04   ` fan.yu9
  1 sibling, 0 replies; 5+ messages in thread
From: Oleg Nesterov @ 2025-07-28 15:58 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: fan.yu9, frederic, peterz, brauner, iro, joel.granados,
	lorenzo.stoakes, linux-kernel, xu.xin16, yang.yang29

On 07/28, Thomas Gleixner wrote:
>
> > --- a/kernel/signal.c
> > +++ b/kernel/signal.c
> > @@ -2251,10 +2251,7 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
> >  		if (psig->action[SIGCHLD-1].sa.sa_handler == SIG_IGN)
> >  			sig = 0;
> >  	}
> > -	/*
> > -	 * Send with __send_signal as si_pid and si_uid are in the
> > -	 * parent's namespaces.
> > -	 */
> > +
>
> Why are you removing the complete comment instead of just renaming the
> stale reference?

Then the comment should be updated to explain that we have to use
__send_signal_locked(), not send_signal_locked(), because the latter
can wrongly change si_pid/si_uid which are in the parent's namespace.

> commit 61e713bdca36 ("signal: Avoid corrupting si_pid and si_uid in
> do_notify_parent") put that comment there for a reason.

Yes, but the comment was a bit confusing, imo. I don't think it makes
the code more clear.

But I am fine either way.

Oleg.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH linux-next] signal: Remove outdated __send_signal references in  do_notify_parent
  2025-07-28 14:58 ` [PATCH linux-next] signal: Remove outdated __send_signal references in do_notify_parent Thomas Gleixner
  2025-07-28 15:58   ` Oleg Nesterov
@ 2025-07-29  7:04   ` fan.yu9
  1 sibling, 0 replies; 5+ messages in thread
From: fan.yu9 @ 2025-07-29  7:04 UTC (permalink / raw)
  To: tglx
  Cc: frederic, peterz, oleg, brauner, iro, joel.granados,
	lorenzo.stoakes, linux-kernel, xu.xin16, yang.yang29

> > From: Fan Yu <fan.yu9@zte.com.cn>
> >
> > The function __send_signal was renamed to __send_signal_locked in
> 
> Just use __send_signal() and __send_signal_locked() which makes it
> entirely clear that this is about functions, so you can spare 'The
> function'. Same for the subject.

I'll use __send_signal() and __send_signal_locked() directly (removing “The function”).

> > commit 157cc18122b4 ("signal: Rename send_signal send_signal_locked"),
> > making the existing comments in do_notify_parent obsolete.
> >
> > This patch removes these outdated references to maintain code clarity
> 
> # git grep 'This patch' Documentation/process/

I'll fix it to avoid “This patch”.

> > -   /*
> > -    * Send with __send_signal as si_pid and si_uid are in the
> > -    * parent's namespaces.
> > -    */
> > +
> 
> Why are you removing the complete comment instead of just renaming the
> stale reference? 
> 
> commit 61e713bdca36 ("signal: Avoid corrupting si_pid and si_uid in
> do_notify_parent") put that comment there for a reason.

Hi tglx,

Thanks for the feedback! I agree that the patch description could be
clearer, and simply removing the comment without updating it was not
the best approach.

The comment exists for a reason, I'll clarify why __send_signal_locked
must be used and improve the description to be more precise.

Best regards,
Fan Yu

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-29  7:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-28  8:24 [PATCH linux-next] signal: Remove outdated __send_signal references in do_notify_parent fan.yu9
2025-07-28  9:54 ` [PATCH linux-next] signal: Remove outdated __send_signal references in? do_notify_parent Oleg Nesterov
2025-07-28 14:58 ` [PATCH linux-next] signal: Remove outdated __send_signal references in do_notify_parent Thomas Gleixner
2025-07-28 15:58   ` Oleg Nesterov
2025-07-29  7:04   ` fan.yu9

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.