aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mm/mseal.c
diff options
context:
space:
mode:
authorGuillaume Morin <guillaume@morinfr.org>2024-12-06 22:28:36 +0100
committerAndrew Morton <akpm@linux-foundation.org>2025-01-13 22:40:51 -0800
commit052ccfbcc6cd87fe678b0ab27cc0715cb3aefb21 (patch)
tree9dedc9bd1a67c6c8f19b856a5e1f370fc92c61a7 /mm/mseal.c
parentmm: perform all memfd seal checks in a single place (diff)
downloadwireguard-linux-052ccfbcc6cd87fe678b0ab27cc0715cb3aefb21.tar.xz
wireguard-linux-052ccfbcc6cd87fe678b0ab27cc0715cb3aefb21.zip
mm/hugetlb: support FOLL_FORCE|FOLL_WRITE
Eric reported that PTRACE_POKETEXT fails when applications use hugetlb for mapping text using huge pages. Before commit 1d8d14641fd9 ("mm/hugetlb: support write-faults in shared mappings"), PTRACE_POKETEXT worked by accident, but it was buggy and silently ended up mapping pages writable into the page tables even though VM_WRITE was not set. In general, FOLL_FORCE|FOLL_WRITE does currently not work with hugetlb. Let's implement FOLL_FORCE|FOLL_WRITE properly for hugetlb, such that what used to work in the past by accident now properly works, allowing applications using hugetlb for text etc. to get properly debugged. This change might also be required to implement uprobes support for hugetlb [1]. [1] https://lore.kernel.org/lkml/ZiK50qob9yl5e0Xz@bender.morinfr.org/ Link: https://lkml.kernel.org/r/Z1NshNfWuzUCPebA@bender.morinfr.org Signed-off-by: Guillaume Morin <guillaume@morinfr.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Xu <peterx@redhat.com> Cc: David Hildenbrand <david@redhat.com> Cc: Eric Hagberg <ehagberg@janestreet.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/mseal.c')
0 files changed, 0 insertions, 0 deletions