From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B26B5C4743C for ; Wed, 23 Jun 2021 04:49:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97AD26135C for ; Wed, 23 Jun 2021 04:49:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229890AbhFWEvl (ORCPT ); Wed, 23 Jun 2021 00:51:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:46816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbhFWEvl (ORCPT ); Wed, 23 Jun 2021 00:51:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 36BC860232; Wed, 23 Jun 2021 04:49:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1624423763; bh=ywwVYbdUsNZrOrC2GmcdNjUsIwfz2tDlgh0SpQ0ew4o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=JBkzQP3n0JrXWbPRSLfm3oFr8sQvRVBX2I+5vt35ARb/GU3bEmkCuPttKpuIMMRwi /LuMg1mdqbR8KEYSDNc6sqRWISy3Ralxj53qCCthTjRAi8YGhNXfAWKgVGbhXDKrI/ SqEgi26QW7VP+r2hU5X2mjNaFC07jKgndGSRL1LM= Date: Tue, 22 Jun 2021 21:49:22 -0700 From: Andrew Morton To: Rasmus Villemoes Cc: Mel Gorman , Alexander Lobakin , Vlastimil Babka , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/page_alloc: __alloc_pages_bulk(): do bounds check before accessing array Message-Id: <20210622214922.fbf7ce7eb2864292d91ca4f2@linux-foundation.org> In-Reply-To: <387ca68d-7c59-b316-7d95-cf13a3b26770@rasmusvillemoes.dk> References: <20210507064504.1712559-1-linux@rasmusvillemoes.dk> <20210507102634.GD9524@techsingularity.net> <387ca68d-7c59-b316-7d95-cf13a3b26770@rasmusvillemoes.dk> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Jun 2021 18:01:17 +0200 Rasmus Villemoes wrote: > On 07/05/2021 12.26, Mel Gorman wrote: > > On Fri, May 07, 2021 at 08:45:03AM +0200, Rasmus Villemoes wrote: > >> In the event that somebody would call this with an already fully > >> populated page_array, the last loop iteration would do an access > >> beyond the end of page_array. > >> > >> It's of course extremely unlikely that would ever be done, but this > >> triggers my internal static analyzer. Also, if it really is not > >> supposed to be invoked this way (i.e., with no NULL entries in > >> page_array), the nr_populated >> instead. > >> > >> Fixes: 0f87d9d30f21 (mm/page_alloc: add an array-based interface to the bulk page allocator) > >> Signed-off-by: Rasmus Villemoes > > > > Acked-by: Mel Gorman > > > > Andrew, will you get this to Linus before 5.13 is released? I got a mail > on May 9 that it had been added to your queue, but I don't see it in > master yet. I had it queued for 5.14-rc1. I'll move it into the 5.13 queue as it fixes a post-5.12 thing, but nothing in the changelog indicates that it's at all urgent? Was the changelog missing some important info? : In the event that somebody would call this with an already fully populated : page_array, the last loop iteration would do an access beyond the end of : page_array. : : It's of course extremely unlikely that would ever be done, but this : triggers my internal static analyzer. Also, if it really is not supposed : to be invoked this way (i.e., with no NULL entries in page_array), the : nr_populated