Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1903131pxb; Mon, 13 Sep 2021 07:51:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxkrV5CmfuyBp+4eOo2+5r26Pr5/4VEjOwciao/pxnDQ5AO/hnNeqmVGPaFQsMZXaj99sS X-Received: by 2002:a05:6402:40ce:: with SMTP id z14mr13502956edb.28.1631544712607; Mon, 13 Sep 2021 07:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631544712; cv=none; d=google.com; s=arc-20160816; b=OOAGyNwdGDCVh5E2VbS6wbhuU/GxAJnnO5F1ysLOCThRU5Yl5xZtVHOl8k7qtzZpnA w6rHDskGhM+ZEC6IXttNQT4Hu4w7AxNUEyAvQFRLko7OUV2m8waOu1YQcQSPLn/etEMz 0QES4GjO5kdB5v88PBkRN7g1g8HKH0VB2SzbIobzo3J7te3aAjyu/Na2DxtTKLcac4/V PqqTHGAISl1DKk9zaMVBvR997FQk+mZvInthRrJQ9o3xBtaPuu6jLzC2SCOiVILnGY5O OUcgM5iZriiazoU9UHGCX3cam9v0Fqms1ZK1AXEfuiXbFJP9ng8Acm3b2vv2KlRf0l2H gXIQ== 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=PCPgWt0R7Ku35p9Mt62oevndwmBBmrv6jrV8FN59obQ=; b=i2SuWu+9Z4EMbUysncFGsd6qAjq0JzNFoV+PmqA6DGDo7Mp6qDTn7OnfJMpQqHZuDW luLYU2LxgcLIxEx30ldwad72e6L7uCSG05XYJ2cNRzCAwDn8x2SyItMVVyCda5AUsp94 eUOiGNpJnbpXNQR48Z3RpxLv2ohEmraGNQ6Fa3zGkYRpW7Xd78KzJnCDMdmI4Vi5kHse p0EiL9xXYm5bgED6G3+HHUGHsRDpuEfwTkgWAMliMyKzNPojsU9+NmQKKdlR6hw6pWHE 99mCVni2X0OpPYJsBwBbRpnJzlfLeoDGoUa7wwCdUHhFf7lac04JRvmWfUg46GcW22Fv 3Hkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VH3C0IvQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r14si7239613edx.110.2021.09.13.07.51.28; Mon, 13 Sep 2021 07:51:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VH3C0IvQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347821AbhIMOty (ORCPT + 99 others); Mon, 13 Sep 2021 10:49:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:60786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347696AbhIMOmc (ORCPT ); Mon, 13 Sep 2021 10:42:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 591996320D; Mon, 13 Sep 2021 13:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541422; bh=dSlxYLHXLnrSxyri/2CQBJVQSOGx2GRAbEKW4oBNzhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VH3C0IvQl0jDSNOjHBZF4sUw7l8xOHzpOhDT167nfHphqWGMiyShtYb4N7Vd0hR2W mLBJu7/GkZCOazwrH/McQb2GLpujuiAPkMmtVfsC7seXEy+WrNWrefqaFQ7RZf5QHR CzlwozU2vsyA6oJDbIBpL0U/9KrBm84KMrVcj0w0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacob Keller , Gurucharan G , Tony Nguyen , Sasha Levin Subject: [PATCH 5.14 274/334] ice: fix Tx queue iteration for Tx timestamp enablement Date: Mon, 13 Sep 2021 15:15:28 +0200 Message-Id: <20210913131122.690955606@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jacob Keller [ Upstream commit 84c5fb8c4264ec12ef9d21905c562d2297a0234e ] The driver accidentally copied the ice_for_each_rxq iterator when implementing enablement of the ptp_tx bit for the Tx rings. We still load the Tx rings and set the ptp_tx field, but we iterate over the count of the num_rxq. If the number of Tx and Rx queues differ, this could either cause a buffer overrun when accessing the tx_rings list if num_txq is greater than num_rxq, or it could cause us to fail to enable Tx timestamps for some rings. This was not noticed originally as we generally have the same number of Tx and Rx queues. Fixes: ea9b847cda64 ("ice: enable transmit timestamps for E810 devices") Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index 9e3ddb9b8b51..f54148fb0e21 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -22,7 +22,7 @@ static void ice_set_tx_tstamp(struct ice_pf *pf, bool on) return; /* Set the timestamp enable flag for all the Tx rings */ - ice_for_each_rxq(vsi, i) { + ice_for_each_txq(vsi, i) { if (!vsi->tx_rings[i]) continue; vsi->tx_rings[i]->ptp_tx = on; -- 2.30.2