Page MenuHomeFreeBSD

ktls: Close a race with setting so_error when dropping a connection.
ClosedPublic

Authored by jhb on Dec 13 2022, 11:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 29, 8:54 AM
Unknown Object (File)
Fri, Nov 8, 1:04 PM
Unknown Object (File)
Nov 2 2024, 2:40 AM
Unknown Object (File)
Oct 5 2024, 4:28 AM
Unknown Object (File)
Oct 2 2024, 8:34 AM
Unknown Object (File)
Sep 18 2024, 9:06 AM
Unknown Object (File)
Sep 18 2024, 5:36 AM
Unknown Object (File)
Sep 17 2024, 5:16 PM
Subscribers

Details

Summary

pr_abort calls tcp_usr_abort which calls tcp_drop with ECONNABORTED.
After pr_abort returns, the so_error is then set to a more specific
error. However, a reader can observe and return the ECONNABORTED
error before so_error is set to the desired error value. This is
resulting in spurious test failures of recently added tests for
invalid conditions such as invalid headers.

To fix, refactor the code to abort a connection to call tcp_drop
directly with the desired error value. ktls_reset_send_tag already
calls tcp_drop directly when it aborts a connection due to an error.

Reported by: CI (jenkins), gallatin, olivier
Sponsored by: Chelsio Communications

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable