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
Unknown Object (File)
Sat, May 9, 3:40 PM
Unknown Object (File)
Fri, May 8, 1:18 PM
Unknown Object (File)
Mon, Apr 27, 5:56 PM
Unknown Object (File)
Apr 15 2026, 9:18 AM
Unknown Object (File)
Apr 12 2026, 9:37 PM
Unknown Object (File)
Apr 12 2026, 12:04 AM
Unknown Object (File)
Apr 10 2026, 10:09 AM
Unknown Object (File)
Apr 1 2026, 2:56 AM
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