BACKPORT: FROMGIT: mm: always lock new vma before inserting into vma tree
While it's not strictly necessary to lock a newly created vma before adding it into the vma tree (as long as no further changes are performed to it), it seems like a good policy to lock it and prevent accidental changes after it becomes visible to the page faults. Lock the vma before adding it into the vma tree. Link: https://lkml.kernel.org/r/20230804152724.3090321-6-surenb@google.com Suggested-by:Jann Horn <jannh@google.com> Signed-off-by:
Suren Baghdasaryan <surenb@google.com> Reviewed-by:
Liam R. Howlett <Liam.Howlett@oracle.com> Cc: Linus Torvalds <torvalds@linuxfoundation.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> (cherry picked from commit c3249c06c48dda30f93e62b57773d5ed409d4f77 https: //git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable) [surenb: resolved conflicts due to changes in vma_merge() and __vma_adjust()] Bug: 293665307 Change-Id: I4ee0d2abcc8a3f45545f470f1bf7f0be728d6f44 Signed-off-by:
Suren Baghdasaryan <surenb@google.com>
Loading
Please sign in to comment