linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: Mike Rapoport <rppt@kernel.org>,
	James Houghton <jthoughton@google.com>,
	David Hildenbrand <david@redhat.com>,
	Suren Baghdasaryan <surenb@google.com>,
	Axel Rasmussen <axelrasmussen@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	peterx@redhat.com
Subject: [PATCH 0/2] mm/userfaultfd: Fix uninitialized output field for -EAGAIN race
Date: Thu, 24 Apr 2025 17:57:27 -0400	[thread overview]
Message-ID: <20250424215729.194656-1-peterx@redhat.com> (raw)

When discussing some userfaultfd issues with Andrea, Andrea pointed out an
ABI issue with userfaultfd that existed for years.  Luckily the issue
should only be a very corner case one, and the fix (even if changing the
kernel ABI) should only be in the good way, IOW there should have no risk
breaking any userapp but only fixing.

This issue also should not matter if the userapp didn't enable any of the
UFFD_FEATURE_EVENT_* feature.

The first patch contains more information on the issue and the fix.  The
2nd patch is a test case I added which would fail on old kernels (including
current latest branches) but will start working after patch 1 applied.

Thanks,

Peter Xu (2):
  mm/userfaultfd: Fix uninitialized output field for -EAGAIN race
  mm/selftests: Add a test to verify mmap_changing race with -EAGAIN

 fs/userfaultfd.c                             |  28 ++-
 tools/testing/selftests/mm/uffd-unit-tests.c | 203 +++++++++++++++++++
 2 files changed, 225 insertions(+), 6 deletions(-)

-- 
2.48.1



             reply	other threads:[~2025-04-24 21:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24 21:57 Peter Xu [this message]
2025-04-24 21:57 ` [PATCH 1/2] " Peter Xu
2025-04-25 15:12   ` David Hildenbrand
2025-04-25 15:54     ` James Houghton
2025-04-25 16:27       ` Peter Xu
2025-04-24 21:57 ` [PATCH 2/2] mm/selftests: Add a test to verify mmap_changing race with -EAGAIN Peter Xu
2025-04-25 15:45 ` [PATCH 0/2] mm/userfaultfd: Fix uninitialized output field for -EAGAIN race James Houghton
2025-04-25 15:58   ` David Hildenbrand
2025-04-25 16:07     ` James Houghton
2025-04-25 16:18       ` Peter Xu

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=20250424215729.194656-1-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=david@redhat.com \
    --cc=jthoughton@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@kernel.org \
    --cc=surenb@google.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