[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected. No action required from the submitter.
The upstream commit SHA1 provided is correct: 71c186efc1b2cf1aeabfeff3b9bd5ac4c5ac14d8
WARNING: Author mismatch between patch and upstream commit: Backport author: Xiangyu Chenxiangyu.chen@eng.windriver.com Commit author: Jann Hornjannh@google.com
Status in newer kernel trees: 6.14.y | Present (exact SHA1) 6.12.y | Present (exact SHA1) 6.6.y | Present (different SHA1: 3c6b4bcf3784)
Note: The patch differs from the upstream commit: --- 1: 71c186efc1b2c ! 1: 5e68b6fcca197 userfaultfd: fix checks for huge PMDs @@ Metadata ## Commit message ## userfaultfd: fix checks for huge PMDs
+ commit 71c186efc1b2cf1aeabfeff3b9bd5ac4c5ac14d8 upstream. + Patch series "userfaultfd: fix races around pmd_trans_huge() check", v2.
The pmd_trans_huge() code in mfill_atomic() is wrong in three different @@ Commit message fix for bug 3), so that the first fix can be backported to kernels affected by bugs 1+2.
- This patch (of 2):
This fixes two issues. @@ Commit message Cc: Qi Zheng zhengqi.arch@bytedance.com Cc: stable@vger.kernel.org Signed-off-by: Andrew Morton akpm@linux-foundation.org + [ According to backport note in git comment message, using pmd_read_atomic() + instead of pmdp_get_lockless() in older kernels ] + Signed-off-by: Xiangyu Chen xiangyu.chen@windriver.com + Signed-off-by: He Zhe zhe.he@windriver.com
## mm/userfaultfd.c ## -@@ mm/userfaultfd.c: static __always_inline ssize_t mfill_atomic(struct userfaultfd_ctx *ctx, +@@ mm/userfaultfd.c: static __always_inline ssize_t __mcopy_atomic(struct mm_struct *dst_mm, }
- dst_pmdval = pmdp_get_lockless(dst_pmd); + dst_pmdval = pmd_read_atomic(dst_pmd); - /* - * If the dst_pmd is mapped as THP don't - * override it and just be strict. @@ mm/userfaultfd.c: static __always_inline ssize_t mfill_atomic(struct userfaultfd } - /* If an huge pmd materialized from under us fail */ - if (unlikely(pmd_trans_huge(*dst_pmd))) { -+ dst_pmdval = pmdp_get_lockless(dst_pmd); ++ dst_pmdval = pmd_read_atomic(dst_pmd); + /* + * If the dst_pmd is THP don't override it and just be strict. + * (This includes the case where the PMD used to be THP and ---
Results of testing on various branches:
| Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success |