[PATCH 5 of 7] QUIC: ngx_quic_buffer_t use-after-free protection
Maxim Dounin
mdounin at mdounin.ru
Fri May 31 00:58:30 UTC 2024
# HG changeset patch
# User Roman Arutyunyan <arut at nginx.com>
# Date 1716902361 -14400
# Tue May 28 17:19:21 2024 +0400
# Node ID 9e69f2b7026deeed2824422ef64d11e234c05bb1
# Parent 8822af43e7e919b8c903174886c8ffecdb25f017
QUIC: ngx_quic_buffer_t use-after-free protection.
Previously the last chain field of ngx_quic_buffer_t could still reference freed
chains and buffers after calling ngx_quic_free_buffer(). While normally an
ngx_quic_buffer_t object should not be used after freeing, resetting last_chain
field would prevent a potential use-after-free.
diff --git a/src/event/quic/ngx_event_quic_frames.c b/src/event/quic/ngx_event_quic_frames.c
--- a/src/event/quic/ngx_event_quic_frames.c
+++ b/src/event/quic/ngx_event_quic_frames.c
@@ -648,6 +648,7 @@ ngx_quic_free_buffer(ngx_connection_t *c
ngx_quic_free_chain(c, qb->chain);
qb->chain = NULL;
+ qb->last_chain = NULL;
}
More information about the nginx-devel
mailing list