mod_proxy_http, mod_proxy_ajp, mod_reqtimeout:
Use APR_STATUS_IS_TIMEUP instead of direct compare
to APR_TIMEUP to be more safe on different platforms.
Note: This commit has an additional, platform-independent change to
mod_proxy_http.c to mark the back-end connection for closing
("backend->close = 1;"). That code is not required to resolve
CVE-2010-2068 on any platform.
PR: 49417
Addresses CVE-2010-2068 (changes to mod_proxy_http.c)
Submitted by: rjung, rpluem
Reviewed by: rjung, rpluem, wrowe
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@953616
13f79535-47bb-0310-9956-
ffa450edef68
-*- coding: utf-8 -*-
Changes with Apache 2.2.16
+ *) mod_proxy_ajp, mod_proxy_http, mod_reqtimeout: Fix timeout detection
+ for platforms Windows, Netware and OS2. [Rainer Jung]
+
*) mod_ssl: Fix segfault at startup if proxy client certs are shared
across multiple vhosts. PR 39915. [Joe Orton]
+1: niq, pgollucci
+1: rbowen - After much debate on IRC, we've agreed on FallbackResource as being the right name for this.
- * mod_proxy_http, mod_proxy_ajp, mod_reqtimeout: Use APR_STATUS_IS_TIMEUP
- instead of direct compare to APR_TIMEUP to be more safe on different platforms.
- Backport from trunk of http://svn.apache.org/viewvc?rev=953418&view=rev
- http://svn.apache.org/viewvc?rev=953385&view=rev
- http://svn.apache.org/viewvc?rev=953377&view=rev
- +1: rjung, wrowe, rpluem
- -1:
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
extend_timeout(ccfg, bb);
}
- if (rv == APR_TIMEUP) {
+ if (APR_STATUS_IS_TIMEUP(rv)) {
ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, f->c,
"Request %s read timeout", ccfg->type);
}
}
}
else {
+ apr_status_t rv;
+
e = apr_bucket_transient_create(send_body_chunk_buff, size,
r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(output_brigade, e);
if ((conn->worker->flush_packets == flush_on) ||
((conn->worker->flush_packets == flush_auto) &&
- (apr_poll(conn_poll, 1, &conn_poll_fd,
- conn->worker->flush_wait)
- == APR_TIMEUP) ) ) {
+ ((rv = apr_poll(conn_poll, 1, &conn_poll_fd,
+ conn->worker->flush_wait))
+ != APR_SUCCESS) &&
+ APR_STATUS_IS_TIMEUP(rv))) {
e = apr_bucket_flush_create(r->connection->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(output_brigade, e);
}
ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r,
"proxy: error reading status line from remote "
"server %s:%d", backend->hostname, backend->port);
- if (rc == APR_TIMEUP) {
+ if (APR_STATUS_IS_TIMEUP(rc)) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
"proxy: read timeout");
}
* we normally would handle timeouts
*/
if (r->proxyreq == PROXYREQ_REVERSE && c->keepalives &&
- rc != APR_TIMEUP) {
+ !APR_STATUS_IS_TIMEUP(rc)) {
apr_bucket *eos;
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
APR_BUCKET_INSERT_BEFORE(eos, e);
}
ap_pass_brigade(r->output_filters, bb);
+ /* Mark the backend connection for closing */
+ backend->close = 1;
/* Need to return OK to avoid sending an error message */
return OK;
}