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

Re: [PATCH v3 2/2] xen/common: Add NUMA node id bounds check to page_alloc.c/node_to_scrub


  • To: Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 27 Sep 2023 08:32:12 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QEr0MeIkFNkWcgF+GCZsIIGm7csp0+zR7DJHwWhIUEQ=; b=e7wnP/kA3+4ku6r5JuME1NLIytYeDPMrz32kHg3q94zukzSAuq+LHhIfcXD00jy8zplfEA3b2vtkNi+q4WBE3yop0imckBKHbUzjplT73qlALnhSukHiNZlAFKSKuCMXiunGhpADhQUPDBrn0pPmeHf06AqmKQ/iQgN81YrUM215vWb0qFaA+fWGQiMVGCRHqS04+X0zAboYdFFJbVAktOisn89HU86qROOSEcESmmLxFH13EZRN9NQQBumYAUqJyTO4439We5UO0JpKkKEzSxfFXwOplENglk5Tsq/QRmiFhBIr48KaY+7jfMlwwC+JtyhGciNxDrx5VdYgWzQyZg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yna8xz5bRP6OT393iFOJiBMhnmucEFFmhcgj4w0PkWNX0LiJc9jtFWo/CfYEdxIAvoVYDfElkGQjA5D5y4pf6OCwW4ltKQuv4XiKpSSDUyKbbI6s79hu1r2JCg55Q0pi91TDwez8jA4fs4jI80tBBoUG4tXPfEghYiCf822Xls9MHM0o/lPcZ5aOPCdwgzJ5bC+FSyjost9Vf9plRyUH1FhVREiqh9q61iDkgpSXIxlje5WTDaVj5Ol0AdNmbCUIzaKW1zeJd6geNyExPtpXdsdhDozVlFu7uUZSlcAqCsi3jdOHengfEkPbJPVNPaoGAd+/xHgt5Yah/WrXomyF3w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 27 Sep 2023 06:32:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.09.2023 00:37, Shawn Anastasio wrote:
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -1211,6 +1211,14 @@ static unsigned int node_to_scrub(bool get_node)
>          } while ( !cpumask_empty(&node_to_cpumask(node)) &&
>                    (node != local_node) );
> 
> +        /*
> +         * In practice `node` will always be within MAX_NUMNODES, but GCC 
> can't
> +         * always see that, so an explicit check is necessary to avoid 
> tripping
> +         * its out-of-bounds array access warning (-Warray-bounds).
> +         */
> +        if ( node >= MAX_NUMNODES )
> +            break;
> +
>          if ( node == local_node )
>              break;

My comment on v1 wasn't addressed, either verbally or by a code change. Imo
that would move us a tiny step closer to what Andrew was asking for as well.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.