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=unavailable 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 B45FBC48BE5 for ; Wed, 23 Jun 2021 04:49:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 38AC2611C1 for ; Wed, 23 Jun 2021 04:49:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38AC2611C1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1F07B6B0011; Wed, 23 Jun 2021 00:49:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17A9B6B0036; Wed, 23 Jun 2021 00:49:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F34E16B006C; Wed, 23 Jun 2021 00:49:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id B5D686B0011 for ; Wed, 23 Jun 2021 00:49:24 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CDC5318182863 for ; Wed, 23 Jun 2021 04:49:24 +0000 (UTC) X-FDA: 78283759848.25.7AF6E1E Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf10.hostedemail.com (Postfix) with ESMTP id 5704F40002E4 for ; Wed, 23 Jun 2021 04:49:24 +0000 (UTC) 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 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 5704F40002E4 X-Stat-Signature: bxnuw8zqwpueo6onjqjbk4azadmycpcy Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=JBkzQP3n; dmarc=none; spf=pass (imf10.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1624423764-191901 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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