diff options
author | Bhasker Hariharan <bhaskerh@google.com> | 2021-07-01 14:39:20 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-07-01 14:42:00 -0700 |
commit | 570ca571805d6939c4c24b6a88660eefaf558ae7 (patch) | |
tree | 50b36e53b2b692a72dc135d3ec1aa3db58fb5b05 /pkg/hostarch | |
parent | 3d4a8824f8e7aafdf6c1d18822b7593fa2e3e6bb (diff) |
Fix bug with TCP bind w/ SO_REUSEADDR.
In gVisor today its possible that when trying to bind a TCP socket
w/ SO_REUSEADDR specified and requesting the kernel pick a port by
setting port to zero can result in a previously bound port being
returned. This behaviour is incorrect as the user is clearly requesting
a free port. The behaviour is fine when the user explicity specifies
a port.
This change now checks if the user specified a port when making a port
reservation for a TCP port and only returns unbound ports even if
SO_REUSEADDR was specified.
Fixes #6209
PiperOrigin-RevId: 382607638
Diffstat (limited to 'pkg/hostarch')
0 files changed, 0 insertions, 0 deletions