Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3285092ybb; Tue, 31 Mar 2020 02:05:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtXNeoCS6OiqI4k/eqbWoQthGm7luwtow7tfwjqAM0KddeSZbTYK0LolFWgZ/bnje/rhyP6 X-Received: by 2002:aca:4e57:: with SMTP id c84mr1332403oib.148.1585645550546; Tue, 31 Mar 2020 02:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645550; cv=none; d=google.com; s=arc-20160816; b=UUVkC2ARmuTWzu/UU3lXrfbXBM8CsSzcgdUgXaoB+LYKbN84K+3IKZ+iYrDSAYOGtu l3P3TUHlPhCwroJyzojs51iQ6W/xXFT4cA7MNDsSUE6mw5DOwpwasa+hHTQnObujeNcq Lc6HRdIRPbtV4OoNO2l/ze58Vz8wTKZb33ijXrN0UE9k4uYR2Fyvfi41s0U0aAY2vsLV Jds08qDh+zttOe1rgknaKz11QUDe5OTJzHEAgXWO0RtXspGPccm50/FQSJJ23ZwqeX4g K/gi18RU7TxeUVjBlApdJsxLwoOGWz208YsHtqn0OGOvx/9TlQUTnK+Q8BFqQfyochw9 8AcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VFnfAJBCF+XYd8n6lWJPS2HW6wux5dtZiu4T6zp4lOo=; b=Fjg4ZISOGOkGdLK1BJIXouiJThS8rY2KuoYn6fgbL+YUWwkIPkTlbdxUftyTqY0jds ARv9JFMUbMSs0B8e4P4qp0e95Kzb3mefrf+fYzaarKlMdGa/nGRGcdZ1ftT3piNJwrqb 13i84MplGaesz7mIK2mBdt3V/suKZ/j97TxKBtkIG6A2aIv2y416VKSd75BAd3xMp4yx Bi7n2S1NvWH8W8fBszQ9mZZBfwKiTQb8X75TwsM79Q6O1r7uop2fLsEwrN3b/Fb0/tMP 16losqkpVuOXI6hegnPYJe2F7yd5StEhLXPCkABqscZzrnNyoscm3HHMbC6Y7ACWS2gk HhmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sptUVzw0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p189si6706262oic.178.2020.03.31.02.05.38; Tue, 31 Mar 2020 02:05:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sptUVzw0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730964AbgCaJEa (ORCPT + 99 others); Tue, 31 Mar 2020 05:04:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:44752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730662AbgCaJE1 (ORCPT ); Tue, 31 Mar 2020 05:04:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 16CAF208E0; Tue, 31 Mar 2020 09:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645466; bh=av6Q11LrCmng11HhAnFQiGI6yq6s3dI1mlFBfB9NFtM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sptUVzw01LYuca/eFpwuMVbR3Hdad3eUc5UzuzrGayX7uR0Ekk8orxxe86jmbE9Zs F3F5C0SHzojmJFp/5ElhZbXx1Ok/ZXVGXVjzeiYkSoEo4Dfzx1AT1i4AfHaqNfgnV1 g9nqVZq3vsIuxOSvIJcuDxH2R0wlhUZjbOxjIg2Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tariq Toukan , Boris Pismenny , Saeed Mahameed , "David S. Miller" Subject: [PATCH 5.5 062/170] net/mlx5e: kTLS, Fix TCP seq off-by-1 issue in TX resync flow Date: Tue, 31 Mar 2020 10:57:56 +0200 Message-Id: <20200331085431.087051249@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tariq Toukan [ Upstream commit 56917766def72f5afdf4235adb91b6897ff26d9d ] We have an off-by-1 issue in the TCP seq comparison. The last sequence number that belongs to the TCP packet's payload is not "start_seq + len", but one byte before it. Fix it so the 'ends_before' is evaluated properly. This fixes a bug that results in error completions in the kTLS HW offload flows. Fixes: ffbd9ca94e2e ("net/mlx5e: kTLS, Fix corner-case checks in TX resync flow") Signed-off-by: Tariq Toukan Reviewed-by: Boris Pismenny Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c @@ -218,7 +218,7 @@ tx_sync_info_get(struct mlx5e_ktls_offlo * this packet was already acknowledged and its record info * was released. */ - ends_before = before(tcp_seq + datalen, tls_record_start_seq(record)); + ends_before = before(tcp_seq + datalen - 1, tls_record_start_seq(record)); if (unlikely(tls_record_is_start_marker(record))) { ret = ends_before ? MLX5E_KTLS_SYNC_SKIP_NO_DATA : MLX5E_KTLS_SYNC_FAIL;