Repository navigation
fix(net): preserve TLS transport and completion ownership - #215
Conversation
Checkpoint the reviewed TLS ownership repair before integrating current main. Native transport takeover, completion custody, shutdown joins, and regression coverage are retained together. The generic TLS retention case still needs qualification; no landing claim is made.
|
Dependency limit exceeded — report not shown. This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report. Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard. Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account. |
|
Hi! I'm the It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃 |
* commit '191755ec115ece3dd642eba3cb0143cecb5e5d7a': fix(tls): enforce current trust before session resumption (#213)
Keep live config destruction and the StartTLS move-before-callback ordering while skipping clears of an already absent large config.
Landing receipt
Merged as d9be087 onto 7b573c0. All 23 changed files have the exact qualified head blobs. The intervening five main-branch changes concern parser/transpiler code and do not overlap this PR. The full landed tree therefore differs from the source qualification tree; qualification remains exact-source evidence, not an exact merged-head rerun. Remote main ancestry was verified.
What changes
TLS wrappers over real sockets can lose pending write completion during teardown. This repairs ownership at the transport boundary: native TLS transports own read/write/shutdown/close delivery, pending writes retain their completion owner, and shutdown joins actual lower-transport completion. Generic Duplex transports remain supported. TLS and HTTP/2 attachments use identity-based removal and attachment-scoped close completion. Traced wrapper edges and bound callbacks replace the permanent startup root while preserving context, abort and transport owners.
Ciphertext completion precedes shutdown, including held close_notify writes and error/destroy completion. The resumed-session follow-up preserves the verifier callback and owner context while rechecking the resumed chain; the main branch already contains #213.
Both absent SSL-config cleanup sites in src/runtime/socket/socket_body.rs check is_some() before set(None). Live configuration destruction and StartTLS move-before-callback ownership remain intact. The opt-in, nonpublishing release dry run verifies source, WebKit, artifact and genuine Node identities and preserves per-file TLS/HTTP/2 reports. No release or consumer pin changes.
This is a partial transport/completion lifetime repair. Complete dropped-cycle collection is not claimed. Its unknown retaining owner remains tracked in #219. The original collection checkpoint and assertions remain unchanged; the experimental relocation was reverted.
Native qualification
Reviewed head: 670b23f.
Its full tree equals qualified source 510fef5 (tree 99b4a8b6b24c4ea171760ebf812ac7ca9911967c). Engine: b82bc917e99110b61c3a21202d6def7457aa194c.
Original retention fixture SHA-256: d4c04a72b89bc7d33c292a16a57c38f5da540815dc2e141adfd58c1bd9973af2.
All six canonical TLS/HTTP/2 files ran on every shipping target:
The six-target build/qualification matrix built all targets and passed both Windows compatibility jobs. Its first four targets completed all six suites. The last two originally stopped after the first suite; macOS replay and Windows ARM64 replay now complete all six files against the exact retained production executables. Both completion regressions pass on both hosts. Every remaining suite passes; there are zero XML errors.
Those replays remain strictly red for the unchanged dropped-cycle assertion at socket-retention.test.ts:545: expected retainedAlive/droppedCollected/releasedCollected=true/true/true, observed true/false/true. No fixture weakening, skip, retry or success exception was added. The Windows-only retry repairs stale Git stat metadata with update-index --refresh before the unchanged clean-index gate; it does not stage content.
Verified replay artifacts:
ZIP identity, safe entries, CRC, all manifest records, archived controls, source/index restoration and raw reports were verified. All 291 cases per replay are accounted for.
Inherited collection failure
The unchanged fixture already fails on the published pre-PR main 191755e / b82 engine on macOS x64, Windows ARM64 and Windows x64: true/false/false in baseline run. These are assertion failures after native execution.
Before the two absent-config guards, exact source 454a78a already produces the current true/false/true result on macOS x64 and Windows ARM64 in run 40897692970. Both completion regressions pass there. Both XML ZIP digests, safe entries, embedded full commit and failure signature were independently verified. This establishes an inherited failing predicate; it does not establish an identical retaining mechanism.
The physical heap/debugger investigation and its limits stay in #219. No scanner or checkpoint workaround is included here.
Regression and review evidence
The Mordant duplication diagnostic remains advisory and red: two generic_body_not_generic findings in Listener.rs against baseline one. The named-pipe initializer gained fields earlier in this PR; connect_finish is unchanged from the base. This is not wholly inherited. A scoped source audit verified empty native callbacks/no queued write owner, caller SSL-context snapshot and matching typed acceptance, and plain-listener rejection of TLS-context replacement. No reachable ownership defect was found; the baseline is unchanged and no unrelated socket-layout refactor is included.