Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2932232iog; Mon, 20 Jun 2022 07:45:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vN59pXNa3y55v4r1X/MEIuS0A6bLQYvFLMDm5dyRHV1wbBVEiA+w78aGT67EoXTQ8BKgpJ X-Received: by 2002:a17:90a:bb91:b0:1ec:7062:32cc with SMTP id v17-20020a17090abb9100b001ec706232ccmr21914660pjr.231.1655736331545; Mon, 20 Jun 2022 07:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655736331; cv=none; d=google.com; s=arc-20160816; b=C4I2MYi0zA0+3zu8v1/OTqh3K75zzsi7MqYmTvQ0ygx/nw9+dKweaLRNX2c0p+wg2E eeYk3zOYw6qw1C2JOoMwE9G9+4IzL6Qr34HdsHx0cQfRX7orqwR103Nyhjwta0awotmd XTwMhQ0fJ8wYFwaz1exmvCZOGcaHyU8U4oGBJmO+0uYVgYsbbRo1m8GGO3Ol7g9R4EaP Y74nKFIBbRRRXDtFP7rZBdHdHvmp8w2BccPT39kIR8W5nMKTfXPT90yTIG344+zdpHam A6rhnTAu+MoVFT47oJQLnVDdeFFM6zrlHBXEIcqeFViV4ROnkEU2AmLxMWoBeg2+j2rI OoHQ== 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=cN0HIEWopEmbksdHZv+p1BIdD69/flI0Ncau3/AsXd8=; b=lOTz/MlHRLlY47/WH4SOrYimI+DzIFFSPjDQgRygNpVpIYIzCAF9sFsLsrSrzrGzEu D7AJ2F/qy7Q/af/RxZ8PJXgfjjZqyW8Cy0QL4PhkscRI+G5uY8hXF2knduLSwoRugNu0 aWMA0HBgvXDPvSvBktYRSgzYgdDy86D0Jm/LC1FMehuHxukbDKOpFOIFo427I3VTh73G mNHEjKstnfzSvEnp5kgb4+/U0GckjV71/XFgMo4ZIT5j+jsveZO/j1RcaVSVQrrAAia4 1aFuQ/xfBWKGEc0f1Un6gdIyGbdOjdZ/OH/wyQVrHeobiq+5MkOYFHI2Ci3Rs5oF0b6i dRhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TfzlQwcC; 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 z4-20020a17090a468400b001e85e2bc068si19040283pjf.19.2022.06.20.07.45.18; Mon, 20 Jun 2022 07:45:31 -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=TfzlQwcC; 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 S243503AbiFTM5N (ORCPT + 99 others); Mon, 20 Jun 2022 08:57:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243468AbiFTM4s (ORCPT ); Mon, 20 Jun 2022 08:56:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 678781A068; Mon, 20 Jun 2022 05:55:04 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 0DC99614EB; Mon, 20 Jun 2022 12:55:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04296C341C4; Mon, 20 Jun 2022 12:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655729702; bh=9jDDsgQyQTjlFBuKLov8y6UFAbc1Ox58tCBgC74fWGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TfzlQwcCe+JvNSSgZRNR/jCI1i3Gd2eBAxmZiH0wxGQAHR9G2T2Udjj8VrTp9YcTI YjJRS1m8NiLxm0ToPcdu5eXTCslvu04D3qu+iy5sVhvLap7ia+4/DTC73Kz7MldE60 w4bnSevc7mx3QnVhNCAD+r0rUFZ6Wxd18ZNKkf4I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "David E. Box" , Hans de Goede , Mark Gross , David Arcari , Sasha Levin Subject: [PATCH 5.18 047/141] platform/x86/intel: Fix pmt_crashlog array reference Date: Mon, 20 Jun 2022 14:49:45 +0200 Message-Id: <20220620124730.925164063@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220620124729.509745706@linuxfoundation.org> References: <20220620124729.509745706@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=-7.7 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: David Arcari [ Upstream commit 66cb3a2d7ad0d0e9af4d3430a4f2a32ffb9ac098 ] The probe function pmt_crashlog_probe() may incorrectly reference the 'priv->entry array' as it uses 'i' to reference the array instead of 'priv->num_entries' as it should. This is similar to the problem that was addressed in pmt_telemetry_probe via commit 2cdfa0c20d58 ("platform/x86/intel: Fix 'rmmod pmt_telemetry' panic"). Cc: "David E. Box" Cc: Hans de Goede Cc: Mark Gross Cc: linux-kernel@vger.kernel.org Signed-off-by: David Arcari Reviewed-by: David E. Box Link: https://lore.kernel.org/r/20220526203140.339120-1-darcari@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Sasha Levin --- drivers/platform/x86/intel/pmt/crashlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel/pmt/crashlog.c b/drivers/platform/x86/intel/pmt/crashlog.c index 34daf9df168b..ace1239bc0a0 100644 --- a/drivers/platform/x86/intel/pmt/crashlog.c +++ b/drivers/platform/x86/intel/pmt/crashlog.c @@ -282,7 +282,7 @@ static int pmt_crashlog_probe(struct auxiliary_device *auxdev, auxiliary_set_drvdata(auxdev, priv); for (i = 0; i < intel_vsec_dev->num_resources; i++) { - struct intel_pmt_entry *entry = &priv->entry[i].entry; + struct intel_pmt_entry *entry = &priv->entry[priv->num_entries].entry; ret = intel_pmt_dev_create(entry, &pmt_crashlog_ns, intel_vsec_dev, i); if (ret < 0) -- 2.35.1