From patchwork Wed Oct 19 08:25:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4614 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp211783wrs; Wed, 19 Oct 2022 02:05:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66r2edJfdOOPY/yIEVxcT4uy52ngCq/DFnXyYrxqKbQiaFzEpV+TzfTaYUBJOQfDvDECyx X-Received: by 2002:a17:90b:278c:b0:20a:e1e6:5340 with SMTP id pw12-20020a17090b278c00b0020ae1e65340mr44081209pjb.239.1666170341562; Wed, 19 Oct 2022 02:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170341; cv=none; d=google.com; s=arc-20160816; b=HznolsyTy3AOeHAebXeR/tx3qBHBOBSVNU1svxoJ8ZlQ0OA20f6ce3RAn+oxT7Sgo+ Vmw4ryqvxTXHu7xCZDJUsl/byCOyXZZFv2Ra/vnj2HGgwxsT02xFg0cfnMSCLj7aPeia 29AkffQUvNaFTQgVh6e1/O9c5JKLvEJh7xymRw2QuyFf4Gic/LKt1I41YLcfPjZSsV5U cDeDoI/Ny1asvQQztMOZ4P86iEGaCHb5Z8m4+xiciekVUn/lUXy07nymNrfmCm+Pfzrd e9enGdBmFhIxl2c3Oxfu9iDSSMhbRxgu1mqgejRxcfQUX0e3IoUlF8PvpJquidYDWiFX xSCA== 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=Dinhm7mmZsD6dyhoitb5wMIGMjmqdcpeoumbhgKIkgc=; b=ulKHscHs2O29zRtxZ9AqRHtKCMsyH215t4w42l0PwkbweDOe8zzOC7gTS9AZmCffyv du1FgRRUdCgHZuwRMHvZoaKUwLoB355s99cRuJs3UrXmE9tMNLSvwydle4HzZJ7XhqFN +R85hSXLlxA41P3uHpdURqH1XUtT/ljOnm4/cHzszV1NLTfzl0JbsOMLVoodaYflpr3f RfnTIZq+tXNdXWj42m5JGgx8uMQn82TK86ntOKZtwug9ydDIQGblcx2O0BhCzKcF3av3 votRhUgLWmOcswR/Xj98hhQp2p9HpPatgWgAFTUIHRT1aPwuUMz2xgVZj0n5z9jr1bhr 5WCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KLmLx3Ef; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020a17090322c400b0017824f38242si22172954plg.75.2022.10.19.02.05.21; Wed, 19 Oct 2022 02:05:41 -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=KLmLx3Ef; 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 S231697AbiJSIx3 (ORCPT + 99 others); Wed, 19 Oct 2022 04:53:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231688AbiJSIwj (ORCPT ); Wed, 19 Oct 2022 04:52:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 520A06612E; Wed, 19 Oct 2022 01:50:17 -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 CF44E61841; Wed, 19 Oct 2022 08:49:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3E4EC433D6; Wed, 19 Oct 2022 08:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169352; bh=bxtpQ4/L1xjeH5XzKzquZqmtyjODMESCyeL/P6ddsBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KLmLx3Ef95mqG9SJIxpYQfXouo6+Bznom2M9G8h7h9mXVhGwbONB4O7c+MPGV2bGa IAJPU1pXFHhXGG0mJGMWK4OmTEgU7Em/xWYJoIW9ODBt8oy6r3kQ9OQbi5xhZQDzIJ IsQgPPnFwgKO/aYZ7UROS1j8zNqthqDdodZ6ZNg8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacob Keller , Tony Nguyen , Sasha Levin , Gurucharan Subject: [PATCH 6.0 245/862] ice: set tx_tstamps when creating new Tx rings via ethtool Date: Wed, 19 Oct 2022 10:25:32 +0200 Message-Id: <20221019083300.840724575@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106232118522453?= X-GMAIL-MSGID: =?utf-8?q?1747106232118522453?= From: Jacob Keller [ Upstream commit b3b173745c8cab1e24d6821488b60abed3acb24d ] When the user changes the number of queues via ethtool, the driver allocates new rings. This allocation did not initialize tx_tstamps. This results in the tx_tstamps field being zero (due to kcalloc allocation), and would result in a NULL pointer dereference when attempting a transmit timestamp on the new ring. Signed-off-by: Jacob Keller Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Stable-dep-of: fc5ae5b44eb2 ("Bluetooth: L2CAP: Fix build errors in some archs") Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_ethtool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c index a6fff8ebaf9d..bbf6a300078e 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -2826,6 +2826,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring, tx_rings[i].count = new_tx_cnt; tx_rings[i].desc = NULL; tx_rings[i].tx_buf = NULL; + tx_rings[i].tx_tstamps = &pf->ptp.port.tx; err = ice_setup_tx_ring(&tx_rings[i]); if (err) { while (i--)