Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754902AbbLKWw5 (ORCPT ); Fri, 11 Dec 2015 17:52:57 -0500 Received: from relay3.sgi.com ([192.48.152.1]:53184 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754692AbbLKWw4 (ORCPT ); Fri, 11 Dec 2015 17:52:56 -0500 Date: Fri, 11 Dec 2015 16:52:54 -0600 From: andrew banman To: Andrew Banman Cc: Andrew Morton , Russ Anderson , Alex Thorlton , Yinghai Lu , Greg KH , Seth Jennings , linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers: memory: check for missing sections in test_pages_in_a_zone Message-ID: <20151211225254.GG70077@asylum.americas.sgi.com> References: <1449872463-4695-1-git-send-email-abanman@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449872463-4695-1-git-send-email-abanman@sgi.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1314 Lines: 27 On Fri, Dec 11, 2015 at 04:21:03PM -0600, Andrew Banman wrote: > test_pages_in_a_zone does not account for the possibility of missing > sections in the given pfn range. pfn_valid_within always returns 1 when > CONFIG_HOLES_IN_ZONE is not set, allowing invalid pfns from missing > sections to pass the test, leading to a kernel oops. > > Wrap an additional pfn loop with PAGES_PER_SECTION granularity to check > for missing sections before proceeding into the zone-check code. > > This also prevents a crash from offlining memory devices with missing > sections. Despite this, it may be a good idea to keep the related patch > '[PATCH 3/3] drivers: memory: prohibit offlining of memory blocks > with missing sections' because missing sections in a memory block may lead > to other problems not covered by the scope of this fix. > > --- Oops, the signed-off-by got absorbed the email headers. I'll resend. The patch applies cleanly to the current mainline and to the 4.3.2 and 4.2.7 stable branches. I'll edit the patch description to reflect that as well. - Andrew -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/