mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] signal: Update send_signal_locked in relevant comments
@ 2025-04-11 10:24 jiang.kun2
  2025-04-11 11:17 ` Oleg Nesterov
  0 siblings, 1 reply; 2+ messages in thread
From: jiang.kun2 @ 2025-04-11 10:24 UTC (permalink / raw)
  To: tglx, frederic, peterz, oleg, brauner, joel.granados, viro,
	lorenzo.stoakes, linux-kernel
  Cc: fan.yu9

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

The __send_signal has been renamed to __send_signal_locked,
after the following commit:

'commit 157cc18122b4 ("signal: Rename send_signal send_signal_locked")'

But some comments have not been modified along with the
code, so they need to be updated. This will help readers
better understand the code.

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

diff --git a/kernel/signal.c b/kernel/signal.c
index 148082db9a55..af5f8bb50491 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2252,7 +2252,7 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
 			sig = 0;
 	}
 	/*
-	 * Send with __send_signal as si_pid and si_uid are in the
+	 * Send with __send_signal_locked as si_pid and si_uid are in the
 	 * parent's namespaces.
 	 */
 	if (valid_signal(sig) && sig)
-- 
2.25.1

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

* Re: [PATCH] signal: Update send_signal_locked in relevant comments
  2025-04-11 10:24 [PATCH] signal: Update send_signal_locked in relevant comments jiang.kun2
@ 2025-04-11 11:17 ` Oleg Nesterov
  0 siblings, 0 replies; 2+ messages in thread
From: Oleg Nesterov @ 2025-04-11 11:17 UTC (permalink / raw)
  To: jiang.kun2, Eric W. Biederman
  Cc: tglx, frederic, peterz, brauner, joel.granados, viro,
	lorenzo.stoakes, linux-kernel, fan.yu9

On 04/11, jiang.kun2@zte.com.cn wrote:
>
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -2252,7 +2252,7 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
>  			sig = 0;
>  	}
>  	/*
> -	 * Send with __send_signal as si_pid and si_uid are in the
> +	 * Send with __send_signal_locked as si_pid and si_uid are in the
>  	 * parent's namespaces.

Thanks, but I think that today this comment looks confusing either way.
It was added by 61e713bdca3678 along with this

	-               __group_send_sig_info(sig, &info, tsk->parent);
	+               __send_signal(sig, &info, tsk->parent, PIDTYPE_TGID, false);

change.

To me this comment looks outdated, perhaps it would be better to simply
remove it?

Or it should be updated to explain that we use __send_signal_locked()
instead of send_signal_locked() because the latter can wrongly change
si_pid/si_uid...

Oleg.


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

end of thread, other threads:[~2025-04-11 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-11 10:24 [PATCH] signal: Update send_signal_locked in relevant comments jiang.kun2
2025-04-11 11:17 ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®