The official NGINX Open Source repository.
Go to file
Roman Arutyunyan 5ac9da4577 QUIC: fixed post-close use-after-free.
Previously, ngx_quic_close_connection() could be called in a way that QUIC
connection was accessed after the call.  In most cases the connection is not
closed right away, but close timeout is scheduled.  However, it's not always
the case.  Also, if the close process started earlier for a different reason,
calling ngx_quic_close_connection() may actually close the connection.  The
connection object should not be accessed after that.

Now, when possible, return statement is added to eliminate post-close connection
object access.  In other places ngx_quic_close_connection() is substituted with
posting close event.

Also, the new way of closing connection in ngx_quic_stream_cleanup_handler()
fixes another problem in this function.  Previously it passed stream connection
instead of QUIC connection to ngx_quic_close_connection().  This could result
in incomplete connection shutdown.  One consequence of that could be that QUIC
streams were freed without shutting down their application contexts.  This could
result in another use-after-free.

Found by Coverity (CID 1530402).
2023-05-22 15:59:42 +04:00
auto Stream: removed QUIC support. 2023-05-14 12:05:35 +04:00
conf MIME: added image/avif type. 2021-10-25 20:49:15 +03:00
contrib Contrib: vim syntax, update core and 3rd party module directives. 2022-06-18 15:54:40 +03:00
docs Year 2023. 2023-04-17 14:07:59 +04:00
misc Added stream modules realip and ssl_preread to win32 builds. 2023-04-17 14:08:00 +04:00
src QUIC: fixed post-close use-after-free. 2023-05-22 15:59:42 +04:00
.hgtags release-1.23.4 tag 2023-03-28 18:01:54 +03:00