Re: [PATCH] base/memory, hotplug: fix a kernel oops in show_valid_zones()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 06, 2017 at 03:33:01PM -0700, Toshi Kani wrote:
> Reading a sysfs "memoryN/valid_zones" file leads to the following oops
> when the first page of a range is not backed by struct page.
> show_valid_zones() assumes that 'start_pfn' is always valid for
> page_zone().
> 
>  BUG: unable to handle kernel paging request at ffffea017a000000
>  IP: show_valid_zones+0x6f/0x160
> 
> This issue may happen on x86-64 systems with 64GiB or more memory since
> their memory block size is bumped up to 2GiB.  [1] An example of such
> systems is desribed below.  0x3240000000 is only aligned by 1GiB and
> this memory block starts from 0x3200000000, which is not backed by
> struct page.
> 
>  BIOS-e820: [mem 0x0000003240000000-0x000000603fffffff] usable
> 
> Since test_pages_in_a_zone() already checks holes, fix this issue by
> extending this function to return 'valid_start' and 'valid_end' for a
> given range.  show_valid_zones() then proceeds with the valid range.
> 
> [1] 'Commit bdee237c0343 ("x86: mm: Use 2GB memory block size on
>     large-memory x86-64 systems")'
> 
> Link: http://lkml.kernel.org/r/20170127222149.30893-3-toshi.kani@xxxxxxx
> Signed-off-by: Toshi Kani <toshi.kani@xxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Cc: Zhang Zhen <zhenzhang.zhang@xxxxxxxxxx>
> Cc: Reza Arbab <arbab@xxxxxxxxxxxxxxxxxx>
> Cc: David Rientjes <rientjes@xxxxxxxxxx>
> Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx> [4.4+]
> 
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> ---
> This patch backports commit a96dfddbcc to 4.4. This is 2/2 of patch-set.
> The 1/2 patch is commit deb88a2a19e that applies/has applied cleanly to 4.4.
> Link: http://www.spinics.net/lists/stable/msg158242.html

Thanks, now queued up.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]