public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Wen Yang <wenyang.linux@foxmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Christian Brauner <brauner@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] get_signal: simplify/cleanup the the usage of ksig->info
Date: Mon, 26 Feb 2024 10:52:41 +0100	[thread overview]
Message-ID: <20240226095240.GA9510@redhat.com> (raw)
In-Reply-To: <20240223144458.GD8267@redhat.com>

OK, lets forget about "no need to initialize ksig->info" part for now.

Yes, PF_USER_WORKER's never dereference ksig, but I agree this doesn't
look clean without other cleanups. I'll probably return to this later
when other pending problems with PF_USER_WORKER are fixed.

Wen, thanks again for your review.

Oleg.

On 02/23, Oleg Nesterov wrote:
>
> On 02/23, Oleg Nesterov wrote:
> >
> > On 02/23, Oleg Nesterov wrote:
> > >
> > > On 02/23, Wen Yang wrote:
> > > >
> > > >
> > > > On 2024/2/23 18:50, Oleg Nesterov wrote:
> > > > >+			/*
> > > > >+			 * 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.
> >
> > Ah, wait...
> >
> > I forgot about the ->sa_flags check before hide_si_addr_tag_bits().
> >
> > OK, thanks... I'll send V2.
>
> Tomorrow.
>
> I'll recheck, but I think we need the patch below as 1/2 regadless of
> this change
>
> Oleg.
> ---
>
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -2897,13 +2897,13 @@ bool get_signal(struct ksignal *ksig)
>  		/* NOTREACHED */
>  	}
>  	spin_unlock_irq(&sighand->siglock);
> -out:
> +
>  	ksig->sig = signr;
>
>  	if (!(ksig->ka.sa.sa_flags & SA_EXPOSE_TAGBITS))
>  		hide_si_addr_tag_bits(ksig);
> -
> -	return ksig->sig > 0;
> +out:
> +	return signr > 0;
>  }
>
>  /**


  reply	other threads:[~2024-02-26  9:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23 10:50 [PATCH] get_signal: simplify/cleanup the the usage of ksig->info Oleg Nesterov
2024-02-23 13:41 ` Wen Yang
2024-02-23 14:19   ` Oleg Nesterov
2024-02-23 14:31     ` Oleg Nesterov
2024-02-23 14:44       ` Oleg Nesterov
2024-02-26  9:52         ` Oleg Nesterov [this message]
2024-02-26 15:06           ` Wen Yang

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=20240226095240.GA9510@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wenyang.linux@foxmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox