Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5996434ybc; Wed, 27 Nov 2019 13:06:56 -0800 (PST) X-Google-Smtp-Source: APXvYqyH27ihUMdKbGIh4Q277wRcrQEe/ZN+fYhLRqU7rOdTDekIrkv29Aqx3k4k6TzhIKOMqRUt X-Received: by 2002:a17:906:6a43:: with SMTP id n3mr50964557ejs.31.1574888816154; Wed, 27 Nov 2019 13:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888816; cv=none; d=google.com; s=arc-20160816; b=FTOnJfil1Ib5t5mfnIZNag1sLr7FRCFlaJJE5kPJRtI6U3x4oMAXWvXK6TcQDpocB7 vqRRLopBLHiorn9Ujg4v2EUmd37rVaITSh4F6iwOBgpYiYb4Z9fvVKVropR+4twdiP2Z yqKeZeXFDMVHAM1zqTpdakO6+89cb5uHwILXR6wy9X7iT9rYGH2jZBhNSF+hOfVdTbtC xO28ewQ8wsLOAJZH4qDJRHnH8WMJs4umSub1Z/LmPyS134ygAaSl3jQOQS2tKKF7pCCx nOriokujEjI1N866kEXUbhAaZF8IQD1ZotKlJx3oNroHPfl4+l3FAvZPZhKmG9dzzkRi no7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UFT6OREgx6SYi4bTrfLo1jMivOUbeMnK9LH4Oyzr3w4=; b=0ZyUP7Xwb/1DxYHWk+Y7Qpod3/A6xuLhIPWq4u0is4U4bQKGPE0Vd2w0EU3LxjeyBg nepkOgKZJLrFSemKroSVnz6OPWaaIVt40MHWf0Mp9VnEF8BKUSDTB1JYv2ZCJw34T8Hz pPqKEcuPAqAdh+KOEReNLn/Y2reqjNLt0w4FgtlNCkCfObTHMQU1bTYxeS+sO8Huq1Cy nWO5K1WgAiO0yubgxd5Ug+EwQGAld4fswWb9zGV3yDwQ752d95bosT9gMPgWV9JLg/dT e4oWFrs8mcv38ZcEta3V21NCJ2qrEfeEo6pTUwzt/2s59man2XkOCwQRBBeQ4646Tqd4 6weQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nHDkbWhW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15si12201217edu.427.2019.11.27.13.06.32; Wed, 27 Nov 2019 13:06:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nHDkbWhW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727437AbfK0VDd (ORCPT + 99 others); Wed, 27 Nov 2019 16:03:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:56710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732034AbfK0VD2 (ORCPT ); Wed, 27 Nov 2019 16:03:28 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AB8A721569; Wed, 27 Nov 2019 21:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888608; bh=tgII95yNo67R1JXOG2XCEJcU+1k6nHpaACezIMZWUnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nHDkbWhWZwmZyycaVshUFbLM1iEdayfv63ao/c+qJqMKlpCc245qO/T9CK4gySCiS vB5OAqI5iI1Ql+1BClhAR2tPN1VMM0CazERVWlP1Fd+W7f8FwlJeoC0bTyjqbQMiPo WjJON82BSO36fkeVXLnaSkfmbCFlGTiepcjAe3wU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Linus Torvalds , Thomas Gleixner , Ingo Molnar , Sasha Levin Subject: [PATCH 4.19 201/306] sched/topology: Fix off by one bug Date: Wed, 27 Nov 2019 21:30:51 +0100 Message-Id: <20191127203129.854002540@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra [ Upstream commit 993f0b0510dad98b4e6e39506834dab0d13fd539 ] With the addition of the NUMA identity level, we increased @level by one and will run off the end of the array in the distance sort loop. Fixed: 051f3ca02e46 ("sched/topology: Introduce NUMA identity node sched domain") Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- kernel/sched/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index c0a7514649715..74b694392f2fd 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1329,7 +1329,7 @@ void sched_init_numa(void) int level = 0; int i, j, k; - sched_domains_numa_distance = kzalloc(sizeof(int) * nr_node_ids, GFP_KERNEL); + sched_domains_numa_distance = kzalloc(sizeof(int) * (nr_node_ids + 1), GFP_KERNEL); if (!sched_domains_numa_distance) return; -- 2.20.1