Page MenuHomeFreeBSD

[unix(4) cleanup 8/8] Fix a double connect race.
AbandonedPublic

Authored by markj on Sep 2 2020, 5:01 PM.
Tags
None
Referenced Files
F149399736: D26301.diff
Tue, Mar 24, 5:02 AM
Unknown Object (File)
Mon, Mar 9, 3:34 AM
Unknown Object (File)
Sun, Mar 1, 2:50 PM
Unknown Object (File)
Feb 20 2026, 3:48 PM
Unknown Object (File)
Feb 19 2026, 6:38 PM
Unknown Object (File)
Feb 19 2026, 3:32 PM
Unknown Object (File)
Jan 2 2026, 5:11 PM
Unknown Object (File)
Dec 11 2025, 8:53 PM
Subscribers

Details

Reviewers
None
Summary

dgram sockets may be connected multiple times. If connect() is called
on a connected dgram socket, soconnectat() calls sodisconnect() before
creating the new connection. However, this is not synchronized, so two
concurrent connect() calls can race with each other, and uipc_connect()
does not handle it. Add an explicit check for unp_conn != NULL in
unp_connectat().

Reported by: syzkaller

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33333
Build 30644: arc lint + arc unit