]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ktls: Post receive errors on partially closed sockets.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 28 Dec 2022 00:00:17 +0000 (16:00 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Wed, 28 Dec 2022 00:00:17 +0000 (16:00 -0800)
commit07be7517270e7cc8f51612efce9e6375ad1fc12e
tree9c4ce13a4c581c1342779c586fab9960de64e5b5
parent7a8d62cd046942ab34fcf282ecbbb0747a08a4ee
ktls: Post receive errors on partially closed sockets.

If an error such as an invalid record or one whose decryption fails is
detected on a socket that has received a RST then ktls_drop() could
ignore the error since INP_DROPPED could already be set.  In this case
soreceive_generic hangs since it does not return from a KTLS socket
with pending encrypted data unless there is an error (so_error) (this
behavior is to ensure that soreceive_generic doesn't return a
premature EOF when there is pending data still being decrypted).

Note that this was a bug prior to
69542f26820b7edb8351398b36edda5299c1db56 as tcp_usr_abort would also
have ignored the error in this case.

Reviewed by: gallatin
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D37775
sys/kern/uipc_ktls.c