From patchwork Sat Oct 22 07:27:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1124169wrr; Sat, 22 Oct 2022 02:35:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6hgIYWD6bj9f4mZeH2UDIVKhApxoNGfJl1VIqcSy2e1RD2dnvV4xOkBbgcg15GOUb4jhjF X-Received: by 2002:aa7:c7d1:0:b0:461:2a82:497e with SMTP id o17-20020aa7c7d1000000b004612a82497emr9543097eds.267.1666431343919; Sat, 22 Oct 2022 02:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666431343; cv=none; d=google.com; s=arc-20160816; b=0ISXrZZS65rGB295Ya2BEuLDtn5V13gJfxMC9Pq5Jx2VN0NAj5MAVOkL6dowAPDYKa QEb6dJrAW0QyajLh42MLnQMcFRYeOZ9awcu5nNIiXi75mO+0DcuUVmNTuFKwDF0i8T+w vtMr4Do7sE2p9i1A+D+uBngFLd/JjTQTobBnc+6dQsX4iWiIABCZCZ9uFQ252WpfNZDU PaWjEwi3gOuAnz1fcW4OA/J2mOrDU8DUnaAYWX4LKmBt3OLuKd6YlhT2beardHlsAd98 26fLc5myRsT5+1w4zJtKLxz0Pib9poFM9JfX/C4HXdYnYDbYfS/RHL3XYKSV/t44d+oU 41cA== 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=hEyQew45tpWxq85aejrVd8Q1QqzFtyP6/KyHIqe5Hlg=; b=zOAk7RlUSi4zut1B6fH5gmup4a1LTzHa4bC1IV6cegJ9d2RuOTOle9E2bAP+PlNXX5 1tuBsvIUdCYXhXJMVi31K/6vu2zvMfdQLFRFFD1gn89kl40rYYry7tYK+csmvMimdq0y guamo10Yy3lo1T8SUKrB9sd5nCL5a/JSGa10kzEKTREBL78XRBwxBaWeF7KNthwFak84 4W/xK5zmNW3zjNozI+4NWhwUqUFveHaJ8ube1xH9YUxmCocOz0w7+0ARDOvNj/8TAQgK 4gib4Q+rNOzesVYboOGOcZyZlh6iKzwSQ17rDMOp35D8CscRcDTwTk7yiMLVZ6ewedtC XnSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s2xGAEsI; 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 cn25-20020a0564020cb900b0045d53f8ea52si17698881edb.1.2022.10.22.02.35.19; Sat, 22 Oct 2022 02:35:43 -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=s2xGAEsI; 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 S230466AbiJVJR0 (ORCPT + 99 others); Sat, 22 Oct 2022 05:17:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231882AbiJVJQj (ORCPT ); Sat, 22 Oct 2022 05:16:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75D6B2E2B94; Sat, 22 Oct 2022 01:31:00 -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 414AD60B09; Sat, 22 Oct 2022 08:01:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35ED7C433C1; Sat, 22 Oct 2022 08:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425707; bh=86sBV2qtfryQCC0tnr7qDvXObYavIWhzE4hrzmMFdMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s2xGAEsI2sVfb7FRSVvjPfYzPWYqa7MnynhUqAwiIHOi4udR9QxUDE0Us36H8aLnS ozkb8M3EnQgdJxUGNugM6mYOD4mKMF52xi2dfnVWRl9gGZIFJZhMhxq8SQvk0RfM10 gqMKuSF9XtlKsPQ1/5tUEmCI3EoEGQhSe9N6Mz2g= 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 5.19 559/717] ice: set tx_tstamps when creating new Tx rings via ethtool Date: Sat, 22 Oct 2022 09:27:18 +0200 Message-Id: <20221022072523.106448179@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747379912656530813?= X-GMAIL-MSGID: =?utf-8?q?1747379912656530813?= 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 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 4efa5e5846e0..4dfdec11ddc1 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--)