stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "mm, hwpoison: fixup "mm: check the return value of lookup_page_ext for all call sites"" has been added to the 4.4-stable tree
@ 2017-11-24 10:14 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-11-24 10:14 UTC (permalink / raw)
  To: gregkh, jslaby, mhocko; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    mm, hwpoison: fixup "mm: check the return value of lookup_page_ext for all call sites"

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mm-hwpoison-fixup-mm-check-the-return-value-of-lookup_page_ext-for-all-call-sites.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Fri Nov 24 11:13:07 CET 2017
Date: Fri, 24 Nov 2017 11:13:07 +0100
To: Greg KH <gregkh@linuxfoundation.org>
From: Michal Hocko <mhocko@suse.com>
Subject: mm, hwpoison: fixup "mm: check the return value of lookup_page_ext for all call sites"

From: Michal Hocko <mhocko@suse.com>


Backport of the upstream commit f86e4271978b ("mm: check the return
value of lookup_page_ext for all call sites") is wrong for hwpoison
pages. I have accidentally negated the condition for bailout. This
basically disables hwpoison pages tracking while the code still
might crash on unusual configurations when struct pages do not have
page_ext allocated. The fix is trivial to invert the condition.

Reported-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 mm/debug-pagealloc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/mm/debug-pagealloc.c
+++ b/mm/debug-pagealloc.c
@@ -34,7 +34,7 @@ static inline void set_page_poison(struc
 	struct page_ext *page_ext;
 
 	page_ext = lookup_page_ext(page);
-	if (page_ext)
+	if (!page_ext)
 		return;
 	__set_bit(PAGE_EXT_DEBUG_POISON, &page_ext->flags);
 }
@@ -44,7 +44,7 @@ static inline void clear_page_poison(str
 	struct page_ext *page_ext;
 
 	page_ext = lookup_page_ext(page);
-	if (page_ext)
+	if (!page_ext)
 		return;
 	__clear_bit(PAGE_EXT_DEBUG_POISON, &page_ext->flags);
 }
@@ -54,7 +54,7 @@ static inline bool page_poison(struct pa
 	struct page_ext *page_ext;
 
 	page_ext = lookup_page_ext(page);
-	if (page_ext)
+	if (!page_ext)
 		return false;
 	return test_bit(PAGE_EXT_DEBUG_POISON, &page_ext->flags);
 }


Patches currently in stable-queue which might be from gregkh@linuxfoundation.org are

queue-4.4/mm-hwpoison-fixup-mm-check-the-return-value-of-lookup_page_ext-for-all-call-sites.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-24 10:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-24 10:14 Patch "mm, hwpoison: fixup "mm: check the return value of lookup_page_ext for all call sites"" has been added to the 4.4-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).