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)
Tue, Apr 16, 4:07 PM
Unknown Object (File)
Feb 5 2024, 4:30 PM
Unknown Object (File)
Dec 20 2023, 6:05 AM
Unknown Object (File)
Dec 12 2023, 1:42 PM
Unknown Object (File)
Aug 26 2023, 5:08 PM
Unknown Object (File)
Aug 14 2023, 10:28 AM
Unknown Object (File)
Jul 6 2023, 1:01 PM
Unknown Object (File)
Jul 1 2023, 6:59 AM
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