Mercurial > hg > nginx
annotate auto/lib/zlib/conf @ 9112:d59277dd3d8c
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).
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Mon, 22 May 2023 15:59:42 +0400 |
parents | 78f8ac479735 |
children |
rev | line source |
---|---|
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
320
diff
changeset
|
1 |
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
320
diff
changeset
|
2 # Copyright (C) Igor Sysoev |
4412 | 3 # Copyright (C) Nginx, Inc. |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
320
diff
changeset
|
4 |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
5 |
253
b6793bc5034b
nginx-0.0.2-2004-02-09-10:46:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
6 if [ $ZLIB != NONE ]; then |
297
ee394e997c77
nginx-0.0.3-2004-03-29-21:43:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
295
diff
changeset
|
7 CORE_INCS="$CORE_INCS $ZLIB" |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 |
455 | 9 case "$NGX_CC_NAME" in |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
10 |
6397
78f8ac479735
Win32: simplified and improved handling of MSVC versions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4987
diff
changeset
|
11 msvc | owc | bcc) |
4987
66d001c5378c
Configure: added the NGX_ZLIB define.
Valentin Bartenev <vbart@nginx.com>
parents:
4412
diff
changeset
|
12 have=NGX_ZLIB . auto/have |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
13 LINK_DEPS="$LINK_DEPS $ZLIB/zlib.lib" |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
14 CORE_LIBS="$CORE_LIBS $ZLIB/zlib.lib" |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
15 ;; |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
16 |
6397
78f8ac479735
Win32: simplified and improved handling of MSVC versions.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4987
diff
changeset
|
17 icc) |
4987
66d001c5378c
Configure: added the NGX_ZLIB define.
Valentin Bartenev <vbart@nginx.com>
parents:
4412
diff
changeset
|
18 have=NGX_ZLIB . auto/have |
288
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
19 LINK_DEPS="$LINK_DEPS $ZLIB/libz.a" |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
20 |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
21 # to allow -ipo optimization we link with the *.o but not library |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
22 CORE_LIBS="$CORE_LIBS $ZLIB/adler32.o" |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
23 CORE_LIBS="$CORE_LIBS $ZLIB/crc32.o" |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
24 CORE_LIBS="$CORE_LIBS $ZLIB/deflate.o" |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
25 CORE_LIBS="$CORE_LIBS $ZLIB/trees.o" |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
26 CORE_LIBS="$CORE_LIBS $ZLIB/zutil.o" |
493 | 27 CORE_LIBS="$CORE_LIBS $ZLIB/compress.o" |
288
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
28 |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
29 if [ $ZLIB_ASM != NO ]; then |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
30 CORE_LIBS="$CORE_LIBS $ZLIB/match.o" |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
31 fi |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
32 ;; |
f81d075ad172
nginx-0.0.2-2004-03-14-23:46:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
33 |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
34 *) |
4987
66d001c5378c
Configure: added the NGX_ZLIB define.
Valentin Bartenev <vbart@nginx.com>
parents:
4412
diff
changeset
|
35 have=NGX_ZLIB . auto/have |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
36 LINK_DEPS="$LINK_DEPS $ZLIB/libz.a" |
306
6b91bfbc4123
nginx-0.0.3-2004-04-05-00:32:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
297
diff
changeset
|
37 CORE_LIBS="$CORE_LIBS $ZLIB/libz.a" |
6b91bfbc4123
nginx-0.0.3-2004-04-05-00:32:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
297
diff
changeset
|
38 #CORE_LIBS="$CORE_LIBS -L $ZLIB -lz" |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
39 ;; |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
40 |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
41 esac |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
42 |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
43 else |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
44 |
493 | 45 if [ "$NGX_PLATFORM" != win32 ]; then |
455 | 46 ZLIB=NO |
320
d621239c30f7
nginx-0.0.3-2004-04-18-23:06:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
307
diff
changeset
|
47 |
d621239c30f7
nginx-0.0.3-2004-04-18-23:06:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
307
diff
changeset
|
48 # FreeBSD, Solaris, Linux |
d621239c30f7
nginx-0.0.3-2004-04-18-23:06:02 import
Igor Sysoev <igor@sysoev.ru>
parents:
307
diff
changeset
|
49 |
455 | 50 ngx_feature="zlib library" |
4987
66d001c5378c
Configure: added the NGX_ZLIB define.
Valentin Bartenev <vbart@nginx.com>
parents:
4412
diff
changeset
|
51 ngx_feature_name="NGX_ZLIB" |
455 | 52 ngx_feature_run=no |
53 ngx_feature_incs="#include <zlib.h>" | |
875
7af8276b1c2f
test PCRE in FreeBSD, Linux, and NetBSD
Igor Sysoev <igor@sysoev.ru>
parents:
493
diff
changeset
|
54 ngx_feature_path= |
455 | 55 ngx_feature_libs="-lz" |
56 ngx_feature_test="z_stream z; deflate(&z, Z_NO_FLUSH)" | |
57 . auto/feature | |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
58 |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
59 |
307
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
306
diff
changeset
|
60 if [ $ngx_found = yes ]; then |
455 | 61 CORE_LIBS="$CORE_LIBS $ngx_feature_libs" |
307
ce375c313e96
nginx-0.0.3-2004-04-08-19:58:25 import
Igor Sysoev <igor@sysoev.ru>
parents:
306
diff
changeset
|
62 ZLIB=YES |
455 | 63 ngx_found=no |
3684
4d47a0658e7d
stop ./configure on Win32 if no library sources was specified,
Igor Sysoev <igor@sysoev.ru>
parents:
2893
diff
changeset
|
64 fi |
4d47a0658e7d
stop ./configure on Win32 if no library sources was specified,
Igor Sysoev <igor@sysoev.ru>
parents:
2893
diff
changeset
|
65 fi |
2893
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
875
diff
changeset
|
66 |
3684
4d47a0658e7d
stop ./configure on Win32 if no library sources was specified,
Igor Sysoev <igor@sysoev.ru>
parents:
2893
diff
changeset
|
67 if [ $ZLIB != YES ]; then |
2893
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
875
diff
changeset
|
68 cat << END |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
875
diff
changeset
|
69 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
875
diff
changeset
|
70 $0: error: the HTTP gzip module requires the zlib library. |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
875
diff
changeset
|
71 You can either disable the module by using --without-http_gzip_module |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
875
diff
changeset
|
72 option, or install the zlib library into the system, or build the zlib library |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
875
diff
changeset
|
73 statically from the source with nginx by using --with-zlib=<path> option. |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
875
diff
changeset
|
74 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
875
diff
changeset
|
75 END |
3684
4d47a0658e7d
stop ./configure on Win32 if no library sources was specified,
Igor Sysoev <igor@sysoev.ru>
parents:
2893
diff
changeset
|
76 exit 1 |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
77 fi |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
78 |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
79 fi |