]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
port_default_packet_handler() should not attempt to parse QUIC packet
authorAlexandr Nedvedicky <sashan@openssl.org>
Mon, 13 Apr 2026 10:39:25 +0000 (12:39 +0200)
committerNeil Horman <nhorman@openssl.org>
Thu, 16 Apr 2026 22:58:04 +0000 (18:58 -0400)
header when destination connection id is not present. To save CPU cycles.

Issue has been noticed and kindly reported by Dan Carpenter via
openssl-users@ mailing list.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
MergeDate: Thu Apr 16 22:59:33 2026
(Merged from https://github.com/openssl/openssl/pull/30795)

ssl/quic/quic_port.c

index 644b4e0fe55b5792ca3283596d8f79944445c9a3..e9af8b21b21f8495541050e085e682ea1e2bb9c5 100644 (file)
@@ -1599,6 +1599,13 @@ static void port_default_packet_handler(QUIC_URXE *e, void *arg,
     if (!port->allow_incoming)
         goto undesirable;
 
+    /*
+     * packet without destination connection id is invalid/corrupted here.
+     * stop wasting CPU cycles now.
+     */
+    if (dcid == NULL)
+        goto undesirable;
+
     /*
      * We have got a packet for an unknown DCID. This might be an attempt to
      * open a new connection.