commit | 49c535d9c0e92c60350ddb46358719eefe09f397 | [log] [tgz] |
---|---|---|
author | Ghanan Gowripalan <ghanan@google.com> | Tue Oct 15 20:28:20 2019 +0000 |
committer | CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> | Tue Oct 15 20:28:20 2019 +0000 |
tree | a410ed2d2981ce0bdf5ce35b13c50b88e9e09b56 | |
parent | af352b306f67c5e22144ea8049583c066ca6c34d [diff] |
[netstack2] Fix endpoint double close bug and handle receiving TCP RST immediately This change addresses a bug which leads to an endpoint (that can have references to it by multiple socketImpls) may attempt to cleanup its resources multiple times, resulting in a panic when we attempt to close a closed go channel. The bug: 1) Accept is called on a listening socket. 2) Create an endpoint and a socketImpl referencing the endpoint, return the socketImpl. 3) Receive a TCP RST which closes the endpoint (it only had a ref count of 1 which drops to 0 so it gets closed). 4) Clone the socketImpl which results in a new socketImpl but with a reference to the original endpoint (the ref count of the endpoint increases to 1). 5) Close the new socketImpl (which closes the endpoint again since the ref count drops back to 0). Step 5 is where the bug occurs (before this change, the cleanup would would be done twice). This change also addresses another bug where a TCP connection may be closed immediately after being accepted (receiving a TCP RST on an endpoint that was just Accepted but not yet returned to the caller of Accept). Test: Test that closing an endpoint twice will not result in a panic. Bug: 37475 Change-Id: Ie19f45cb2d864ee13f64ae1685eaa205a3802a46
Pink + Purple == Fuchsia (a new operating system)
Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.
Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.
See Getting Started.
See fuchsia.dev.