Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5327149pxj; Tue, 22 Jun 2021 21:51:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrHez78NgFU7HoPuy3EpdSuHrQd8tR0QIHQosXzigUJ59fzFWWPN5hNRbUWOi4KrOU48ma X-Received: by 2002:a02:ce88:: with SMTP id y8mr3461108jaq.34.1624423899129; Tue, 22 Jun 2021 21:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624423899; cv=none; d=google.com; s=arc-20160816; b=Qjq+g0wNJR2fB9zFE+dXrvLxduvg/6Ha0ReOztZv0wLK17k5em6XzSQVjG2jr1PBNU 448GybfuOEjdR3EoiDUzczhgbu5gFZoy/HIReUusP8DaFC2Rn9+qv/8+10SfFz5+jjDX LB4ixQVFa4qB4Y7WrF9zDKRCAv2Qy6pKsdZLVQJR5vp3jiD3gTx+xfjovIP7EzYqr0g0 256VaPsnP3eogPpPGPNQt/syMLA2H8sY0MRFHje5Wm9XCQrRS8wLb3l6YgjwcTI9/v+z 0g/p4ie68u5Rx4V28m6oXhbzRNbtyvxB9hfYr2qTsqNWemBdnGQ2zw9E1HW6V6erbZAn /R/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=BR1KCWe3v9A580r+wQL2Y0+PGmbwdwtZY/9TUgtwFxw=; b=aDYWZVUQSbbV9kh+8nqlSIisSWXT7Os5VDUGuVGY8XjkPXP3Ovf8mj5vnnMlV8IOtb Sjq6Pa7svY1xBaBfNU3TvIMcWNMAO7Zs9bK0OXre/fvSJa/C1sXgPLWJIYEsdTBlvDnA BaBX6CUhVTaoOg+z4ZE3fNQuWN1MrQzLiU42Fzrkf0mPCaqwBzX6mtxAQiVJ/ZP2qJoB M50RgEB0h0xszzqRoFJRyY9QV0c94BC9iRgH4LfzvNCqFF9sCRvcVeO8vNkV5DOJBDAp OjgPH0glN3z0pUY+DhkbIkGNl5VetrUIgSx96ZuCcbHP0mdcKaAVLfjUBmxoltgkflp0 UlLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=JBkzQP3n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si18982820ilh.42.2021.06.22.21.51.16; Tue, 22 Jun 2021 21:51:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=JBkzQP3n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229726AbhFWEvl (ORCPT + 99 others); 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