Skip to content

page refcount overflow backports

Vlastimil Babka linux-mm lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8mm, gup: remove broken VM_BUG_ON_PAGE compound check for hugepagesmm/gup.c+0 -30 replies
2/8mm, gup: ensure real head page is ref-counted when using hugepagesmm/gup.c+6 -60 replies
3/8mm: make page ref count overflow check tighter and more explicitinclude/linux/mm.h mm/internal.h+13 -30 replies
4/8mm: add 'try_get_page()' helper functioninclude/linux/mm.h+15 -00 replies
5/8mm: prevent get_user_pages() from overflowing page refcountarch/s390/mm/gup.c arch/x86/mm/gup.c mm/gup.c +3 more+69 -176 replies
6/8pipe: add pipe_buf_get() helperfs/fuse/dev.c fs/splice.c include/linux/pipe_fs_i.h+14 -30 replies
7/8fs: prevent page refcount overflow in pipe_buf_getfs/fuse/dev.c fs/pipe.c fs/splice.c +2 more+29 -150 replies
8/8x86, mm, gup: prevent get_page() race with munmap in paravirt guestarch/x86/mm/gup.c+15 -10 replies

Reviews trailers per patch

5 of 8 patches have a Reviewed-by or Acked-by.

PatchMatthew WilcoxOscar SalvadorSteve CapperKirill A. Shutemov
1/8A-b A-b
2/8A-b
3/8A-b
4/8A-b
5/8A-b
6/8
7/8
8/8Reproduced-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH STABLE 4.4 0/8] page refcount overflow backports

Hi,

this series backports the CVE-2019-11487 fixes (page refcount overflow) to 4.4 stable. It differs from Ajay's series [1] in the following:

- gup.c variants of fast gup for x86 and s390 are fixed too. I've not fixed sparc, mips, sh. It's unlikely the known overflow scenario based on FUSE, which needs 140GB of RAM, is a problem for those architectures, and I don't feel confident enough to patch them. I've sent the same fixup for 4.9 [3]
- there are some differences in backport adaptations, hopefully not important. My version is taken from our 4.4 based kernel, which was just simpler for me than adding the missing parts to Ajay's version
- The last patch fixes another problem in the fast gup implementation on x86, that I've previously posted and got merged to 4.9 stable [2].

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://lore.kernel.org/linux-mm/[email protected]/
[3] https://lore.kernel.org/linux-mm/[email protected]/

Linus Torvalds (3):
mm: make page ref count overflow check tighter and more explicit
mm: add 'try_get_page()' helper function
mm: prevent get_user_pages() from overflowing page refcount

Matthew Wilcox (1):
fs: prevent page refcount overflow in pipe_buf_get

Miklos Szeredi (1):
pipe: add pipe_buf_get() helper

Punit Agrawal (1):
mm, gup: ensure real head page is ref-counted when using hugepages

Vlastimil Babka (1):
x86, mm, gup: prevent get_page() race with munmap in paravirt guest

Will Deacon (1):
mm, gup: remove broken VM_BUG_ON_PAGE compound check for hugepages

 arch/s390/mm/gup.c        |  6 +++--
 arch/x86/mm/gup.c         | 23 ++++++++++++++++++-
 fs/fuse/dev.c             | 12 +++++-----
 fs/pipe.c                 |  4 ++--
 fs/splice.c               | 12 ++++++++--
 include/linux/mm.h        | 26 ++++++++++++++++++++-
 include/linux/pipe_fs_i.h | 17 ++++++++++++--
 kernel/trace/trace.c      |  6 ++++-
 mm/gup.c                  | 48 +++++++++++++++++++++++++++------------
 mm/huge_memory.c          |  2 +-
 mm/hugetlb.c              | 18 +++++++++++++--
 mm/internal.h             | 17 ++++++++++----
 12 files changed, 152 insertions(+), 39 deletions(-)
Signature · 1 line
2.23.0