lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200429225449.60664-9-saeedm@mellanox.com>
Date:   Wed, 29 Apr 2020 15:54:49 -0700
From:   Saeed Mahameed <saeedm@...lanox.com>
To:     "David S. Miller" <davem@...emloft.net>
Cc:     netdev@...r.kernel.org, Tariq Toukan <tariqt@...lanox.com>,
        Boris Pismenny <borisp@...lanox.com>,
        Saeed Mahameed <saeedm@...lanox.com>
Subject: [net 8/8] net/mlx5e: kTLS, Add resiliency to zero-size record frags in TX resync flow

From: Tariq Toukan <tariqt@...lanox.com>

SKBs of TLS records might have empty zero-sized frags.
Posting a DUMP WQE for such frag would result an error completion.
Add in-driver resiliency and skip such frags.

Fixes: d2ead1f360e8 ("net/mlx5e: Add kTLS TX HW offload support")
Signed-off-by: Tariq Toukan <tariqt@...lanox.com>
Reviewed-by: Boris Pismenny <borisp@...lanox.com>
Signed-off-by: Saeed Mahameed <saeedm@...lanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
index 52a56622034a..a04fa23e1a53 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
@@ -232,9 +232,14 @@ tx_sync_info_get(struct mlx5e_ktls_offload_context_tx *priv_tx,
 	remaining = info->sync_len;
 	while (remaining > 0) {
 		skb_frag_t *frag = &record->frags[i];
+		unsigned int fsz;
+
+		fsz = skb_frag_size(frag);
+		if (unlikely(!fsz))
+			continue;
 
 		get_page(skb_frag_page(frag));
-		remaining -= skb_frag_size(frag);
+		remaining -= fsz;
 		info->frags[i++] = *frag;
 	}
 	/* reduce the part which will be sent with the original SKB */
-- 
2.25.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ