Skip to content

tlshd: Release key and certs on QUIC client x509 setup failure#158

Merged
chucklever merged 1 commit into
oracle:mainfrom
chucklever:tlshd-quic-client-x509-leak
Jun 22, 2026
Merged

tlshd: Release key and certs on QUIC client x509 setup failure#158
chucklever merged 1 commit into
oracle:mainfrom
chucklever:tlshd-quic-client-x509-leak

Conversation

@chucklever

Copy link
Copy Markdown
Member

The QUIC client x509 session setup returns early on a cert or private
key retrieval failure without releasing the certificates and key that
were already loaded into the module globals, leaking them.

This is the client-side counterpart to the QUIC server path fixed in
#157: route the failure through the cleanup label so it reaches
tlshd_x509_client_put_privkey() and tlshd_x509_client_put_certs(),
splitting the err: label so the configuration-failure path does not
log an uninitialized ret.

When tlshd_x509_client_get_certs() or tlshd_x509_client_get_privkey()
fails while preparing a QUIC client x509 session, the early return
exits without releasing the module-global certificates and private
key that were already loaded, leaking them.  The TLS and QUIC server
paths route such failures through their cleanup labels, which call
the put_privkey() and put_certs() helpers; only the QUIC client path
took a bare return.

Route the failure through the cleanup path as the others do.  Split
the err: label so the configuration-failure path skips
tlshd_log_gnutls_error(), which would otherwise read an uninitialized
ret, and reaches only put_privkey() and put_certs() under a new
err_config: label.

Fixes: 43a15fe ("tlshd: add support for quic handshake")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
@chucklever chucklever merged commit dba1bd1 into oracle:main Jun 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant