lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240223141928.GB8267@redhat.com>
Date: Fri, 23 Feb 2024 15:19:29 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Wen Yang <wenyang.linux@...mail.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Christian Brauner <brauner@...nel.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] get_signal: simplify/cleanup the the usage of ksig->info

On 02/23, Wen Yang wrote:
>
>
> On 2024/2/23 18:50, Oleg Nesterov wrote:
> >get_signal() uses signr or ksig->info.si_signo in a chaotic way, this
> >looks confusing. Change it to always use signr.
> >
> >This allows us to simplify the SIGNAL_GROUP_EXIT/group_exec_task branch,
> >it no longer needs to touch ksig at all.
> >
> >Signed-off-by: Oleg Nesterov <oleg@...hat.com>
> >---
> >  kernel/signal.c | 15 +++++++++------
> >  1 file changed, 9 insertions(+), 6 deletions(-)
> >
> >diff --git a/kernel/signal.c b/kernel/signal.c
> >index c9c57d053ce4..690982e6595e 100644
> >--- a/kernel/signal.c
> >+++ b/kernel/signal.c
> >@@ -2727,12 +2727,15 @@ bool get_signal(struct ksignal *ksig)
> >  		/* Has this task already been marked for death? */
> >  		if ((signal->flags & SIGNAL_GROUP_EXIT) ||
> >  		     signal->group_exec_task) {
> >-			clear_siginfo(&ksig->info);
> >-			ksig->info.si_signo = signr = SIGKILL;
> >+			signr = SIGKILL;
> >  			sigdelset(&current->pending.signal, SIGKILL);
> >  			trace_signal_deliver(SIGKILL, SEND_SIG_NOINFO,
> >-				&sighand->action[SIGKILL - 1]);
> >+					     &sighand->action[SIGKILL - 1]);
> >  			recalc_sigpending();
> >+			/*
> >+			 * implies do_group_exit(), no need to initialize
> >+			 * ksig->info
> >+			 */
> >  			goto fatal;
>
> There is little question:
> If the this conditions is met:
>    current->flags & PF_USER_WORKER
> It may execute “goto out“ instead of do_group_exit().

Yes, but vhost/io workers do not use ksig at all.

Oleg.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ