diff -Nru apache2-2.4.18/debian/changelog apache2-2.4.18/debian/changelog --- apache2-2.4.18/debian/changelog 2019-04-03 10:35:19.000000000 -0300 +++ apache2-2.4.18/debian/changelog 2019-04-03 10:34:47.000000000 -0300 @@ -1,3 +1,9 @@ +apache2 (2.4.18-2ubuntu3.11) xenial-security; urgency=medium + + * News.. + + -- Marc Deslauriers Wed, 03 Apr 2019 09:34:47 -0400 + apache2 (2.4.18-2ubuntu3.10) xenial-security; urgency=medium * SECURITY UPDATE: mod_session expiry time issue diff -Nru apache2-2.4.18/debian/patches/0001-mod_reqtimeout-Allow-to-configure-TLS-handshake-time.patch apache2-2.4.18/debian/patches/0001-mod_reqtimeout-Allow-to-configure-TLS-handshake-time.patch --- apache2-2.4.18/debian/patches/0001-mod_reqtimeout-Allow-to-configure-TLS-handshake-time.patch 1969-12-31 21:00:00.000000000 -0300 +++ apache2-2.4.18/debian/patches/0001-mod_reqtimeout-Allow-to-configure-TLS-handshake-time.patch 2019-04-03 10:34:47.000000000 -0300 @@ -0,0 +1,130 @@ +From 8aee6248c504ae007fea01eeb26b1dc0efff95b9 Mon Sep 17 00:00:00 2001 +From: Yann Ylavic +Date: Tue, 19 Feb 2019 18:14:13 +0000 +Subject: [PATCH] mod_reqtimeout: Allow to configure (TLS-)handshake timeouts. + +The timeouts apply between the process_connection and pre_read_request hooks. +They are disabled by default for compatibily reasons. + + +git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1853906 13f79535-47bb-0310-9956-ffa450edef68 +--- + CHANGES | 4 ++ + docs/manual/mod/mod_reqtimeout.xml | 63 ++++++++++++++++-------------- + modules/filters/mod_reqtimeout.c | 31 ++++++++++++--- + 3 files changed, 64 insertions(+), 34 deletions(-) + +diff --git a/modules/filters/mod_reqtimeout.c b/modules/filters/mod_reqtimeout.c +index daed0317b942..a29091c57649 100644 +--- a/modules/filters/mod_reqtimeout.c ++++ b/modules/filters/mod_reqtimeout.c +@@ -29,6 +29,9 @@ + module AP_MODULE_DECLARE_DATA reqtimeout_module; + + #define UNSET -1 ++#define MRT_DEFAULT_handshake_TIMEOUT 0 /* disabled */ ++#define MRT_DEFAULT_handshake_MAX_TIMEOUT 0 ++#define MRT_DEFAULT_handshake_MIN_RATE APR_INT32_MAX + #define MRT_DEFAULT_header_TIMEOUT 20 + #define MRT_DEFAULT_header_MAX_TIMEOUT 40 + #define MRT_DEFAULT_header_MIN_RATE 500 +@@ -46,6 +49,7 @@ typedef struct + + typedef struct + { ++ reqtimeout_stage_t handshake; /* Handshaking (TLS) */ + reqtimeout_stage_t header; /* Reading the HTTP header */ + reqtimeout_stage_t body; /* Reading the HTTP body */ + } reqtimeout_srv_cfg; +@@ -63,6 +67,7 @@ typedef struct + } reqtimeout_con_cfg; + + static const char *const reqtimeout_filter_name = "reqtimeout"; ++static int default_handshake_rate_factor; + static int default_header_rate_factor; + static int default_body_rate_factor; + +@@ -372,7 +377,10 @@ static int reqtimeout_init(conn_rec *c) + &reqtimeout_module); + AP_DEBUG_ASSERT(cfg != NULL); + +- if (cfg->header.timeout == 0 && cfg->body.timeout == 0) { ++ /* For compatibility, handshake timeout is disabled when UNSET (< 0) */ ++ if (cfg->handshake.timeout <= 0 ++ && cfg->header.timeout == 0 ++ && cfg->body.timeout == 0) { + /* disabled for this vhost */ + return DECLINED; + } +@@ -383,6 +391,10 @@ static int reqtimeout_init(conn_rec *c) + ccfg = apr_pcalloc(c->pool, sizeof(reqtimeout_con_cfg)); + ap_set_module_config(c->conn_config, &reqtimeout_module, ccfg); + ap_add_input_filter(reqtimeout_filter_name, ccfg, NULL, c); ++ ++ if (cfg->handshake.timeout > 0) { ++ INIT_STAGE(cfg, ccfg, handshake); ++ } + } + + /* we are not handling the connection, we just do initialization */ +@@ -450,6 +462,7 @@ static void *reqtimeout_create_srv_config(apr_pool_t *p, server_rec *s) + { + reqtimeout_srv_cfg *cfg = apr_pcalloc(p, sizeof(reqtimeout_srv_cfg)); + ++ UNSET_STAGE(cfg, handshake); + UNSET_STAGE(cfg, header); + UNSET_STAGE(cfg, body); + +@@ -473,6 +486,7 @@ static void *reqtimeout_merge_srv_config(apr_pool_t *p, void *base_, void *add_) + reqtimeout_srv_cfg *add = add_; + reqtimeout_srv_cfg *cfg = apr_pcalloc(p, sizeof(reqtimeout_srv_cfg)); + ++ MERGE_STAGE(cfg, base, add, handshake); + MERGE_STAGE(cfg, base, add, header); + MERGE_STAGE(cfg, base, add, body); + +@@ -505,7 +519,10 @@ static const char *set_reqtimeout_param(reqtimeout_srv_cfg *conf, + char *rate_str = NULL, *initial_str, *max_str = NULL; + reqtimeout_stage_t *stage; + +- if (!strcasecmp(key, "header")) { ++ if (!strcasecmp(key, "handshake")) { ++ stage = &conf->handshake; ++ } ++ else if (!strcasecmp(key, "header")) { + stage = &conf->header; + } + else if (!strcasecmp(key, "body")) { +@@ -611,13 +628,17 @@ static void reqtimeout_hooks(apr_pool_t *pool) + * e.g. mod_ftp. Also, if mod_reqtimeout used the pre_connection hook, it + * would be inserted on mod_proxy's backend connections. + */ +- ap_hook_process_connection(reqtimeout_init, NULL, NULL, APR_HOOK_LAST); ++ ap_hook_process_connection(reqtimeout_init, NULL, NULL, APR_HOOK_FIRST); + + ap_hook_pre_read_request(reqtimeout_before_header, NULL, NULL, + APR_HOOK_MIDDLE); + ap_hook_post_read_request(reqtimeout_before_body, NULL, NULL, + APR_HOOK_MIDDLE); + ++#if MRT_DEFAULT_HANDSHAKE_MIN_RATE > 0 ++ default_handshake_rate_factor = apr_time_from_sec(1) / ++ MRT_DEFAULT_HANDSHAKE_MIN_RATE; ++#endif + #if MRT_DEFAULT_HEADER_MIN_RATE > 0 + default_header_rate_factor = apr_time_from_sec(1) / + MRT_DEFAULT_HEADER_MIN_RATE; +@@ -630,8 +651,8 @@ static void reqtimeout_hooks(apr_pool_t *pool) + + static const command_rec reqtimeout_cmds[] = { + AP_INIT_RAW_ARGS("RequestReadTimeout", set_reqtimeouts, NULL, RSRC_CONF, +- "Set various timeout parameters for reading request " +- "headers and body"), ++ "Set various timeout parameters for TLS handshake and/or " ++ "reading request headers and body"), + {NULL} + }; + +-- +2.17.1 + diff -Nru apache2-2.4.18/debian/patches/0001-mod_reqtimeout-factorize-structs-and-code.patch apache2-2.4.18/debian/patches/0001-mod_reqtimeout-factorize-structs-and-code.patch --- apache2-2.4.18/debian/patches/0001-mod_reqtimeout-factorize-structs-and-code.patch 1969-12-31 21:00:00.000000000 -0300 +++ apache2-2.4.18/debian/patches/0001-mod_reqtimeout-factorize-structs-and-code.patch 2019-04-03 10:34:47.000000000 -0300 @@ -0,0 +1,367 @@ +From 99f7566918751a03c2a76f28894b4f029ee4f52a Mon Sep 17 00:00:00 2001 +From: Yann Ylavic +Date: Tue, 19 Feb 2019 17:21:09 +0000 +Subject: [PATCH] mod_reqtimeout: factorize structs and code. + +With a bit of macro magic, this is to avoid more code duplication when adding +new stages (next commit will add TLS/handshake timeouts handling in addition to +existing header and body ones). + +No functional change here. + + +git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1853901 13f79535-47bb-0310-9956-ffa450edef68 +[mfo: backport: mod_reqtimeout.c, hunk 1? changed case on HEADER/header. +maybe something in hunk 8, cant remembernow.] +--- + modules/filters/mod_reqtimeout.c | 185 +++++++++++++++---------------- + 1 file changed, 87 insertions(+), 98 deletions(-) + +diff --git a/modules/filters/mod_reqtimeout.c b/modules/filters/mod_reqtimeout.c +index 538e9b1bde9b..daed0317b942 100644 +--- a/modules/filters/mod_reqtimeout.c ++++ b/modules/filters/mod_reqtimeout.c +@@ -29,23 +29,25 @@ + module AP_MODULE_DECLARE_DATA reqtimeout_module; + + #define UNSET -1 +-#define MRT_DEFAULT_HEADER_TIMEOUT 20 +-#define MRT_DEFAULT_HEADER_MAX_TIMEOUT 40 +-#define MRT_DEFAULT_HEADER_MIN_RATE 500 +-#define MRT_DEFAULT_BODY_TIMEOUT 20 +-#define MRT_DEFAULT_BODY_MAX_TIMEOUT 0 +-#define MRT_DEFAULT_BODY_MIN_RATE 500 ++#define MRT_DEFAULT_header_TIMEOUT 20 ++#define MRT_DEFAULT_header_MAX_TIMEOUT 40 ++#define MRT_DEFAULT_header_MIN_RATE 500 ++#define MRT_DEFAULT_body_TIMEOUT 20 ++#define MRT_DEFAULT_body_MAX_TIMEOUT 0 ++#define MRT_DEFAULT_body_MIN_RATE 500 + + typedef struct + { +- int header_timeout; /* timeout for reading the req hdrs in secs */ +- int header_max_timeout; /* max timeout for req hdrs in secs */ +- int header_min_rate; /* min rate for reading req hdrs in bytes/s */ +- apr_time_t header_rate_factor; +- int body_timeout; /* timeout for reading the req body in secs */ +- int body_max_timeout; /* max timeout for req body in secs */ +- int body_min_rate; /* min rate for reading req body in bytes/s */ +- apr_time_t body_rate_factor; ++ int timeout; /* timeout in secs */ ++ int max_timeout; /* max timeout in secs */ ++ int min_rate; /* min rate in bytes/s */ ++ apr_time_t rate_factor; /* scale factor (#usecs per min_rate) */ ++} reqtimeout_stage_t; ++ ++typedef struct ++{ ++ reqtimeout_stage_t header; /* Reading the HTTP header */ ++ reqtimeout_stage_t body; /* Reading the HTTP body */ + } reqtimeout_srv_cfg; + + /* this struct is used both as conn_config and as filter context */ +@@ -53,13 +55,10 @@ typedef struct + { + apr_time_t timeout_at; + apr_time_t max_timeout_at; +- int min_rate; +- int new_timeout; +- int new_max_timeout; ++ reqtimeout_stage_t cur_stage; + int in_keep_alive; + char *type; + apr_socket_t *socket; +- apr_time_t rate_factor; + apr_bucket_brigade *tmpbb; + } reqtimeout_con_cfg; + +@@ -75,7 +74,7 @@ static void extend_timeout(reqtimeout_con_cfg *ccfg, apr_bucket_brigade *bb) + if (apr_brigade_length(bb, 0, &len) != APR_SUCCESS || len <= 0) + return; + +- new_timeout_at = ccfg->timeout_at + len * ccfg->rate_factor; ++ new_timeout_at = ccfg->timeout_at + len * ccfg->cur_stage.rate_factor; + if (ccfg->max_timeout_at > 0 && new_timeout_at > ccfg->max_timeout_at) { + ccfg->timeout_at = ccfg->max_timeout_at; + } +@@ -190,14 +189,14 @@ static apr_status_t reqtimeout_filter(ap_filter_t *f, + apr_brigade_cleanup(bb); + } + +- if (ccfg->new_timeout > 0) { ++ if (ccfg->cur_stage.timeout > 0) { + /* set new timeout */ + now = apr_time_now(); +- ccfg->timeout_at = now + apr_time_from_sec(ccfg->new_timeout); +- ccfg->new_timeout = 0; +- if (ccfg->new_max_timeout > 0) { +- ccfg->max_timeout_at = now + apr_time_from_sec(ccfg->new_max_timeout); +- ccfg->new_max_timeout = 0; ++ ccfg->timeout_at = now + apr_time_from_sec(ccfg->cur_stage.timeout); ++ ccfg->cur_stage.timeout = 0; ++ if (ccfg->cur_stage.max_timeout > 0) { ++ ccfg->max_timeout_at = now + apr_time_from_sec(ccfg->cur_stage.max_timeout); ++ ccfg->cur_stage.max_timeout = 0; + } + } + else if (ccfg->timeout_at == 0) { +@@ -216,7 +215,7 @@ static apr_status_t reqtimeout_filter(ap_filter_t *f, + if (block == APR_NONBLOCK_READ || mode == AP_MODE_INIT + || mode == AP_MODE_EATCRLF) { + rv = ap_get_brigade(f->next, bb, mode, block, readbytes); +- if (ccfg->min_rate > 0 && rv == APR_SUCCESS) { ++ if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS) { + extend_timeout(ccfg, bb); + } + return rv; +@@ -250,7 +249,7 @@ static apr_status_t reqtimeout_filter(ap_filter_t *f, + } + + if (!APR_BRIGADE_EMPTY(bb)) { +- if (ccfg->min_rate > 0) { ++ if (ccfg->cur_stage.rate_factor > 0) { + extend_timeout(ccfg, bb); + } + +@@ -311,7 +310,7 @@ static apr_status_t reqtimeout_filter(ap_filter_t *f, + * the real (relevant) bytes to be asked later, within the + * currently alloted time. + */ +- if (ccfg->min_rate > 0 && rv == APR_SUCCESS ++ if (ccfg->cur_stage.rate_factor > 0 && rv == APR_SUCCESS + && mode != AP_MODE_SPECULATIVE) { + extend_timeout(ccfg, bb); + } +@@ -350,6 +349,20 @@ static apr_status_t reqtimeout_eor(ap_filter_t *f, apr_bucket_brigade *bb) + return rv; + } + ++#define INIT_STAGE(cfg, ccfg, stage) do { \ ++ if (cfg->stage.timeout != UNSET) { \ ++ ccfg->cur_stage.timeout = cfg->stage.timeout; \ ++ ccfg->cur_stage.max_timeout = cfg->stage.max_timeout; \ ++ ccfg->cur_stage.rate_factor = cfg->stage.rate_factor; \ ++ } \ ++ else { \ ++ ccfg->cur_stage.timeout = MRT_DEFAULT_##stage##_TIMEOUT; \ ++ ccfg->cur_stage.max_timeout = MRT_DEFAULT_##stage##_MAX_TIMEOUT; \ ++ ccfg->cur_stage.rate_factor = default_##stage##_rate_factor; \ ++ } \ ++ ccfg->type = #stage; \ ++} while (0) ++ + static int reqtimeout_init(conn_rec *c) + { + reqtimeout_con_cfg *ccfg; +@@ -358,7 +371,8 @@ static int reqtimeout_init(conn_rec *c) + cfg = ap_get_module_config(c->base_server->module_config, + &reqtimeout_module); + AP_DEBUG_ASSERT(cfg != NULL); +- if (cfg->header_timeout == 0 && cfg->body_timeout == 0) { ++ ++ if (cfg->header.timeout == 0 && cfg->body.timeout == 0) { + /* disabled for this vhost */ + return DECLINED; + } +@@ -396,19 +410,7 @@ static void reqtimeout_before_header(request_rec *r, conn_rec *c) + ccfg->timeout_at = 0; + ccfg->max_timeout_at = 0; + ccfg->in_keep_alive = (c->keepalives > 0); +- ccfg->type = "header"; +- if (cfg->header_timeout != UNSET) { +- ccfg->new_timeout = cfg->header_timeout; +- ccfg->new_max_timeout = cfg->header_max_timeout; +- ccfg->min_rate = cfg->header_min_rate; +- ccfg->rate_factor = cfg->header_rate_factor; +- } +- else { +- ccfg->new_timeout = MRT_DEFAULT_HEADER_TIMEOUT; +- ccfg->new_max_timeout = MRT_DEFAULT_HEADER_MAX_TIMEOUT; +- ccfg->min_rate = MRT_DEFAULT_HEADER_MIN_RATE; +- ccfg->rate_factor = default_header_rate_factor; +- } ++ INIT_STAGE(cfg, ccfg, header); + } + + static int reqtimeout_before_body(request_rec *r) +@@ -430,55 +432,50 @@ static int reqtimeout_before_body(request_rec *r) + ccfg->type = "body"; + if (r->method_number == M_CONNECT) { + /* disabled for a CONNECT request */ +- ccfg->new_timeout = 0; +- } +- else if (cfg->body_timeout != UNSET) { +- ccfg->new_timeout = cfg->body_timeout; +- ccfg->new_max_timeout = cfg->body_max_timeout; +- ccfg->min_rate = cfg->body_min_rate; +- ccfg->rate_factor = cfg->body_rate_factor; ++ ccfg->cur_stage.timeout = 0; + } + else { +- ccfg->new_timeout = MRT_DEFAULT_BODY_TIMEOUT; +- ccfg->new_max_timeout = MRT_DEFAULT_BODY_MAX_TIMEOUT; +- ccfg->min_rate = MRT_DEFAULT_BODY_MIN_RATE; +- ccfg->rate_factor = default_body_rate_factor; ++ INIT_STAGE(cfg, ccfg, body); + } + return OK; + } + ++#define UNSET_STAGE(cfg, stage) do { \ ++ cfg->stage.timeout = UNSET; \ ++ cfg->stage.max_timeout = UNSET; \ ++ cfg->stage.min_rate = UNSET; \ ++} while (0) ++ + static void *reqtimeout_create_srv_config(apr_pool_t *p, server_rec *s) + { + reqtimeout_srv_cfg *cfg = apr_pcalloc(p, sizeof(reqtimeout_srv_cfg)); + +- cfg->header_timeout = UNSET; +- cfg->header_max_timeout = UNSET; +- cfg->header_min_rate = UNSET; +- cfg->body_timeout = UNSET; +- cfg->body_max_timeout = UNSET; +- cfg->body_min_rate = UNSET; ++ UNSET_STAGE(cfg, header); ++ UNSET_STAGE(cfg, body); + + return cfg; + } + +-#define MERGE_INT(cfg, b, a, val) cfg->val = (a->val == UNSET) ? b->val : a->val; ++#define MERGE_INT(cfg, b, a, val) \ ++ cfg->val = (a->val == UNSET) ? b->val : a->val ++#define MERGE_STAGE(cfg, b, a, stage) do { \ ++ MERGE_INT(cfg, base, add, stage.timeout); \ ++ MERGE_INT(cfg, base, add, stage.max_timeout); \ ++ MERGE_INT(cfg, base, add, stage.min_rate); \ ++ cfg->stage.rate_factor = (cfg->stage.min_rate == UNSET) \ ++ ? base->stage.rate_factor \ ++ : add->stage.rate_factor; \ ++} while (0) ++ + static void *reqtimeout_merge_srv_config(apr_pool_t *p, void *base_, void *add_) + { + reqtimeout_srv_cfg *base = base_; + reqtimeout_srv_cfg *add = add_; + reqtimeout_srv_cfg *cfg = apr_pcalloc(p, sizeof(reqtimeout_srv_cfg)); + +- MERGE_INT(cfg, base, add, header_timeout); +- MERGE_INT(cfg, base, add, header_max_timeout); +- MERGE_INT(cfg, base, add, header_min_rate); +- MERGE_INT(cfg, base, add, body_timeout); +- MERGE_INT(cfg, base, add, body_max_timeout); +- MERGE_INT(cfg, base, add, body_min_rate); +- +- cfg->header_rate_factor = (cfg->header_min_rate == UNSET) ? +- base->header_rate_factor : add->header_rate_factor; +- cfg->body_rate_factor = (cfg->body_min_rate == UNSET) ? +- base->body_rate_factor : add->body_rate_factor; ++ MERGE_STAGE(cfg, base, add, header); ++ MERGE_STAGE(cfg, base, add, body); ++ + return cfg; + } + +@@ -506,66 +503,56 @@ static const char *set_reqtimeout_param(reqtimeout_srv_cfg *conf, + { + const char *ret = NULL; + char *rate_str = NULL, *initial_str, *max_str = NULL; +- int rate = 0, initial = 0, max = 0; +- enum { PARAM_HEADER, PARAM_BODY } type; ++ reqtimeout_stage_t *stage; + + if (!strcasecmp(key, "header")) { +- type = PARAM_HEADER; ++ stage = &conf->header; + } + else if (!strcasecmp(key, "body")) { +- type = PARAM_BODY; ++ stage = &conf->body; + } + else { + return "Unknown RequestReadTimeout parameter"; + } + ++ memset(stage, 0, sizeof(*stage)); ++ + if ((rate_str = ap_strcasestr(val, ",minrate="))) { + initial_str = apr_pstrndup(p, val, rate_str - val); + rate_str += strlen(",minrate="); +- ret = parse_int(p, rate_str, &rate); ++ ret = parse_int(p, rate_str, &stage->min_rate); + if (ret) + return ret; + +- if (rate == 0) ++ if (stage->min_rate == 0) + return "Minimum data rate must be larger than 0"; + + if ((max_str = strchr(initial_str, '-'))) { + *max_str++ = '\0'; +- ret = parse_int(p, max_str, &max); ++ ret = parse_int(p, max_str, &stage->max_timeout); + if (ret) + return ret; + } + +- ret = parse_int(p, initial_str, &initial); ++ ret = parse_int(p, initial_str, &stage->timeout); + } + else { + if (ap_strchr_c(val, '-')) + return "Must set MinRate option if using timeout range"; +- ret = parse_int(p, val, &initial); ++ ret = parse_int(p, val, &stage->timeout); + } +- + if (ret) + return ret; + +- if (max && initial >= max) { ++ if (stage->max_timeout && stage->timeout >= stage->max_timeout) { + return "Maximum timeout must be larger than initial timeout"; + } + +- if (type == PARAM_HEADER) { +- conf->header_timeout = initial; +- conf->header_max_timeout = max; +- conf->header_min_rate = rate; +- if (rate) +- conf->header_rate_factor = apr_time_from_sec(1) / rate; ++ if (stage->min_rate) { ++ stage->rate_factor = apr_time_from_sec(1) / stage->min_rate; + } +- else { +- conf->body_timeout = initial; +- conf->body_max_timeout = max; +- conf->body_min_rate = rate; +- if (rate) +- conf->body_rate_factor = apr_time_from_sec(1) / rate; +- } +- return ret; ++ ++ return NULL; + } + + static const char *set_reqtimeouts(cmd_parms *cmd, void *mconfig, +@@ -632,10 +619,12 @@ static void reqtimeout_hooks(apr_pool_t *pool) + APR_HOOK_MIDDLE); + + #if MRT_DEFAULT_HEADER_MIN_RATE > 0 +- default_header_rate_factor = apr_time_from_sec(1) / MRT_DEFAULT_HEADER_MIN_RATE; ++ default_header_rate_factor = apr_time_from_sec(1) / ++ MRT_DEFAULT_HEADER_MIN_RATE; + #endif + #if MRT_DEFAULT_BODY_MIN_RATE > 0 +- default_body_rate_factor = apr_time_from_sec(1) / MRT_DEFAULT_BODY_MIN_RATE; ++ default_body_rate_factor = apr_time_from_sec(1) / ++ MRT_DEFAULT_BODY_MIN_RATE; + #endif + } + +-- +2.17.1 + diff -Nru apache2-2.4.18/debian/patches/0001-mod_reqtimeout-Fix-body-timeout-disabling-for-CONNEC.patch apache2-2.4.18/debian/patches/0001-mod_reqtimeout-Fix-body-timeout-disabling-for-CONNEC.patch --- apache2-2.4.18/debian/patches/0001-mod_reqtimeout-Fix-body-timeout-disabling-for-CONNEC.patch 1969-12-31 21:00:00.000000000 -0300 +++ apache2-2.4.18/debian/patches/0001-mod_reqtimeout-Fix-body-timeout-disabling-for-CONNEC.patch 2019-04-03 10:34:47.000000000 -0300 @@ -0,0 +1,42 @@ +From 48c638f18560910b66c96dfa59bfef0d6a2a8fc3 Mon Sep 17 00:00:00 2001 +From: Yann Ylavic +Date: Thu, 28 Jul 2016 10:57:22 +0000 +Subject: [PATCH] mod_reqtimeout: Fix body timeout disabling for CONNECT + requests to avoid triggering mod_proxy_connect's AH01018 once the tunnel is + established. https://bugzilla.mozilla.org/show_bug.cgi?id=1279483 + +git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1754391 13f79535-47bb-0310-9956-ffa450edef68 +--- + CHANGES | 4 ++++ + modules/filters/mod_reqtimeout.c | 8 ++++++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/modules/filters/mod_reqtimeout.c b/modules/filters/mod_reqtimeout.c +index ed99c683bc9c..176b824e36ec 100644 +--- a/modules/filters/mod_reqtimeout.c ++++ b/modules/filters/mod_reqtimeout.c +@@ -417,8 +417,8 @@ static int reqtimeout_before_body(request_rec *r) + reqtimeout_con_cfg *ccfg = + ap_get_module_config(r->connection->conn_config, &reqtimeout_module); + +- if (ccfg == NULL || r->method_number == M_CONNECT) { +- /* either disabled for this connection or a CONNECT request */ ++ if (ccfg == NULL) { ++ /* not configured for this connection */ + return OK; + } + cfg = ap_get_module_config(r->connection->base_server->module_config, +@@ -428,6 +428,10 @@ static int reqtimeout_before_body(request_rec *r) + ccfg->timeout_at = 0; + ccfg->max_timeout_at = 0; + ccfg->type = "body"; ++ if (r->method_number == M_CONNECT) { ++ /* disabled for a CONNECT request */ ++ ccfg->new_timeout = 0; ++ } + if (cfg->body_timeout != UNSET) { + ccfg->new_timeout = cfg->body_timeout; + ccfg->new_max_timeout = cfg->body_max_timeout; +-- +2.17.1 + diff -Nru apache2-2.4.18/debian/patches/0001-mod_reqtimeout-follow-up-to-r1754391-fix-missing-els.patch apache2-2.4.18/debian/patches/0001-mod_reqtimeout-follow-up-to-r1754391-fix-missing-els.patch --- apache2-2.4.18/debian/patches/0001-mod_reqtimeout-follow-up-to-r1754391-fix-missing-els.patch 1969-12-31 21:00:00.000000000 -0300 +++ apache2-2.4.18/debian/patches/0001-mod_reqtimeout-follow-up-to-r1754391-fix-missing-els.patch 2019-04-03 10:34:47.000000000 -0300 @@ -0,0 +1,26 @@ +From adc8879ee0c15bf3790ae0d2b89db5ff5f9a3951 Mon Sep 17 00:00:00 2001 +From: Yann Ylavic +Date: Thu, 28 Jul 2016 11:24:57 +0000 +Subject: [PATCH] mod_reqtimeout: follow up to r1754391: fix missing "else". + +git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1754399 13f79535-47bb-0310-9956-ffa450edef68 +--- + modules/filters/mod_reqtimeout.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/filters/mod_reqtimeout.c b/modules/filters/mod_reqtimeout.c +index 176b824e36ec..538e9b1bde9b 100644 +--- a/modules/filters/mod_reqtimeout.c ++++ b/modules/filters/mod_reqtimeout.c +@@ -432,7 +432,7 @@ static int reqtimeout_before_body(request_rec *r) + /* disabled for a CONNECT request */ + ccfg->new_timeout = 0; + } +- if (cfg->body_timeout != UNSET) { ++ else if (cfg->body_timeout != UNSET) { + ccfg->new_timeout = cfg->body_timeout; + ccfg->new_max_timeout = cfg->body_max_timeout; + ccfg->min_rate = cfg->body_min_rate; +-- +2.17.1 + diff -Nru apache2-2.4.18/debian/patches/series apache2-2.4.18/debian/patches/series --- apache2-2.4.18/debian/patches/series 2019-04-03 10:34:43.000000000 -0300 +++ apache2-2.4.18/debian/patches/series 2019-04-03 10:34:47.000000000 -0300 @@ -37,3 +37,7 @@ CVE-2019-0220-1.patch CVE-2019-0220-2.patch CVE-2019-0220-3.patch +0001-mod_reqtimeout-Fix-body-timeout-disabling-for-CONNEC.patch +0001-mod_reqtimeout-follow-up-to-r1754391-fix-missing-els.patch +0001-mod_reqtimeout-factorize-structs-and-code.patch +0001-mod_reqtimeout-Allow-to-configure-TLS-handshake-time.patch