Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2271679pxp; Mon, 21 Mar 2022 15:31:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZK9alo+ymFofUvlQeikg2oynHagUZMMGWGbCSEyuqBGHc6umQtlL8RXk9jkZ8RhSgD0I8 X-Received: by 2002:a05:6a00:a92:b0:4e0:57a7:2d5d with SMTP id b18-20020a056a000a9200b004e057a72d5dmr25896172pfl.81.1647901871589; Mon, 21 Mar 2022 15:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647901871; cv=none; d=google.com; s=arc-20160816; b=yPgxYu/QGrNnhx/iK3U4RLJ1nqwAo2AWcB2ZWB+zmkWYKqrS8ZFsLffI3KeAVwfhU0 uaDQS7kRa9/O5vGr9bSR9XlrgUVH0A8WeLL0Gs/PJvgw3iDi9wZiaCCXG/2G+c7xMlZN pGOMFisW3yrdHktiTeI65yW/mniLq3rvYPhntIr3Zu6hYh+WJG+1L9jpCQwr0GA2WBD5 zypyWsGdCGuV5kOlOoy0AQHxPUO6Srozp0rXnaCfM42ezAIfozzlp2MfkUjJkO6yEm33 b9ZFxgf4dZ2OAVKHeACZA1e1Hdj+fctZEDqeX+IA5BDVHZEs0hWz0U86kdjJLdd5X7Qx ufXw== 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=JF9eV4hFaltNjhOFD2FJzJI4R/ho4QMOtNq0orW1tpOa/u9S5lHSKr9fjGWNmPjj6b I9bDfwxDTuY9yQ9McTCHW4f4JIgYa9R1tHrx0Xd9FO8wkCiApMd/Hcc8v6jJu5ihYaTR muGvSOZWox1yyFZdImysTA5aTlHtLuzvenAioTWggxRFM/44MvGWzcUxjfu6hmf/e6uK bEeme3ZksgzhJY9CB8clzGHAFvpfPo0tejETqVHYDCUCrxuWkkhC0nvmoRbyitDUXIYJ 7LC7b6sIrUp88BtAYW+gw+GijUm5jk6lLIIBZucT7QzgiLLlOD/Cu+D7VbmkNV2tPyrl 4VxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="RbBu5k/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e16-20020a63d950000000b003816043f108si13459836pgj.765.2022.03.21.15.31.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:31:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="RbBu5k/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 369CB264562; Mon, 21 Mar 2022 14:44:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348951AbiCUOET (ORCPT + 99 others); Mon, 21 Mar 2022 10:04:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348427AbiCUN5c (ORCPT ); Mon, 21 Mar 2022 09:57:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19EA0176D3A; Mon, 21 Mar 2022 06:55:24 -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 BC92CB816C7; Mon, 21 Mar 2022 13:55:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0E2CC340E8; Mon, 21 Mar 2022 13:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647870921; bh=4Hl79FCH9ex4jb0RPlHaXMWBQreyKU+jduSJMcs8qDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RbBu5k/ozqf9Ea1qG4Vn5EqEsJmk0b+JkHBQvvop/X5kb/gdgaEeLeh3UVkXUhI9/ GOYlo6dljaH9fMBhBwTIJgaWMbcaVTCdnJAAG6zumIlUlg8O03Qy7d4Hy68P7NdUve pw104+knRx6SwLi6Qod3lwooZ4PwIVkrF2mRsFFw= 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 18/57] sched/topology: Fix sched_domain_topology_level alloc in sched_init_numa() Date: Mon, 21 Mar 2022 14:51:59 +0100 Message-Id: <20220321133222.515538128@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220321133221.984120927@linuxfoundation.org> References: <20220321133221.984120927@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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;