linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5.4.y 0/3] Backport series: "permit write-sealed memfd read-only shared mappings"
@ 2025-07-30  0:58 Isaac J. Manjarres
  2025-07-30  0:58 ` [PATCH 5.4.y 1/3] mm: drop the assumption that VM_SHARED always implies writable Isaac J. Manjarres
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Isaac J. Manjarres @ 2025-07-30  0:58 UTC (permalink / raw)
  To: lorenzo.stoakes, gregkh, Muchun Song, Oscar Salvador,
	David Hildenbrand, Alexander Viro, Christian Brauner, Jan Kara,
	Andrew Morton, Liam R. Howlett, Vlastimil Babka, Mike Rapoport,
	Suren Baghdasaryan, Michal Hocko, Kees Cook, Ingo Molnar,
	Peter Zijlstra, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman, Valentin Schneider,
	Matthew Wilcox (Oracle), Jann Horn, Pedro Falcato, Hugh Dickins,
	Baolin Wang
  Cc: aliceryhl, stable, Isaac J. Manjarres, kernel-team, linux-mm,
	linux-kernel, linux-fsdevel

Hello,

Until kernel version 6.7, a write-sealed memfd could not be mapped as
shared and read-only. This was clearly a bug, and was not inline with
the description of F_SEAL_WRITE in the man page for fcntl()[1].

Lorenzo's series [2] fixed that issue and was merged in kernel version
6.7, but was not backported to older kernels. So, this issue is still
present on kernels 5.4, 5.10, 5.15, 6.1, and 6.6.

This series backports Lorenzo's series to the 5.4 kernel.

[1] https://man7.org/linux/man-pages/man2/fcntl.2.html
[2] https://lore.kernel.org/all/913628168ce6cce77df7d13a63970bae06a526e0.1697116581.git.lstoakes@gmail.com/T/#m28fbfb0d5727e5693e54a7fb2e0c9ac30e95eca5

Lorenzo Stoakes (3):
  mm: drop the assumption that VM_SHARED always implies writable
  mm: update memfd seal write check to include F_SEAL_WRITE
  mm: perform the mapping_map_writable() check after call_mmap()

 fs/hugetlbfs/inode.c |  2 +-
 include/linux/fs.h   |  4 ++--
 include/linux/mm.h   | 26 +++++++++++++++++++-------
 kernel/fork.c        |  2 +-
 mm/filemap.c         |  2 +-
 mm/madvise.c         |  2 +-
 mm/mmap.c            | 26 ++++++++++++++++----------
 mm/shmem.c           |  2 +-
 8 files changed, 42 insertions(+), 24 deletions(-)

-- 
2.50.1.552.g942d659e1b-goog



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-24  8:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-30  0:58 [PATCH 5.4.y 0/3] Backport series: "permit write-sealed memfd read-only shared mappings" Isaac J. Manjarres
2025-07-30  0:58 ` [PATCH 5.4.y 1/3] mm: drop the assumption that VM_SHARED always implies writable Isaac J. Manjarres
2025-08-24  8:53   ` Patch "mm: drop the assumption that VM_SHARED always implies writable" has been added to the 5.4-stable tree gregkh
2025-07-30  0:58 ` [PATCH 5.4.y 2/3] mm: update memfd seal write check to include F_SEAL_WRITE Isaac J. Manjarres
2025-08-24  8:53   ` Patch "mm: update memfd seal write check to include F_SEAL_WRITE" has been added to the 5.4-stable tree gregkh
2025-07-30  0:58 ` [PATCH 5.4.y 3/3] mm: perform the mapping_map_writable() check after call_mmap() Isaac J. Manjarres
2025-08-24  8:53   ` Patch "mm: perform the mapping_map_writable() check after call_mmap()" has been added to the 5.4-stable tree gregkh
2025-07-30  1:27 ` [PATCH 5.4.y 0/3] Backport series: "permit write-sealed memfd read-only shared mappings" Matthew Wilcox
2025-07-30  1:59   ` Isaac Manjarres

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).