]> git.baikalelectronics.ru Git - kernel.git/commit
mm/memory_hotplug.c: fix overflow in test_pages_in_a_zone()
authorzhong jiang <zhongjiang@huawei.com>
Fri, 24 Feb 2017 22:59:30 +0000 (14:59 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 25 Feb 2017 01:46:56 +0000 (17:46 -0800)
commit4b6bbfb796b4f2e96a9a094f81b459ec4b3409dc
tree1dd80b8fb1dc7d1e281e36d8eb4eba6fc893e513
parent6391ddbe5d5e69777358688238c17483a79f83ba
mm/memory_hotplug.c: fix overflow in test_pages_in_a_zone()

When mainline introduced commit a43c3b2bbec8 ("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.

[toshi.kani@hpe.com: remove assumption that end_pfn is aligned by MAX_ORDER_NR_PAGES]
Fixes: a43c3b2bbec8 ("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>
Signed-off-by: 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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory_hotplug.c