diff options
author | Suren Baghdasaryan <surenb@google.com> | 2023-07-08 12:12:11 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-07-08 14:08:02 -0700 |
commit | 33313a747e81af9f31d0d45de78c9397fa3655eb (patch) | |
tree | 9e4050107b487128f0b628c7b7117082953e23eb /MAINTAINERS | |
parent | c137381f71aec755fbf47cd4e9bd4dce752c054c (diff) | |
download | lwn-33313a747e81af9f31d0d45de78c9397fa3655eb.tar.gz lwn-33313a747e81af9f31d0d45de78c9397fa3655eb.zip |
mm: lock newly mapped VMA which can be modified after it becomes visible
mmap_region adds a newly created VMA into VMA tree and might modify it
afterwards before dropping the mmap_lock. This poses a problem for page
faults handled under per-VMA locks because they don't take the mmap_lock
and can stumble on this VMA while it's still being modified. Currently
this does not pose a problem since post-addition modifications are done
only for file-backed VMAs, which are not handled under per-VMA lock.
However, once support for handling file-backed page faults with per-VMA
locks is added, this will become a race.
Fix this by write-locking the VMA before inserting it into the VMA tree.
Other places where a new VMA is added into VMA tree do not modify it
after the insertion, so do not need the same locking.
Cc: stable@vger.kernel.org
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'MAINTAINERS')
0 files changed, 0 insertions, 0 deletions