summaryrefslogtreecommitdiff
path: root/scripts/stackusage
diff options
context:
space:
mode:
authorDavid Hildenbrand (Arm) <david@kernel.org>2026-10-22 11:45:42 +0800
committerAndrew Morton <akpm@linux-foundation.org>2026-11-02 18:14:41 -0800
commit809cbe72ace890f75a9b126eb6a8b533081666d8 (patch)
tree141416e8d7a547d96c7315b9e465541f982dbf0b /scripts/stackusage
parentdfb190302d2b4af86c6ae48af0d3b09f28b35460 (diff)
mm/hugetlb: disable PMD sharing for UFFD missing mode
For UFFDIO_POISON to install a poison marker in a hugetlb mapping, it is sufficient to have the VMA registered for missing mode. However, UFFD missing mode does currently not block PMD table sharing, so installing the marker will be visible to everyone using the shared PMD table, which is wrong as UFFDIO_POISON must stay local to the process. To fix it, make uffd_disable_huge_pmd_share() cover VM_UFFD_MISSING as well. With missing mode covered, hugetlb PMD sharing is disabled for all userfaultfd registered VMAs, so the helper can simply return whether the VMA has a userfaultfd context instead of testing individual UFFD mode flags. Add a debug check on the marker installation path. The existing registration path will then unshare PMD tables, and subsequent faults will not share them while the mapping remains registered. The alternative would be to unshare PMD tables selectively when installing poison markers, which results in way more complexity. Or alternatively, simply failing the marker installation, which might break some use cases. This also disables PMD sharing for userfaultfd registrations that never use UFFDIO_POISON. Link: https://lore.kernel.org/20261022034543.51226-3-lizhe.67@bytedance.com Fixes: 8a13897fb0da ("mm: userfaultfd: support UFFDIO_POISON for hugetlbfs") Signed-off-by: David Hildenbrand (Arm) <david@kernel.org> Signed-off-by: Li Zhe <lizhe.67@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Suggested-by: Li Zhe <lizhe.67@bytedance.com> Suggested-by: Mike Rapoport <rppt@kernel.org> Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Cc: Muchun Song <muchun.song@linux.dev> Cc: Oscar Salvador <osalvador@suse.de> Cc: Peter Xu <peterx@redhat.com> Cc: Jose A. Perez de Azpillaga <azpijr@gmail.com>
Diffstat (limited to 'scripts/stackusage')
0 files changed, 0 insertions, 0 deletions