All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-fix-a-overflow-in-test_pages_in_a_zone.patch added to -mm tree
@ 2017-02-07 21:58 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-02-07 21:58 UTC (permalink / raw)
  To: zhongjiang, mgorman, toshi.kani, vbabka, mm-commits


The patch titled
     Subject: mm/memory_hotplug.c: fix overflow in test_pages_in_a_zone()
has been added to the -mm tree.  Its filename is
     mm-fix-a-overflow-in-test_pages_in_a_zone.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-fix-a-overflow-in-test_pages_in_a_zone.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-fix-a-overflow-in-test_pages_in_a_zone.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: zhong jiang <zhongjiang@huawei.com>
Subject: mm/memory_hotplug.c: fix overflow in test_pages_in_a_zone()

When mainline introduced a96dfddbcc04 ("base/memory, hotplug: fix a kernel
oops in show_valid_zones()"), it obtained the valid start and end pfn from
the given pfn range.  The valid start pfn can fix the actual issue, but it
introduced another issue.  The valid end pfn will may exceed the given
end_pfn.

Although the incorrect overflow will not result in actual problem at
present, but I think it need to be fixed.

Fixes: a96dfddbcc04 ("base/memory, hotplug: fix a kernel oops in show_valid_zones()")
Link: http://lkml.kernel.org/r/1486467299-22648-1-git-send-email-zhongjiang@huawei.com
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Cc: Toshi Kani <toshi.kani@hpe.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memory_hotplug.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/memory_hotplug.c~mm-fix-a-overflow-in-test_pages_in_a_zone mm/memory_hotplug.c
--- a/mm/memory_hotplug.c~mm-fix-a-overflow-in-test_pages_in_a_zone
+++ a/mm/memory_hotplug.c
@@ -1526,7 +1526,7 @@ int test_pages_in_a_zone(unsigned long s
 
 	if (zone) {
 		*valid_start = start;
-		*valid_end = end;
+		*valid_end = min(end, end_pfn);
 		return 1;
 	} else {
 		return 0;
_

Patches currently in -mm which might be from zhongjiang@huawei.com are

z3fold-limit-first_num-to-the-actual-range-of-possible-buddy-indexes.patch
mm-fix-a-overflow-in-test_pages_in_a_zone.patch
mm-page_owner-align-with-pageblock_nr-pages.patch
mm-walk-the-zone-in-pageblock_nr_pages-steps.patch


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

only message in thread, other threads:[~2017-02-07 21:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 21:58 + mm-fix-a-overflow-in-test_pages_in_a_zone.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.