All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: "Ning, Hongyu" <hongyu.ning@linux.intel.com>
Cc: x86@kernel.org, shuah@kernel.org, rick.p.edgecombe@intel.com,
	tglx@kernel.org, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, hpa@zytor.com, ljs@kernel.org,
	akpm@linux-foundation.org, david@kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	hongyu.ning@intel.com, jolsa@kernel.org, dwindsor@gmail.com
Subject: Re: [PATCH] selftests/x86: Fix userfaultfd test for shadow stack rejection
Date: Mon, 19 Oct 2026 16:52:37 +0300	[thread overview]
Message-ID: <atYgpbjclZJDSRbJ@kernel.org> (raw)
In-Reply-To: <3b3e0a35-e664-40ab-84ad-afa3e31e3aea@linux.intel.com>

On Mon, Oct 19, 2026 at 09:03:12AM +0800, Ning, Hongyu wrote:
> Commit 3c58f641e813 ("userfaultfd: prevent registration of special
> VMAs") prevents userfaultfd registration on shadow stack VMAs to avoid
> bypassing shadow stack protections through UFFDIO_COPY.
> 
> The existing shadow stack selftest still expects UFFDIO_REGISTER to
> succeed and uses UFFDIO_COPY to populate the shadow stack. This causes
> the selftest to fail on Kernels containing this security fix.
> 
> Update the selftest to verify that UFFDIO_REGISTER rejects shadow stack
> VMAs with EINVAL. Remove the obsolete userfaultfd fault handling thread
> and UFFDIO_COPY test path.
> 
> Tested on: Intel shadow stack capable x86_64 platform
> 
> Before fix:
> 	[FAIL]  Userfaultfd test with return code 1
> 
> After fix:
> 	[OK]    Userfaultfd rejects shadow stack registration (EINVAL)
> 
> Fixes: 3c58f641e813 ("userfaultfd: prevent registration of special VMAs")
> 
> Signed-off-by: Hongyu Ning <hongyu.ning@linux.intel.com>

Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

> ChatGPT was used to assist with root-cause analysis and patch
> preparation. The changes were reviewed and validated on Intel shadow
> stack capable x86_64 platform, with all 12 shadow stack tests passing.
> ---
>  .../testing/selftests/x86/test_shadow_stack.c | 105 ++++++------------
>  1 file changed, 34 insertions(+), 71 deletions(-)

-- 
Sincerely yours,
Mike.

      parent reply	other threads:[~2026-10-19 13:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  1:03 [PATCH] selftests/x86: Fix userfaultfd test for shadow stack rejection Ning, Hongyu
2026-10-19 13:03 ` David Hildenbrand (Arm)
2026-10-19 13:52   ` Mike Rapoport
2026-10-19 13:52 ` Mike Rapoport [this message]

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=atYgpbjclZJDSRbJ@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=dwindsor@gmail.com \
    --cc=hongyu.ning@intel.com \
    --cc=hongyu.ning@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=ljs@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=shuah@kernel.org \
    --cc=tglx@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.