]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: tls: fix returned read length with async decrypt
authorJakub Kicinski <kuba@kernel.org>
Wed, 7 Feb 2024 01:18:24 +0000 (17:18 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Feb 2024 21:38:19 +0000 (21:38 +0000)
We double count async, non-zc rx data. The previous fix was
lucky because if we fully zc async_copy_bytes is 0 so we add 0.
Decrypted already has all the bytes we handled, in all cases.
We don't have to adjust anything, delete the erroneous line.

Fixes: 4d42cd6bc2ac ("tls: rx: fix return value for async crypto")
Co-developed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c

index a6eff21ade23edd95b7d74dcc334bd12dfab5213..9fbc70200cd0f9057b2e34ea3170c001fc4f972c 100644 (file)
@@ -2132,7 +2132,6 @@ int tls_sw_recvmsg(struct sock *sk,
                else
                        err = process_rx_list(ctx, msg, &control, 0,
                                              async_copy_bytes, is_peek);
-               decrypted += max(err, 0);
        }
 
        copied += decrypted;