Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3626293pxp; Tue, 15 Mar 2022 02:54:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIYzHGHWnzsiia7ekNTA2UjJbMx36CUTpTTItW1Avw/WvuES+VCKu++bMZE0WZ7t9N4ZZT X-Received: by 2002:a17:907:60d1:b0:6db:ab80:78f7 with SMTP id hv17-20020a17090760d100b006dbab8078f7mr16044138ejc.755.1647338055949; Tue, 15 Mar 2022 02:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647338055; cv=none; d=google.com; s=arc-20160816; b=mJF/7RUNYxnVOUUncnrZsBTm22D2ZTxk/Y6Mrh0msZV83cYZLMvi+CUezD8jH4W1qQ I0PFhlFE2cVDOV82gb3IGmsr9AjrTUhZcCg3+PoqwyG7n0Eb+hdS6Y+GiRE+8iiwb0mG EvpqEpEl8xmi164K/ozJFR3pmBc9BNyXeXfFylPIHo54aokKk+q1XLKDJJWQSppLH66v zSfDqmLqRCkCQnqVJW0WRqMAmQhTumYn0QTvqI0gNfWFG6K4i0prIGWiwLKLw+853+ZK fE3mnvPP7bYJ6sJD1iXmi1pIkaR80YTazg+9dAKo+GuPceMi+k0hGVXi80IPUBibcl7Z nzWw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IgoXUe28Hhu/yrrFmdV5kz9fKwhad7/MXx0au+Q2kkE=; b=XOJ3GyFJ2gLrHoUxoQnpT78MhFnwWa717UwDmGg1en7sqFrJtYQONv9k0ejpiyBmVE AbmmD6t5kz0DSGrUG3x08qtnIuoKckRGmymn1+J7trnWgv9tMCBx8Cst1evfhPNahh2e 70+ub4/sS4J2aT+1Qjtgg6lHHsrBXsb76cG2jzltRN3RC0a4+DrL1xi3wVYKwdAFlRO0 BIpKmaBWtwBYX3q5GVqxOwCSEL/KjWiNwbY4AoY5ENqryIly6v+NrPaTUs6F77s4iscw +6W8rtdbpX0y6fM3uZm2znCVn7KW7d7jqZfrMLWZh1CyBVOvcy91Hqjy0EPdoRxULv9J lkxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HMDHgnp5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bi15-20020a170906a24f00b006dbf0d0e0d9si1202663ejb.542.2022.03.15.02.53.24; Tue, 15 Mar 2022 02:54:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HMDHgnp5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239586AbiCNLpE (ORCPT + 99 others); Mon, 14 Mar 2022 07:45:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239593AbiCNLmu (ORCPT ); Mon, 14 Mar 2022 07:42:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 689C648E55; Mon, 14 Mar 2022 04:40:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 268C4B80DBF; Mon, 14 Mar 2022 11:40:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A266C340E9; Mon, 14 Mar 2022 11:39:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647258000; bh=4Hl79FCH9ex4jb0RPlHaXMWBQreyKU+jduSJMcs8qDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HMDHgnp5sDGVvbhzOmAf+EOhn/BDyj9FJetQasOvocl1ZXnvk+24Esr31a4xEkXKz 6gSNY6rvUMKf0N1OlVc0B7bEPa1Yfg22W31uiYuWih4K88QaOxlEZkG8uXjZs4UZUj evZ7+51Y+HYTZ/qrE97hOHYe+/K53PqTW3tbsE5s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dietmar Eggemann , "Peter Zijlstra (Intel)" , Ingo Molnar , Vincent Guittot , Barry Song , dann frazier Subject: [PATCH 4.19 29/30] sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa() Date: Mon, 14 Mar 2022 12:34:47 +0100 Message-Id: <20220314112732.614114671@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112731.785042288@linuxfoundation.org> References: <20220314112731.785042288@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dietmar Eggemann commit 71e5f6644fb2f3304fcb310145ded234a37e7cc1 upstream. Commit "sched/topology: Make sched_init_numa() use a set for the deduplicating sort" allocates 'i + nr_levels (level)' instead of 'i + nr_levels + 1' sched_domain_topology_level. This led to an Oops (on Arm64 juno with CONFIG_SCHED_DEBUG): sched_init_domains build_sched_domains() __free_domain_allocs() __sdt_free() { ... for_each_sd_topology(tl) ... sd = *per_cpu_ptr(sdd->sd, j); <-- ... } Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Vincent Guittot Tested-by: Barry Song Link: https://lkml.kernel.org/r/6000e39e-7d28-c360-9cd6-8798fd22a9bf@arm.com Signed-off-by: dann frazier Signed-off-by: Greg Kroah-Hartman --- kernel/sched/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -1428,7 +1428,7 @@ void sched_init_numa(void) /* Compute default topology size */ for (i = 0; sched_domain_topology[i].mask; i++); - tl = kzalloc((i + nr_levels) * + tl = kzalloc((i + nr_levels + 1) * sizeof(struct sched_domain_topology_level), GFP_KERNEL); if (!tl) return;