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 15, 9:16 PM
Unknown Object (File)
Mon, Nov 11, 12:17 PM
Unknown Object (File)
Sun, Nov 10, 10:37 PM
Unknown Object (File)
Sun, Nov 10, 7:27 PM
Unknown Object (File)
Sat, Nov 9, 12:13 PM
Unknown Object (File)
Sat, Nov 9, 8:16 AM
Unknown Object (File)
Fri, Nov 8, 7:07 PM
Unknown Object (File)
Fri, Nov 8, 1:36 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