Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-06-06 13:04:33 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-06-06 13:04:33 +0200
commitca5dd35cf7883661a81c6de904f5ddb5a81f0e44 (patch)
treec976376d279f76f271889e8a8a79bdd5c4aa16be
parentb7fcce40ca0c6917c07bb22bfc2057c920586657 (diff)
parent1a7767edfb8233a6d2b14cb78274afa9d8ac6e36 (diff)
Merge branch 'users/vbabka/SLE15/for-next' into SLE15
Pull a mm fix from Vlastimil Babka
-rw-r--r--patches.fixes/mm-prevent-get_user_pages-from-overflowing-page-refcount.patch17
1 files changed, 13 insertions, 4 deletions
diff --git a/patches.fixes/mm-prevent-get_user_pages-from-overflowing-page-refcount.patch b/patches.fixes/mm-prevent-get_user_pages-from-overflowing-page-refcount.patch
index 1cd97df253..456da3e810 100644
--- a/patches.fixes/mm-prevent-get_user_pages-from-overflowing-page-refcount.patch
+++ b/patches.fixes/mm-prevent-get_user_pages-from-overflowing-page-refcount.patch
@@ -22,10 +22,10 @@ Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
---
arch/s390/mm/gup.c | 9 ++++++---
- arch/x86/mm/gup.c | 12 ++++++++++--
+ arch/x86/mm/gup.c | 14 ++++++++++++--
mm/gup.c | 46 +++++++++++++++++++++++++++++++++++-----------
mm/hugetlb.c | 13 +++++++++++++
- 4 files changed, 64 insertions(+), 16 deletions(-)
+ 4 files changed, 66 insertions(+), 16 deletions(-)
--- a/arch/s390/mm/gup.c
+++ b/arch/s390/mm/gup.c
@@ -34,8 +34,8 @@ Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
page = pte_page(pte);
head = compound_head(page);
- if (!page_cache_get_speculative(head))
-+ if (unlikely(WARN_ON_ONCE(page_ref_count(head) < 0
-+ || !page_cache_get_speculative(head))))
++ if (unlikely(WARN_ON_ONCE(page_ref_count(head) < 0)
++ || !page_cache_get_speculative(head)))
return 0;
if (unlikely(pte_val(pte) != pte_val(*ptep))) {
put_page(head);
@@ -96,6 +96,15 @@ Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
page = head + ((addr & ~PMD_MASK) >> PAGE_SHIFT);
do {
VM_BUG_ON_PAGE(compound_head(page) != head, page);
+@@ -282,6 +290,8 @@ static noinline int gup_huge_pud(pud_t p
+
+ refs = 0;
+ head = pud_page(pud);
++ if (WARN_ON_ONCE(page_ref_count(head) <= 0))
++ return 0;
+ page = head + ((addr & ~PUD_MASK) >> PAGE_SHIFT);
+ do {
+ VM_BUG_ON_PAGE(compound_head(page) != head, page);
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -153,7 +153,11 @@ retry: