quic: fix channel leak when ossl_quic_provide_initial_secret fails#30612
Closed
programsurf wants to merge 1 commit into
Closed
quic: fix channel leak when ossl_quic_provide_initial_secret fails#30612programsurf wants to merge 1 commit into
programsurf wants to merge 1 commit into
Conversation
In port_bind_channel(), when ossl_quic_provide_initial_secret() fails, the function returns without freeing the QUIC_CHANNEL that was just created by port_make_channel(). The caller sees new_ch == NULL and cannot free it, leaking the channel and all its sub-allocations (QRX, QTX, TXP, ACKM). Add ossl_quic_channel_free(ch) before the early return, matching the cleanup pattern already used by the other error paths in the same function (lines 864, 873). CWE-401 Reported-by: Sunwoo Lee <sunwoolee@kentech.ac.kr> CLA: trivial
2337f2c to
31c270a
Compare
Sashan
approved these changes
Mar 27, 2026
Sashan
left a comment
Contributor
There was a problem hiding this comment.
yes, looks good. thank you.
2 tasks
t8m
requested changes
Apr 8, 2026
esyr
approved these changes
Apr 8, 2026
t8m
approved these changes
Apr 8, 2026
Member
|
|
Collaborator
|
24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually. |
openssl-machine
pushed a commit
that referenced
this pull request
Apr 15, 2026
In port_bind_channel(), when ossl_quic_provide_initial_secret() fails, the function returns without freeing the QUIC_CHANNEL that was just created by port_make_channel(). The caller sees new_ch == NULL and cannot free it, leaking the channel and all its sub-allocations (QRX, QTX, TXP, ACKM). Add ossl_quic_channel_free(ch) before the early return, matching the cleanup pattern already used by the other error paths in the same function (lines 864, 873). CWE-401 Reported-by: Sunwoo Lee <sunwoolee@kentech.ac.kr> CLA: trivial Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org> Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.foundation> MergeDate: Wed Apr 15 10:44:51 2026 (Merged from #30612)
openssl-machine
pushed a commit
that referenced
this pull request
Apr 15, 2026
In port_bind_channel(), when ossl_quic_provide_initial_secret() fails, the function returns without freeing the QUIC_CHANNEL that was just created by port_make_channel(). The caller sees new_ch == NULL and cannot free it, leaking the channel and all its sub-allocations (QRX, QTX, TXP, ACKM). Add ossl_quic_channel_free(ch) before the early return, matching the cleanup pattern already used by the other error paths in the same function (lines 864, 873). CWE-401 Reported-by: Sunwoo Lee <sunwoolee@kentech.ac.kr> CLA: trivial Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org> Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.foundation> MergeDate: Wed Apr 15 10:47:50 2026 (Merged from #30612)
openssl-machine
pushed a commit
that referenced
this pull request
Apr 15, 2026
In port_bind_channel(), when ossl_quic_provide_initial_secret() fails, the function returns without freeing the QUIC_CHANNEL that was just created by port_make_channel(). The caller sees new_ch == NULL and cannot free it, leaking the channel and all its sub-allocations (QRX, QTX, TXP, ACKM). Add ossl_quic_channel_free(ch) before the early return, matching the cleanup pattern already used by the other error paths in the same function (lines 864, 873). CWE-401 Reported-by: Sunwoo Lee <sunwoolee@kentech.ac.kr> CLA: trivial Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org> Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.foundation> MergeDate: Wed Apr 15 10:48:05 2026 (Merged from #30612)
Contributor
|
Merged to labeled branches. Thank you for the contribution! |
openssl-machine
pushed a commit
that referenced
this pull request
Apr 15, 2026
In port_bind_channel(), when ossl_quic_provide_initial_secret() fails, the function returns without freeing the QUIC_CHANNEL that was just created by port_make_channel(). The caller sees new_ch == NULL and cannot free it, leaking the channel and all its sub-allocations (QRX, QTX, TXP, ACKM). Add ossl_quic_channel_free(ch) before the early return, matching the cleanup pattern already used by the other error paths in the same function (lines 864, 873). CWE-401 Reported-by: Sunwoo Lee <sunwoolee@kentech.ac.kr> CLA: trivial Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org> Reviewed-by: Saša Nedvědický <sashan@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.foundation> MergeDate: Wed Apr 15 10:48:21 2026 (Merged from #30612)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In port_bind_channel(), when ossl_quic_provide_initial_secret()
fails, the function returns without freeing the QUIC_CHANNEL
that was just created by port_make_channel(). The caller sees
new_ch == NULL and cannot free it, leaking the channel and all
its sub-allocations (QRX, QTX, TXP, ACKM).
Add ossl_quic_channel_free(ch) before the early return, matching
the cleanup pattern already used by the other error paths in the
same function (lines 864, 873).
CWE-401
Reported-by: Sunwoo Lee sunwoolee@kentech.ac.kr
CLA: trivial
Checklist