public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Jiashuo Liang <liangjs@pku.edu.cn>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] signal/x86: Don't send SIGSEGV twice on SEGV_PKUERR
Date: Wed, 02 Jun 2021 13:42:22 -0500	[thread overview]
Message-ID: <87wnrcqfap.fsf@disp2133> (raw)
In-Reply-To: <20210601085203.40214-1-liangjs@pku.edu.cn> (Jiashuo Liang's message of "Tue, 1 Jun 2021 16:52:03 +0800")

Jiashuo Liang <liangjs@pku.edu.cn> writes:

> Before this patch, the __bad_area_nosemaphore function calls both
> force_sig_pkuerr and force_sig_fault when handling SEGV_PKUERR. This does
> not cause problems because the second signal is filtered by the
> legacy_queue check in __send_signal. But it causes the kernel to do
> unnecessary work.
>
> This patch should fix it.

Have you been able to test this patch?

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

Does one of the x86 maintainers want to pick up this trivial fix or
should I pick it up?

Eric


> Fixes: 9db812dbb29d ("signal/x86: Call force_sig_pkuerr from __bad_area_nosemaphore")
> Suggested-by: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: Jiashuo Liang <liangjs@pku.edu.cn>
> ---
>  arch/x86/mm/fault.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> index 1c548ad00752..6bda7f67d737 100644
> --- a/arch/x86/mm/fault.c
> +++ b/arch/x86/mm/fault.c
> @@ -836,8 +836,8 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
>  
>  	if (si_code == SEGV_PKUERR)
>  		force_sig_pkuerr((void __user *)address, pkey);
> -
> -	force_sig_fault(SIGSEGV, si_code, (void __user *)address);
> +	else
> +		force_sig_fault(SIGSEGV, si_code, (void __user *)address);
>  
>  	local_irq_disable();
>  }

  reply	other threads:[~2021-06-02 18:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01  8:52 [PATCH] signal/x86: Don't send SIGSEGV twice on SEGV_PKUERR Jiashuo Liang
2021-06-02 18:42 ` Eric W. Biederman [this message]
2021-06-02 19:02   ` Borislav Petkov
2021-06-03 18:37 ` Borislav Petkov
2021-06-03 21:31   ` Eric W. Biederman
2021-06-04 13:06     ` Borislav Petkov
2021-06-04 14:33       ` Eric W. Biederman
2021-06-04 14:54         ` Borislav Petkov
2021-06-04 13:26 ` [tip: x86/urgent] x86/fault: " tip-bot2 for Jiashuo Liang

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=87wnrcqfap.fsf@disp2133 \
    --to=ebiederm@xmission.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=liangjs@pku.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox