Mercurial > hg > nginx
annotate auto/lib/conf @ 6359:dac6eda40475 stable-1.8
Resolver: fixed use-after-free memory accesses with CNAME.
When several requests were waiting for a response, then after getting
a CNAME response only the last request's context had the name updated.
Contexts of other requests had the wrong name. This name was used by
ngx_resolve_name_done() to find the node to remove the request context
from. When the name was wrong, the request could not be properly
cancelled, its context was freed but stayed linked to the node's waiting
list. This happened e.g. when the first request was aborted or timed
out before the resolving completed. When it completed, this triggered
a use-after-free memory access by calling ctx->handler of already freed
request context. The bug manifests itself by
"could not cancel <name> resolving" alerts in error_log.
When a request was responded with a CNAME, the request context kept
the pointer to the original node's rn->u.cname. If the original node
expired before the resolving timed out or completed with an error,
this would trigger a use-after-free memory access via ctx->name in
ctx->handler().
The fix is to keep ctx->name unmodified. The name from context
is no longer used by ngx_resolve_name_done(). Instead, we now keep
the pointer to resolver node to which this request is linked.
Keeping the original name intact also improves logging.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Tue, 26 Jan 2016 16:46:59 +0300 |
parents | d620f497c50f |
children | 85dea406e18f |
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:
399
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:
399
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:
399
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 |
481 | 6 if [ $USE_PCRE = YES -o $PCRE != NONE ]; then |
255
e6938ca7331a
nginx-0.0.2-2004-02-09-23:47:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
212
diff
changeset
|
7 . auto/lib/pcre/conf |
2893
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
8 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
9 else |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
10 if [ $USE_PCRE = DISABLED -a $HTTP_REWRITE = YES ]; then |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
11 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
12 cat << END |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
13 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
14 $0: error: the HTTP rewrite module requires the PCRE library. |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
15 You can either disable the module by using --without-http_rewrite_module |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
16 option or you have to enable the PCRE support. |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
17 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
18 END |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
19 exit 1 |
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
20 fi |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
21 fi |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
22 |
2893
da1ba8a5c8c9
stop ./configure at once on library failure
Igor Sysoev <igor@sysoev.ru>
parents:
2892
diff
changeset
|
23 |
477 | 24 if [ $USE_OPENSSL = YES ]; then |
25 . auto/lib/openssl/conf | |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
26 fi |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
27 |
477 | 28 if [ $USE_MD5 = YES ]; then |
29 | |
2892
3e10e2b64007
use md5/sha1 in OpenSSL only if OpenSSL is used
Igor Sysoev <igor@sysoev.ru>
parents:
2788
diff
changeset
|
30 if [ $USE_OPENSSL = YES ]; then |
477 | 31 have=NGX_HAVE_OPENSSL_MD5_H . auto/have |
32 have=NGX_OPENSSL_MD5 . auto/have | |
3895
b659514a3948
an internal MD5 implemenation
Igor Sysoev <igor@sysoev.ru>
parents:
3363
diff
changeset
|
33 have=NGX_HAVE_MD5 . auto/have |
477 | 34 MD5=YES |
2010
bd6cc5370fc1
simplify library autoconfigure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
35 MD5_LIB=OpenSSL |
477 | 36 |
37 else | |
38 . auto/lib/md5/conf | |
39 fi | |
40 | |
399
4e21d1291a14
nginx-0.0.7-2004-07-25-22:34:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
286
diff
changeset
|
41 fi |
4e21d1291a14
nginx-0.0.7-2004-07-25-22:34:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
286
diff
changeset
|
42 |
653 | 43 if [ $USE_SHA1 = YES ]; then |
44 | |
2892
3e10e2b64007
use md5/sha1 in OpenSSL only if OpenSSL is used
Igor Sysoev <igor@sysoev.ru>
parents:
2788
diff
changeset
|
45 if [ $USE_OPENSSL = YES ]; then |
653 | 46 have=NGX_HAVE_OPENSSL_SHA1_H . auto/have |
3922
9c057d5e1c27
"$apr1", "{PLAIN}", and "{SSHA}" password methods in auth basic module
Igor Sysoev <igor@sysoev.ru>
parents:
3895
diff
changeset
|
47 have=NGX_HAVE_SHA1 . auto/have |
653 | 48 SHA1=YES |
2010
bd6cc5370fc1
simplify library autoconfigure
Igor Sysoev <igor@sysoev.ru>
parents:
1949
diff
changeset
|
49 SHA1_LIB=OpenSSL |
653 | 50 |
51 else | |
52 . auto/lib/sha1/conf | |
53 fi | |
54 | |
55 fi | |
56 | |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
57 if [ $USE_ZLIB = YES ]; then |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
58 . auto/lib/zlib/conf |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
59 fi |
599 | 60 |
2139 | 61 if [ $USE_LIBXSLT = YES ]; then |
62 . auto/lib/libxslt/conf | |
63 fi | |
64 | |
2788 | 65 if [ $USE_LIBGD = YES ]; then |
66 . auto/lib/libgd/conf | |
67 fi | |
68 | |
599 | 69 if [ $USE_PERL = YES ]; then |
70 . auto/lib/perl/conf | |
71 fi | |
1949 | 72 |
2985 | 73 if [ $HTTP_GEOIP = YES ]; then |
74 . auto/lib/geoip/conf | |
75 fi | |
3363 | 76 |
1949 | 77 if [ $NGX_GOOGLE_PERFTOOLS = YES ]; then |
78 . auto/lib/google-perftools/conf | |
79 fi | |
3363 | 80 |
81 if [ $NGX_LIBATOMIC != NO ]; then | |
82 . auto/lib/libatomic/conf | |
83 fi |