Repository navigation
quic: zero-initialize scid and odcid in port_default_packet_handler - #30611
programsurf wants to merge 1 commit into
Conversation
10ae8b5 to
cb09832
Compare
Sashan
left a comment
There was a problem hiding this comment.
Thank you for spotting the issue. IMO the change can be more radical here. the scid is not needed at all at least it seems to me.
thanks for your work.
cb09832 to
97f2ac1
Compare
Remove the scid variable entirely from port_default_packet_handler()
and all functions that accept it as a parameter. The scid was never
used meaningfully — cur_remote_dcid is set later during the handshake.
Remove scid parameter from:
- port_bind_channel()
- port_validate_token()
- ossl_quic_channel_on_new_conn()
- ossl_quic_bind_channel()
- ch_on_new_conn_common()
Remove the cur_remote_dcid = *peer_scid assignment in
ch_on_new_conn_common() as it wrote dead data.
CWE-457
Reported-by: Sunwoo Lee <[email protected]>
CLA: trivial
97f2ac1 to
2dba5ff
Compare
There was a problem hiding this comment.
changes look good. thank you very much.
to committers: technically it's a cleanup change, but I think it's worth to be back ported to release branches too. if you agree just add release branch tags. thanks.
EDIT: change/cleanup is relevant to QUIC-server only, the QUIC server has been shipped with 3.5, thus the relevant branches are: 3.5, 3.6 and 4.0 the
|
This pull request is ready to merge |
|
OK with CLA: trivial as it is just removing unused code. |
|
Merged to the master, 4.0, 3.6 and 3.5 branches. Thank you for your contribution. |
Remove the scid variable entirely from port_default_packet_handler()
and all functions that accept it as a parameter. The scid was never
used meaningfully — cur_remote_dcid is set later during the handshake.
Remove scid parameter from:
- port_bind_channel()
- port_validate_token()
- ossl_quic_channel_on_new_conn()
- ossl_quic_bind_channel()
- ch_on_new_conn_common()
Remove the cur_remote_dcid = *peer_scid assignment in
ch_on_new_conn_common() as it wrote dead data.
CWE-457
Reported-by: Sunwoo Lee <[email protected]>
CLA: trivial
Reviewed-by: Saša Nedvědický <[email protected]>
Reviewed-by: Frederik Wedel-Heinen <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Wed Apr 8 10:21:55 2026
(Merged from #30611)
(cherry picked from commit 275dab5)
Remove the scid variable entirely from port_default_packet_handler()
and all functions that accept it as a parameter. The scid was never
used meaningfully — cur_remote_dcid is set later during the handshake.
Remove scid parameter from:
- port_bind_channel()
- port_validate_token()
- ossl_quic_channel_on_new_conn()
- ossl_quic_bind_channel()
- ch_on_new_conn_common()
Remove the cur_remote_dcid = *peer_scid assignment in
ch_on_new_conn_common() as it wrote dead data.
CWE-457
Reported-by: Sunwoo Lee <[email protected]>
CLA: trivial
Reviewed-by: Saša Nedvědický <[email protected]>
Reviewed-by: Frederik Wedel-Heinen <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Wed Apr 8 10:21:55 2026
(Merged from #30611)
(cherry picked from commit 275dab5)
Remove the scid variable entirely from port_default_packet_handler()
and all functions that accept it as a parameter. The scid was never
used meaningfully — cur_remote_dcid is set later during the handshake.
Remove scid parameter from:
- port_bind_channel()
- port_validate_token()
- ossl_quic_channel_on_new_conn()
- ossl_quic_bind_channel()
- ch_on_new_conn_common()
Remove the cur_remote_dcid = *peer_scid assignment in
ch_on_new_conn_common() as it wrote dead data.
CWE-457
Reported-by: Sunwoo Lee <[email protected]>
CLA: trivial
Reviewed-by: Saša Nedvědický <[email protected]>
Reviewed-by: Frederik Wedel-Heinen <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Wed Apr 8 10:21:55 2026
(Merged from #30611)
Remove the scid variable entirely from port_default_packet_handler()
and all functions that accept it as a parameter. The scid was never
used meaningfully — cur_remote_dcid is set later during the handshake.
Remove scid parameter from:
- port_bind_channel()
- port_validate_token()
- ossl_quic_channel_on_new_conn()
- ossl_quic_bind_channel()
- ch_on_new_conn_common()
Remove the cur_remote_dcid = *peer_scid assignment in
ch_on_new_conn_common() as it wrote dead data.
CWE-457
Reported-by: Sunwoo Lee <[email protected]>
CLA: trivial
Reviewed-by: Saša Nedvědický <[email protected]>
Reviewed-by: Frederik Wedel-Heinen <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Wed Apr 8 10:21:55 2026
(Merged from #30611)
(cherry picked from commit 275dab5)
Remove the scid variable entirely from port_default_packet_handler()
and all functions that accept it as a parameter. The scid was never
used meaningfully — cur_remote_dcid is set later during the handshake.
Remove scid parameter from:
- port_bind_channel()
- port_validate_token()
- ossl_quic_channel_on_new_conn()
- ossl_quic_bind_channel()
- ch_on_new_conn_common()
Remove the cur_remote_dcid = *peer_scid assignment in
ch_on_new_conn_common() as it wrote dead data.
CWE-457
Reported-by: Sunwoo Lee <[email protected]>
CLA: trivial
Reviewed-by: Saša Nedvědický <[email protected]>
Reviewed-by: Frederik Wedel-Heinen <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Wed Apr 8 10:21:55 2026
(Merged from openssl#30611)
Imported from OpenSSL (openssl/openssl). Upstream commit: 9648d58ba6ed7b5973c0c9afaec8fa3a3f9808c6 Upstream PR: openssl/openssl#30611 This is a prerequisite for backporting CVE-2026-18798. OpenSSL original commit message From 9648d58ba6ed7b5973c0c9afaec8fa3a3f9808c6 Mon Sep 17 00:00:00 2001 From: Sunwoo Lee <[email protected]> Date: Sat, 28 Mar 2026 08:58:41 +0900 Subject: [PATCH] quic: remove unused scid from port_default_packet_handler Remove the scid variable entirely from port_default_packet_handler() and all functions that accept it as a parameter. The scid was never used meaningfully — cur_remote_dcid is set later during the handshake. Remove scid parameter from: - port_bind_channel() - port_validate_token() - ossl_quic_channel_on_new_conn() - ossl_quic_bind_channel() - ch_on_new_conn_common() Remove the cur_remote_dcid = *peer_scid assignment in ch_on_new_conn_common() as it wrote dead data. CWE-457 Reported-by: Sunwoo Lee <[email protected]> CLA: trivial Reviewed-by: Saša Nedvědický <[email protected]> Reviewed-by: Frederik Wedel-Heinen <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> MergeDate: Wed Apr 8 10:21:55 2026 (Merged from openssl/openssl#30611) (cherry picked from commit 275dab58f07deb08e148e954c096a6d005e2c548)
QUIC_CONN_ID scid and odcid are declared without initialization.
When validate_addr == 0 and the client's Initial has no token,
port_validate_token() is never called, so scid is never written.
The uninitialized scid is passed to port_bind_channel() ->
ossl_quic_channel_on_new_conn(), where garbage data is copied
to ch->cur_remote_dcid.
Zero-initialize both variables to prevent use of uninitialized
memory.
CWE-457
Reported-by: Sunwoo Lee [email protected]
CLA: trivial
Checklist