LKML Archive on
help / color / mirror / Atom feed
From: Jiashuo Liang <>
Subject: Re: [PATCH v2] x86/fault: Fix wrong signal when vsyscall fails with pkey
Date: Sun, 19 Sep 2021 12:39:27 +0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Mon, 2021-08-23 at 07:55 -0700, Dave Hansen wrote:
> On 7/29/21 8:01 PM, Jiashuo Liang wrote:
>> The function __bad_area_nosemaphore() calls kernelmode_fixup_or_oops() with
>> parameter "signal" being "pkey", which will send a signal numbered "pkey".
>> This bug appears when the kernel fail to access user-given memory pages
>> that are protected by pkey, so it can go through the do_user_addr_fault()
>> path and pass the !user_mode() check in __bad_area_nosemaphore(). Most
>> cases will simply run the kernel fixup code to make an -EFAULT. But when
>> another condition current->thread.sig_on_uaccess_err is met, which is
>> only used to emulate vsyscall, we will generate the wrong signal.
>> A new parameter "pkey" is added to kernelmode_fixup_or_oops() to fix it.
>> Fixes: 5042d40a264c ("x86/fault: Bypass no_context() for implicit kernel faults from usermode")
>> Signed-off-by: Jiashuo Liang <>
> This is pretty obscure, only affecting vsyscall emulation, but:
> Acked-by: Dave Hansen <>

Ping... Is there anyone reviewing/committing this patch?


  reply	other threads:[~2021-09-19  4:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30  3:01 Jiashuo Liang
2021-08-23 14:55 ` Dave Hansen
2021-09-19  4:39   ` Jiashuo Liang [this message]
2021-09-20 10:42 ` [tip: x86/urgent] " tip-bot2 for Jiashuo Liang
2021-09-20 14:43   ` Borislav Petkov
2021-09-20 20:37 ` 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v2] x86/fault: Fix wrong signal when vsyscall fails with pkey' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).