Thread (3 messages) 3 messages, 1 author, 2021-05-03

[PATCH v2 0/2] mm/hugetlb: Fix issues on file sealing and fork

flat view
STALE2009d REVIEWED

From: Peter Xu <peterx@redhat.com>
Date: 2021-05-03 23:44:05
Also in: lkml
Subsystem: filesystems (vfs and infrastructure), hugetlb subsystem, memory management, memory management - core, the rest, tmpfs (shmem filesystem) · Maintainers: Alexander Viro, Christian Brauner, Muchun Song, Oscar Salvador, Andrew Morton, David Hildenbrand, Linus Torvalds, Hugh Dickins

Status: Reviewed.

Revision v2 (2 revisions archived).

Revisions (2)
  1. v1
  2. v2 current [diff against previous]
v2:
- Move seal check to be after setting VM_HUGETLB [Mike]
- Rewrite commit message for patch 2, explaining more on why it got broken
- Add r-bs for Mike

Hugh reported issue with F_SEAL_FUTURE_WRITE not applied correctly to
hugetlbfs, which I can easily verify using the memfd_test program, which seems
that the program is hardly run with hugetlbfs pages (as by default shmem).

Meanwhile I found another probably even more severe issue on that hugetlb fork
won't wr-protect child cow pages, so child can potentially write to parent
private pages.  Patch 2 addresses that.

After this series applied, "memfd_test hugetlbfs" should start to pass.

Please review, thanks.

Peter Xu (2):
  mm/hugetlb: Fix F_SEAL_FUTURE_WRITE
  mm/hugetlb: Fix cow where page writtable in child

 fs/hugetlbfs/inode.c |  5 +++++
 include/linux/mm.h   | 32 ++++++++++++++++++++++++++++++++
 mm/hugetlb.c         |  1 +
 mm/shmem.c           | 22 ++++------------------
 4 files changed, 42 insertions(+), 18 deletions(-)

-- 
2.31.1


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help