Projects
home:rottame:vhosts-ng
openssl-1_1
openssl-CVE-2026-84782.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File openssl-CVE-2026-84782.patch of Package openssl-1_1
From e961062f6b86727b63b0381ceeec7fa074026fef Mon Sep 17 00:00:00 2001 From: Ryan Hooper <ryhooper@cisco.com> Date: Wed, 2 Sep 2026 15:15:41 -0400 Subject: [PATCH] dtls: reset init_off before retransmitting a message dtls1_retransmit_message() copies a queued message's saved bytes into s->init_buf and sets s->init_num to its length, but left s->init_off untouched. If a different message was still mid-write (suspended on WANT_WRITE, e.g. because the underlying BIO couldn't take any more) when a retransmit fired, s->init_off would still hold whatever offset that suspended write had reached - and dtls1_do_write() would resume the retransmitted message from that stale, unrelated offset instead of from the start. The result is a corrupted retransmission: the message goes out mislabelled with a bogus fragment offset/length, and its body is whatever bytes happen to sit at that offset in the now-repurposed init_buf - typically leftover content from the other, larger message that was mid-write when the retransmit happened, rather than the message actually meant to be sent. Fix this by always resetting s->init_off to 0 before resending, so every retransmit starts from the beginning of the message being sent, regardless of what any other in-progress write had left behind. dtls1_handle_timeout() also needs a guard: if write_state is anything other than WRITE_STATE_TRANSITION, a write is still parked mid-flight from a previous call into the state machine, so there is nothing valid to retransmit yet. Retransmitting anyway would reconstruct an already-sent message from the retransmit queue into s->init_buf/s->init_off/s->init_num/s->d1->w_msg - the same fields the parked write is still using - corrupting that write's state out from under it. Skip retransmission in that case and let the next SSL_read()/SSL_write()/SSL_accept()/SSL_connect() call resume the parked write normally instead. Add test_dtls_client_retransmit() and test_dtls_server_retransmit() to test/dtlstest.c, covering both directions on DTLS1.2: use a fragment-limiting BIO to suspend a large in-flight write mid-fragment, then fire the retransmit timer several times via DTLSv1_get_timeout()/DTLSv1_handle_timeout() while it stays parked, verifying no retransmission is attempted and the suspended write's state is reproduced unchanged on every timer fire, and that resuming the write afterward completes as an ordinary handshake continuation instead of hitting dtls1_do_write()'s entry assertion. Assited-by: Claude:claude-sonnet-5 Fixes: CVE-2026-84782 --- ssl/d1_lib.c | 17 ++ ssl/statem/statem_dtls.c | 2 + test/dtlstest.c | 416 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 433 insertions(+), 2 deletions(-) Index: openssl-3.1.4/ssl/d1_lib.c =================================================================== --- openssl-3.1.4.orig/ssl/d1_lib.c +++ openssl-3.1.4/ssl/d1_lib.c @@ -403,6 +403,23 @@ int dtls1_handle_timeout(SSL *s) } dtls1_start_timer(s); + + /* + * If write_state is anything other than WRITE_STATE_TRANSITION, a write + * is still parked mid-flight (WANT_WRITE) from a previous call into the + * state machine - the current flight hasn't actually finished going out + * yet, so there's nothing valid to retransmit. Retransmitting anyway + * would reconstruct an already-sent message from the retransmit queue + * into s->init_buf/s->init_off/s->init_num/s->d1->w_msg - the same + * fields the parked write is still using - corrupting that write's + * state out from under it. Leave it alone and let the next + * SSL_read()/SSL_write()/SSL_accept()/SSL_connect() call resume the + * parked write normally instead. + */ + if (s->statem.state == MSG_FLOW_WRITING + && s->statem.write_state != WRITE_STATE_TRANSITION) + return 0; + /* Calls SSLfatal() if required */ return dtls1_retransmit_buffered_messages(s); } Index: openssl-3.1.4/ssl/statem/statem_dtls.c =================================================================== --- openssl-3.1.4.orig/ssl/statem/statem_dtls.c +++ openssl-3.1.4/ssl/statem/statem_dtls.c @@ -1213,6 +1213,8 @@ int dtls1_retransmit_message(SSL *s, uns memcpy(s->init_buf->data, frag->fragment, frag->msg_header.msg_len + header_length); s->init_num = frag->msg_header.msg_len + header_length; + /* Always retransmit from the start, not wherever init_off was left */ + s->init_off = 0; dtls1_set_message_header_int(s, frag->msg_header.type, frag->msg_header.msg_len,
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.