Skip to content

mm/userfaultfd: Fix uninitialized output field for -EAGAIN race

Peter Xu linux-mm lkml stable 1 version Applied

Status from this message: [merged mm-stable] mm-selftests-add-a-test-to-verify-mmap_changing-race-with-eagain.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 7 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2mm/userfaultfd: Fix uninitialized output field for -EAGAIN racefs/userfaultfd.c+22 -63 repliesApplied
2/2mm/selftests: Add a test to verify mmap_changing race with -EAGAINtools/testing/selftests/mm/uffd-unit-tests.c+203 -00 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchDavid Hildenbrand
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] mm/userfaultfd: Fix uninitialized output field for -EAGAIN race

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(-)
Signature · 1 line
2.48.1