Page MenuHomeFreeBSD

dma: do not busy-loop when a remote closes a plaintext connection
Needs ReviewPublic

Authored by nick_spun.io on Aug 24 2026, 4:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 3, 4:34 PM
Unknown Object (File)
Thu, Oct 1, 6:01 AM
Unknown Object (File)
Wed, Sep 30, 10:38 AM
Unknown Object (File)
Mon, Sep 28, 11:28 PM
Unknown Object (File)
Mon, Sep 28, 1:04 AM
Unknown Object (File)
Sun, Sep 27, 3:47 PM
Unknown Object (File)
Sat, Sep 26, 8:25 PM
Unknown Object (File)
Sat, Sep 12, 12:14 PM
Subscribers
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

read_remote() only treated -1 as a read error on the plaintext path, so
an end-of-file return of 0 left the buffer offsets unchanged and the
parse loop spun without making any progress. A remote that accepts the
connection and hangs up without sending a complete reply therefore
pinned a CPU until the connection timeout expired.

Treat a zero-length read as the closed connection it is. The identical
bug in the SSL_read() branch immediately above was fixed upstream in
2021; the plaintext branch was left behind, and is still reachable
whenever SECURETRANSFER is unset or STARTTLS is in use, since the
greeting before STARTTLS is read in the clear.

Signed-off-by: Nick Price <nprice@FreeBSD.org>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76042
Build 72925: arc lint + arc unit