All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: "Ning, Hongyu" <hongyu.ning@linux.intel.com>,
	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, 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:10 +0300	[thread overview]
Message-ID: <atYginh9CIXA0baV@kernel.org> (raw)
In-Reply-To: <493158de-7b76-45ca-9d71-ad8981242c12@kernel.org>

On Mon, Oct 19, 2026 at 03:03:43PM +0200, David Hildenbrand (Arm) wrote:
> On 10/19/26 03:03, 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)
> 
> 
> Interesting, so we wouldn't be able to snapshot+restore an app that uses shadow
> stacks.
> 
> @Mike: I assume that's not a concern for CRIU etc, right?

CRIU can do snapshots without uffd and it can do shadow stacks in its own
inventive way :)
 
> > 
> > Fixes: 3c58f641e813 ("userfaultfd: prevent registration of special VMAs")
> > 
> > Signed-off-by: Hongyu Ning <hongyu.ning@linux.intel.com>
> Acked-by: David Hildenbrand (Arm) <david@kernel.org>
> 
> -- 
> Cheers,
> 
> David

-- 
Sincerely yours,
Mike.

  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 [this message]
2026-10-19 13:52 ` Mike Rapoport

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=atYginh9CIXA0baV@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.