-
mdounin committed
Jan 26, 2016 -
mdounin committed
Jan 26, 2016 -
Resolver: limited CNAME recursion.
Ruslan Ermilov committedJan 26, 2016 Previously, the recursion was only limited for cached responses.
-
Resolver: fixed use-after-free memory accesses with CNAME.
Roman Arutyunyan committedJan 26, 2016 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.
-
Resolver: changed the ngx_resolver_create_*_query() arguments.
Roman Arutyunyan committedJan 26, 2016 No functional changes. This is needed by the following change.
-
Resolver: fixed CNAME processing for several requests.
Ruslan Ermilov committedJan 26, 2016 When several requests were waiting for a response, then after getting a CNAME response only the last request was properly processed, while others were left waiting.
-
Resolver: fixed crashes in timeout handler.
Ruslan Ermilov committedJan 26, 2016 If one or more requests were waiting for a response, then after getting a CNAME response, the timeout event on the first request remained active, pointing to the wrong node with an empty rn->waiting list, and that could cause either null pointer dereference or use-after-free memory access if this timeout expired. If several requests were waiting for a response, and the first request terminated (e.g., due to client closing a connection), other requests were left without a timeout and could potentially wait indefinitely. This is fixed by introducing per-request independent timeouts. This change also reverts 954867a2f0a6 and 5004210e8c78.
-
Resolver: fixed possible segmentation fault on DNS format error.
Roman Arutyunyan committedJan 26, 2016
-
Updated OpenSSL and PCRE used for win32 builds.
mdounin committedJan 25, 2016 -
mdounin committed
Jan 25, 2016
-
SSL: only select SPDY using NPN if "spdy" is enabled.
VBart committedNov 5, 2015 OpenSSL doesn't check if the negotiated protocol has been announced. As a result, the client might force using SPDY even if it wasn't enabled in configuration.
-
Fixed ngx_parse_time() out of bounds access (ticket #821).
mdounin committedOct 30, 2015 The code failed to ensure that "s" is within the buffer passed for parsing when checking for "ms", and this resulted in unexpected errors when parsing non-null-terminated strings with trailing "m". The bug manifested itself when the expires directive was used with variables. Found by Roman Arutyunyan.
-
SSL: preserve default server context in connection (ticket #235).
mdounin committedOct 19, 2015 This context is needed for shared sessions cache to work in configurations with multiple virtual servers sharing the same port. Unfortunately, OpenSSL does not provide an API to access the session context, thus storing it separately. In collaboration with Vladimir Homutov.
-
Upstream: fixed cache send error handling.
Roman Arutyunyan committedSep 3, 2015 The value of NGX_ERROR, returned from filter handlers, was treated as a generic upstream error and changed to NGX_HTTP_INTERNAL_SERVER_ERROR before calling ngx_http_finalize_request(). This resulted in "header already sent" alert if header was already sent in filter handlers. The problem appeared in 54e9b83d00f0 (1.7.5).
-
Fixed wrong URI after try_files in nested location (ticket #97).
mdounin committedAug 16, 2015 The following configuration with alias, nested location and try_files resulted in wrong file being used. Request "/foo/test.gif" tried to use "/tmp//foo/test.gif" instead of "/tmp/test.gif": location /foo/ { alias /tmp/; location ~ gif { try_files $uri =405; } } Additionally, rev. c985d90a8d1f introduced a regression if the "/tmp//foo/test.gif" file was found (ticket #768). Resulting URI was set to "gif?/foo/test.gif", as the code used clcf->name of current location ("location ~ gif") instead of parent one ("location /foo/"). Fix is to use r->uri instead of clcf->name in all cases in the ngx_http_core_try_files_phase() function. It is expected to be already matched and identical to the clcf->name of the right location. -
Fixed segfault with try_files introduced by c985d90a8d1f.
mdounin committedAug 16, 2015 If alias was used in a location given by a regular expression, nginx used to do wrong thing in try_files if a location name (i.e., regular expression) was an exact prefix of URI. The following configuration triggered a segmentation fault on a request to "/mail": location ~ /mail { alias /path/to/directory; try_files $uri =404; } Reported by Per Hansson.
-
Events: made a failure to create a notification channel non-fatal.
Ruslan Ermilov committedMay 6, 2015 This may happen if eventfd() returns ENOSYS, notably seen on CentOS 5.4. Such a failure will now just disable the notification mechanism and let the callers cope with it, instead of failing to start worker processes. If thread pools are not configured, this can safely be ignored.
-
Merge proxy_protocol setting of listen directives.
Roman Arutyunyan committedApr 24, 2015 It's now enough to specify proxy_protocol option in one listen directive to enable it in all servers listening on the same address/port. Previously, the setting from the first directive was always used.
-
Core: ensure that ngx_config.h is always included first.
Sergey Kandaurov committedApr 16, 2015 This fixes compilation of various 3rd party modules when nginx is configured with threads.
-
mdounin committed
Apr 16, 2015 -
Fixed build, broken by 8b7f062a3fe6.
Ruslan Ermilov committedApr 16, 2015 Casting a "const char *" to "char *" doesn't work on older gcc versions.
-
Core: added OpenSSL version information to "nginx -V" output.
vl-homutov committedApr 16, 2015 -
vl-homutov committed
Apr 16, 2015
-
Core: limited levels of subdirectory hierarchy used for temp files.
Sergey Kandaurov committedApr 6, 2015 Similar to ngx_http_file_cache_set_slot(), the last component of file->name with a fixed length of 10 bytes, as generated in ngx_create_temp_path(), is used as a source for the names of intermediate subdirectories with each one taking its own part. Ensure that the sum of specified levels with slashes fits into the length (ticket #731).
-
Core: removed excessive initialization in ngx_conf_set_path_slot().
Sergey Kandaurov committedApr 6, 2015 Level hierarchy is pre-zeroed in ngx_pcalloc() of the surrounding ngx_path_t.
-
Core: fixed error handling on ngx_conf_full_name() failure.
Sergey Kandaurov committedApr 6, 2015 -
Upstream: abbreviated SSL handshake may interact badly with Nagle.
Ruslan Ermilov committedApr 6, 2015 -
Request body: always flush buffers if request buffering is off.
VBart committedApr 6, 2015 This fixes unbuffered proxying to SSL backends, since it prevents ngx_ssl_send_chain() from accumulation of request body in the SSL buffer.
-
Used the correct type for the AIO preload handler return value.
VBart committedApr 6, 2015
-
mdounin committed
Apr 3, 2015
-
Core: guard against spinlock usage without atomic ops.
Ruslan Ermilov committedMar 26, 2015 The new thread pools code uses spinlocks.