Skip to content

Commit c43ac97

Browse files
Jakub Kicinskidavem330
authored andcommitted
net: tls: prevent false connection termination with offload
Only decrypt_internal() performs zero copy on rx, all paths which don't hit decrypt_internal() must set zc to false, otherwise tls_sw_recvmsg() may return 0 causing the application to believe that that connection got closed. Currently this happens with device offload when new record is first read from. Fixes: d069b78 ("tls: Fix tls_device receive") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Reported-by: David Beckett <david.beckett@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 1b704c4 commit c43ac97

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/tls/tls_sw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,8 @@ static int decrypt_skb_update(struct sock *sk, struct sk_buff *skb,
14841484

14851485
return err;
14861486
}
1487+
} else {
1488+
*zc = false;
14871489
}
14881490

14891491
rxm->full_len -= padding_length(ctx, tls_ctx, skb);

0 commit comments

Comments
 (0)