Skip to content

multi: fix bad splay management#18201

Closed
bagder wants to merge 1 commit intomasterfrom
bagder/multi-splay
Closed

multi: fix bad splay management#18201
bagder wants to merge 1 commit intomasterfrom
bagder/multi-splay

Conversation

@bagder
Copy link
Member

@bagder bagder commented Aug 6, 2025

The splay tree is a tree where each easy handle can be added once. The expire time for that node is the closes expire time for that easy handle.

Easy handles can however have more expire times queued up, so when the node is removed from the splay tree because it is the next in line to take care of, we must check if there is another expire time in the queue and then add the node back into the splay.

Failing to do the later part, the calling of add_next_timeout after Curl_splaygetbest, would leave the state.expiretime on the previous time stamp, which when could make the next call to Curl_splaygetbest use the wrong time stamp and get a wrong node out, causing trouble.

Reported-by: letshack9707 on hackerone

The splay tree is a tree where each easy handle can be added *once*. The
expire time for that node is the closes expire time for that easy
handle.

Easy handles can however have more expire times queued up, so when the
node is removed from the splay tree because it is the next in line to
take care of, we must check if there is another expire time in the queue
and then add the node back into the splay.

Failing to do the later part, the calling of add_next_timeout after
Curl_splaygetbest, would leave the state.expiretime on the previous time
stamp, which when could make the next call to Curl_splaygetbest use the
wrong time stamp and get a wrong node out, causing trouble.

Reported-by: letshack9707 on hackerone
@bagder bagder marked this pull request as ready for review August 6, 2025 12:13
@bagder bagder closed this in 019991c Aug 6, 2025
@bagder bagder deleted the bagder/multi-splay branch August 6, 2025 12:14
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.

2 participants