linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] fix a kernel oops when reading sysfs valid_zones
@ 2017-01-27 22:21 Toshi Kani
  2017-01-27 22:21 ` [PATCH v2 1/2] mm/memory_hotplug.c: check start_pfn in test_pages_in_a_zone() Toshi Kani
  2017-01-27 22:21 ` [PATCH v2 2/2] base/memory, hotplug: fix a kernel oops in show_valid_zones() Toshi Kani
  0 siblings, 2 replies; 3+ messages in thread
From: Toshi Kani @ 2017-01-27 22:21 UTC (permalink / raw)
  To: akpm, gregkh
  Cc: linux-mm, zhenzhang.zhang, arbab, dan.j.williams, abanman,
	rientjes, linux-kernel, stable, toshi.kani

A sysfs memory file is created for each 2GiB memory block on x86-64
when the system has 64GiB or more memory. [1]  When the start address
of a memory block is not backed by struct page, i.e. a memory range is
not aligned by 2GiB, reading its 'valid_zones' attribute file leads to
a kernel oops.  This issue was observed on multiple x86-64 systems
with more than 64GiB of memory.  This patch-set fixes this issue.

Patch 1 first fixes an issue in test_pages_in_a_zone(), which does
not test the start section.

Patch 2 then fixes the kernel oops by extending test_pages_in_a_zone()
to return valid [start, end).

Note for stable kernels: The memory block size change was made by commit
bdee237c034, which was accepted to 3.9.  However, this patch-set depends
on (and fixes) the change to test_pages_in_a_zone() made by commit
5f0f2887f4, which was accepted to 4.4.  So, I recommend that we backport
it up to 4.4.

[1] 'Commit bdee237c0343 ("x86: mm: Use 2GB memory block size on
    large-memory x86-64 systems")'

v2:
 - Rebase to the -mm tree. (Andrew Morton)
 - Add more descriptions about the issue. (Andrew Morton)
 - Add cc to stable kernels. (Greg Kroah-Hartman, Andrew Morton)

---
Toshi Kani (2):
 1/2 mm/memory_hotplug.c: check start_pfn in test_pages_in_a_zone() 
 2/2 base/memory, hotplug: fix a kernel oops in show_valid_zones()

---
 drivers/base/memory.c          | 12 ++++++------
 include/linux/memory_hotplug.h |  3 ++-
 mm/memory_hotplug.c            | 28 +++++++++++++++++++++-------

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-27 21:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-27 22:21 [PATCH v2 0/2] fix a kernel oops when reading sysfs valid_zones Toshi Kani
2017-01-27 22:21 ` [PATCH v2 1/2] mm/memory_hotplug.c: check start_pfn in test_pages_in_a_zone() Toshi Kani
2017-01-27 22:21 ` [PATCH v2 2/2] base/memory, hotplug: fix a kernel oops in show_valid_zones() Toshi Kani

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).