Skip to content

userfaultfd v4.11 updates

Andrea Arcangeli linux-mm 1 version Applied

Status from this message: [merged] userfaultfd-selftest-vm-allow-to-build-in-vm-directory.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3userfaultfd: non-cooperative: fix fork fctx->new memleakfs/userfaultfd.c+9 -03 repliesApplied
2/3userfaultfd: non-cooperative: userfaultfd_remove revalidate vma in MADV_DONTNEEDfs/userfaultfd.c include/linux/userfaultfd_k.h mm/madvise.c+47 -131 replyApplied
3/3userfaultfd: selftest: vm: allow to build in vm/ directorytools/testing/selftests/vm/Makefile+4 -00 repliesApplied

Reviews trailers per patch

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

PatchMike Rapoport
1/3
2/3A-b
3/3

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/3] userfaultfd v4.11 updates

Hello,

this is incremental against current -mm.

The earlier patchset fixed the fctx->orig memleak but as I thought during review, there was a further leak in fctx->new and Mike promptly fixed it too. I've been running a reproducer and there's no further memleak when the uffd is closed by the parent while fork() blocks waiting for the event to be received.

In addition I found a potential stale pointer in MADV_DONTNEED if userfaultfd_remove has to block and releases the mmap_sem in the process. This patch revalidates the vma and fixes the race. Unfortunately calling userfaultfd_remove last is not ok as explained in the commit.

A "make" run from the directory selftests/vm/ independently started to fail in v4.11 trying to write executables to the root directory. That's not very friendly because it worked before, but it's easy to fix and the last patch corrects this behavior in the vm/Makefile.

Andrea Arcangeli (2):
userfaultfd: non-cooperative: userfaultfd_remove revalidate vma in
MADV_DONTNEED
userfaultfd: selftest: vm: allow to build in vm/ directory

Mike Rapoport (1):
userfaultfd: non-cooperative: fix fork fctx->new memleak

 fs/userfaultfd.c                    | 18 ++++++++++-----
 include/linux/userfaultfd_k.h       |  7 +++---
 mm/madvise.c                        | 44 ++++++++++++++++++++++++++++++++++---
 tools/testing/selftests/vm/Makefile |  4 ++++
 4 files changed, 60 insertions(+), 13 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>