Skip to content

multi: adjust the cleanup order in multi_done - #23370

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/multi-done-order
Closed

bagder wants to merge 1 commit into
masterfrom
bagder/multi-done-order

Conversation

@bagder

@bagder bagder commented Oct 12, 2026

Copy link
Copy Markdown
Member

No description provided.

@bagder
bagder requested a balanced review from Copilot October 12, 2026 05:41
@bagder
bagder marked this pull request as ready for review October 12, 2026 05:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused cleanup-order change is consistent with connection lifecycle requirements and has no identified correctness issues.

0 open findings

What changed in this PR

Adjusts transfer teardown in multi_done() to release resources in a safer order.

Changes:

  • Completes request cleanup before notifying connection filters.
  • Schedules pending transfers after returning the connection to the pool.
File Description
lib/​multi.c Reorders request, filter, connection-pool, and pending-transfer cleanup.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@bagder bagder closed this in 8b0744a Oct 12, 2026
@bagder
bagder deleted the bagder/multi-done-order branch October 12, 2026 05:55
jeroen added a commit to autobrew/libcurl that referenced this pull request Oct 14, 2026
Backport of upstream commit 8b0744a
(curl#23370). Inform connection filters that the transfer is done
only after Curl_req_done(), right before the connection is detached, so
they give up references to `data` last. Process pending handles only
after the connection has been returned to the pool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jeroen added a commit to autobrew/libcurl that referenced this pull request Oct 14, 2026
Backport of upstream commit 8b0744a
("multi: adjust the cleanup order in multi_done", curl#23370).

Inform connection filters that the transfer is done only after
Curl_req_done(), right before the connection is detached, so they give
up references to `data` last. Process pending handles only after the
connection has been returned to the pool.

https://curl.se/docs/CVE-2026-92392.html

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dkarpov1970 pushed a commit to dkarpov1970/curl that referenced this pull request Nov 18, 2026
Closes curl#23370

Backport notes:

- CVE-2026-92392 (HTTP/2 upload use-after-free): the fix is kept
  whole. Curl_conn_ev_data_done() now runs after Curl_req_done(), and
  pending handles are rescheduled after the connection is handled.

- lib/multi.c: the release detaches the connection inside
  multi_done_locked() via Curl_cpool_do_locked(), so the reordering is
  applied around that call.

- Not taken: upstream's "if(conn)" and "if(data->multi)" guards and
  the moved mdctx declaration.

(cherry picked from commit 8b0744a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants