Skip to content

special_mapping_fault() is broken

Oleg Nesterov lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 4 repliesIn review
  2. v13 patches 6 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm: introduce vma_is_anonymous(vma) helperinclude/linux/mm.h mm/memory.c+9 -40 replies
2/3mmap: fix the usage of ->vm_pgoff in special_mapping pathsmm/mmap.c+2 -100 replies
3/3mremap: fix the wrong !vma->vm_file check in copy_vma()mm/mmap.c+1 -10 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKirill A. Shutemov
SeriesA-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] special_mapping_fault() is broken

Hello,

special_mapping_fault() is absolutely broken. It seems it was always wrong, but this didn't matter until vdso/vvar started to use more than one page.

The patches are the same, just 1/3 was re-diffed on top of the recent 6b7339f4c31ad "mm: avoid setting up anonymous pages into file mapping" from Kirill.

And after this change vma_is_anonymous() becomes really trivial, it simply checks vm_ops == NULL. However, I do think the helper makes sense. There are a lot of ->vm_ops != NULL checks, the helper makes the caller's code more understandable (self-documented) and this is more grep-friendly.

Oleg.

 include/linux/mm.h |    5 +++++
 mm/memory.c        |    8 ++++----
 mm/mmap.c          |   14 +++-----------
 3 files changed, 12 insertions(+), 15 deletions(-)