Merge ~bryce/ubuntu/+source/apache2:sru-lp1832182-graceful-revert-bionic into ubuntu/+source/apache2:ubuntu/devel
- Git
- lp:~bryce/ubuntu/+source/apache2
- sru-lp1832182-graceful-revert-bionic
- Merge into ubuntu/devel
Status: | Merged |
---|---|
Merge reported by: | Bryce Harrington |
Merged at revision: | 95c238eedea3c6b7d877857d522e03f2d4e8e951 |
Proposed branch: | ~bryce/ubuntu/+source/apache2:sru-lp1832182-graceful-revert-bionic |
Merge into: | ubuntu/+source/apache2:ubuntu/devel |
Diff against target: |
22219 lines (+21167/-0) (has conflicts) 81 files modified
debian/NEWS (+12/-0) debian/apache2-systemd.conf (+3/-0) debian/apache2.dirs (+4/-0) debian/apache2.install (+4/-0) debian/changelog (+249/-0) debian/control (+16/-0) debian/patches/086_svn_cross_compiles (+118/-0) debian/patches/CVE-2017-15710.patch (+24/-0) debian/patches/CVE-2017-15715.patch (+192/-0) debian/patches/CVE-2018-1283.patch (+28/-0) debian/patches/CVE-2018-1301.patch (+200/-0) debian/patches/CVE-2018-1303.patch (+17/-0) debian/patches/CVE-2018-1312.patch (+403/-0) debian/patches/CVE-2018-17199.patch (+85/-0) debian/patches/CVE-2019-0211.patch (+249/-0) debian/patches/CVE-2019-0217.patch (+147/-0) debian/patches/CVE-2019-0220-1.patch (+259/-0) debian/patches/CVE-2019-0220-2.patch (+50/-0) debian/patches/CVE-2019-0220-3.patch (+43/-0) debian/patches/CVE-2019-10092-1.patch (+245/-0) debian/patches/CVE-2019-10092-2.patch (+45/-0) debian/patches/CVE-2019-10098.patch (+159/-0) debian/patches/CVE-2020-11993-pre1.patch (+406/-0) debian/patches/CVE-2020-11993.patch (+1905/-0) debian/patches/CVE-2020-1927-1.patch (+93/-0) debian/patches/CVE-2020-1927-2.patch (+99/-0) debian/patches/CVE-2020-1934.patch (+103/-0) debian/patches/CVE-2020-35452.patch (+51/-0) debian/patches/CVE-2020-9490.patch (+436/-0) debian/patches/CVE-2021-26690.patch (+25/-0) debian/patches/CVE-2021-26691.patch (+39/-0) debian/patches/CVE-2021-30641.patch (+60/-0) debian/patches/CVE-2021-33193-pre1.patch (+175/-0) debian/patches/CVE-2021-33193-pre2.patch (+521/-0) debian/patches/CVE-2021-33193.patch (+197/-0) debian/patches/CVE-2021-34798.patch (+6/-0) debian/patches/CVE-2021-39275.patch (+4/-0) debian/patches/CVE-2021-40438-2.patch (+4/-0) debian/patches/CVE-2021-40438-3.patch (+8/-0) debian/patches/CVE-2021-40438-pre1.patch (+16/-0) debian/patches/CVE-2021-40438.patch (+12/-0) debian/patches/balance-member-long-hostname-part1.patch (+30/-0) debian/patches/balance-member-long-hostname-part2.patch (+430/-0) debian/patches/clear-retry-flags-before-abort.patch (+67/-0) debian/patches/disable-ssl-1.1.1-auto-retry.patch (+41/-0) debian/patches/includeoptional-ignore-non-existent.patch (+61/-0) debian/patches/mod_http2-1.14.1-backport-0001-On-the-2.4.x-branch.patch (+192/-0) debian/patches/mod_http2-1.14.1-backport-0002-On-the-2.4.x-branch.patch (+73/-0) debian/patches/mod_http2-1.14.1-backport-0003-On-the-2.4.x-branch.patch (+29/-0) debian/patches/mod_http2-1.14.1-backport-0004-docco-fix.-correct-license-copyright-info.patch (+640/-0) debian/patches/mod_http2-1.14.1-backport-0005-Merge-r1818804-r1818951-r1818958-r1818960-r1819027-r.patch (+263/-0) debian/patches/mod_http2-1.14.1-backport-0006-On-the-2.4.x-branch-CVE-2018-1302.patch (+1530/-0) debian/patches/mod_http2-1.14.1-backport-0008-Merge-r1822849-r1822858-r1822878-r1822879-r1822883-r.patch (+298/-0) debian/patches/mod_http2-1.14.1-backport-0009-Merge-r1828879-from-trunk-CVE-2018-1333.patch (+65/-0) debian/patches/mod_http2-1.14.1-backport-0010-Merge-r1826687-r1827166-r1828210-r1828232-r1828687-f.patch (+563/-0) debian/patches/mod_http2-1.14.1-backport-0011-Merge-r1830562-from-trunk.patch (+108/-0) debian/patches/mod_http2-1.14.1-backport-0012-fix-a-potential-NULL-dereference-spotted-by-gcc-8.1..patch (+114/-0) debian/patches/mod_http2-1.14.1-backport-0013-Merge-r1837056-from-trunk.patch (+265/-0) debian/patches/mod_http2-1.14.1-backport-0014-Merge-r1840010-from-trunk-CVE-2018-11763.patch (+527/-0) debian/patches/mod_http2-1.14.1-backport-0015-Merge-r1835118-from-trunk.patch (+325/-0) debian/patches/mod_http2-1.14.1-backport-0016-Merge-r1843426-from-trunk.patch (+110/-0) debian/patches/mod_http2-1.14.1-backport-0017-Merge-of-r1846125-from-trunk-CVE-2018-17189.patch (+77/-0) debian/patches/mod_http2-1.14.1-backport-0018-Merge-of-r1852986-from-trunk-CVE-2019-0196.patch (+30/-0) debian/patches/mod_http2-1.14.1-backport-0019-Merge-r1852038-r1852101-from-trunk-CVE-2019-0197.patch (+159/-0) debian/patches/mod_http2-1.14.1-backport-0020-Merge-r1853901-r1853906-r1853908-r1853929-r1853935-r.patch (+671/-0) debian/patches/mod_http2-1.14.1-backport-0021-Merge-of-1849296-1852038-1852101-1852339-1853171-185.patch (+4605/-0) debian/patches/mod_http2-1.14.1-backport-0022-adjust-per-r1855434.patch (+98/-0) debian/patches/mod_http2-1.15.4-backport-0001.patch (+128/-0) debian/patches/mod_http2-1.15.4-backport-0002.patch (+223/-0) debian/patches/mod_http2-1.15.4-backport-0003.patch (+74/-0) debian/patches/mod_http2-1.15.4-backport-0004-CVE-2019-9517.patch (+922/-0) debian/patches/mod_http2-1.15.4-backport-0005.patch (+37/-0) debian/patches/series (+105/-0) debian/patches/ssl-read-rc-value-openssl-1.1.1.patch (+110/-0) debian/patches/tlsv1.3-support-2.patch (+152/-0) debian/patches/tlsv1.3-support-3.patch (+37/-0) debian/patches/tlsv1.3-support-4.patch (+37/-0) debian/patches/tlsv1.3-support-5.patch (+298/-0) debian/patches/tlsv1.3-support.patch (+909/-0) debian/patches/util_ldap_cache_lock_fix.patch (+48/-0) debian/source/include-binaries (+4/-0) Conflict in debian/apache2.dirs Conflict in debian/apache2.install Conflict in debian/changelog Conflict in debian/control Conflict in debian/patches/CVE-2021-33193.patch Conflict in debian/patches/CVE-2021-34798.patch Conflict in debian/patches/CVE-2021-39275.patch Conflict in debian/patches/CVE-2021-40438-2.patch Conflict in debian/patches/CVE-2021-40438-3.patch Conflict in debian/patches/CVE-2021-40438-pre1.patch Conflict in debian/patches/CVE-2021-40438.patch Conflict in debian/patches/series Conflict in debian/source/include-binaries |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Christian Ehrhardt (community) | Approve | ||
Canonical Server | Pending | ||
Review via email: mp+412056@code.launchpad.net |
Commit message
Description of the change
This reverts an SRU fix that was reported to have a performance impact reported by focal users when supporting large numbers of vhosts. We reverted this in focal a few weeks ago and there's been no feedback regarding problems, so it's probably worth doing the same revert to the other releases.
After that, the plan will be to focus on a fix just for jammy, and then also get it accepted into Debian. After that we can evaluate whether or not to try SRUing again.
PPA: https:/
Bryce Harrington (bryce) wrote : | # |
Thanks Christian, I've uploaded the reverts. Sorry for the mistargeted branches.
I'll be keeping an eye on the uploads since with apache2 in focal we saw a ton of flaky test failures.
$ dput ubuntu ../apache2_
Checking signature on .changes
gpg: ../apache2_
Checking signature on .dsc
gpg: ../apache2_
Uploading to ubuntu (via ftp to upload.ubuntu.com):
Uploading apache2_
Uploading apache2_
Uploading apache2_
Uploading apache2_
Successfully uploaded packages.
Preview Diff
1 | diff --git a/debian/NEWS b/debian/NEWS | |||
2 | 0 | new file mode 100644 | 0 | new file mode 100644 |
3 | index 0000000..db737ef | |||
4 | --- /dev/null | |||
5 | +++ b/debian/NEWS | |||
6 | @@ -0,0 +1,12 @@ | |||
7 | 1 | apache2 (2.4.29-1ubuntu4.10) bionic-security; urgency=medium | ||
8 | 2 | |||
9 | 3 | - To address HTTP/2 issues CVE-2019-9517, CVE-2019-0197, | ||
10 | 4 | CVE-2019-10081, and CVE-2019-10082, mod_http2 from 2.4.41 (aka | ||
11 | 5 | v1.15.4) was backported into this release of apache2, which | ||
12 | 6 | includes additional bug fixes as well. | ||
13 | 7 | |||
14 | 8 | - For CVE-2019-10098, PCRE_DOTALL flag is by default by default to | ||
15 | 9 | avoid unpredictable matches and substitutions with encoded line | ||
16 | 10 | break characters mod_rewrite and the apache core. | ||
17 | 11 | |||
18 | 12 | -- Steve Beattie <sbeattie@ubuntu.com> Mon, 26 Aug 2019 06:41:43 -0700 | ||
19 | diff --git a/debian/apache2-systemd.conf b/debian/apache2-systemd.conf | |||
20 | 0 | new file mode 100644 | 13 | new file mode 100644 |
21 | index 0000000..b031203 | |||
22 | --- /dev/null | |||
23 | +++ b/debian/apache2-systemd.conf | |||
24 | @@ -0,0 +1,3 @@ | |||
25 | 1 | [Service] | ||
26 | 2 | Type=forking | ||
27 | 3 | RemainAfterExit=no | ||
28 | diff --git a/debian/apache2.dirs b/debian/apache2.dirs | |||
29 | index 1aa6d3c..fed7c9e 100644 | |||
30 | --- a/debian/apache2.dirs | |||
31 | +++ b/debian/apache2.dirs | |||
32 | @@ -10,4 +10,8 @@ var/cache/apache2/mod_cache_disk | |||
33 | 10 | var/lib/apache2 | 10 | var/lib/apache2 |
34 | 11 | var/log/apache2 | 11 | var/log/apache2 |
35 | 12 | var/www/html | 12 | var/www/html |
36 | 13 | <<<<<<< debian/apache2.dirs | ||
37 | 14 | ======= | ||
38 | 15 | usr/share/bug/apache2 | ||
39 | 16 | >>>>>>> debian/apache2.dirs | ||
40 | 13 | /etc/ufw/applications.d/apache2 | 17 | /etc/ufw/applications.d/apache2 |
41 | diff --git a/debian/apache2.install b/debian/apache2.install | |||
42 | index 92865fc..3d076c5 100644 | |||
43 | --- a/debian/apache2.install | |||
44 | +++ b/debian/apache2.install | |||
45 | @@ -9,3 +9,7 @@ debian/config-dir/envvars /etc/apache2 | |||
46 | 9 | debian/config-dir/magic /etc/apache2 | 9 | debian/config-dir/magic /etc/apache2 |
47 | 10 | debian/debhelper/apache2-maintscript-helper /usr/share/apache2/ | 10 | debian/debhelper/apache2-maintscript-helper /usr/share/apache2/ |
48 | 11 | debian/apache2-utils.ufw.profile /etc/ufw/applications.d/ | 11 | debian/apache2-utils.ufw.profile /etc/ufw/applications.d/ |
49 | 12 | <<<<<<< debian/apache2.install | ||
50 | 13 | ======= | ||
51 | 14 | debian/apache2-systemd.conf /lib/systemd/system/apache2.service.d/ | ||
52 | 15 | >>>>>>> debian/apache2.install | ||
53 | diff --git a/debian/changelog b/debian/changelog | |||
54 | index 0dbb7c5..27857c7 100644 | |||
55 | --- a/debian/changelog | |||
56 | +++ b/debian/changelog | |||
57 | @@ -1,4 +1,25 @@ | |||
58 | 1 | <<<<<<< debian/changelog | ||
59 | 1 | apache2 (2.4.48-3.1ubuntu3) impish; urgency=medium | 2 | apache2 (2.4.48-3.1ubuntu3) impish; urgency=medium |
60 | 3 | ======= | ||
61 | 4 | apache2 (2.4.29-1ubuntu4.20) bionic; urgency=medium | ||
62 | 5 | |||
63 | 6 | * Revert fix from 2.4.29-1ubuntu4.19, due to performance regression. | ||
64 | 7 | (LP 1832182) | ||
65 | 8 | |||
66 | 9 | -- Bryce Harrington <bryce@canonical.com> Sun, 14 Nov 2021 23:52:18 +0000 | ||
67 | 10 | |||
68 | 11 | apache2 (2.4.29-1ubuntu4.19) bionic; urgency=medium | ||
69 | 12 | |||
70 | 13 | * d/apache2ctl: Also use systemd for graceful if it is in use. | ||
71 | 14 | (LP: #1832182) | ||
72 | 15 | - This extends an earlier fix for the start command to behave | ||
73 | 16 | similarly for restart / graceful. Fixes service failures on | ||
74 | 17 | unattended upgrade. | ||
75 | 18 | |||
76 | 19 | -- Bryce Harrington <bryce@canonical.com> Tue, 28 Sep 2021 22:27:27 +0000 | ||
77 | 20 | |||
78 | 21 | apache2 (2.4.29-1ubuntu4.18) bionic-security; urgency=medium | ||
79 | 22 | >>>>>>> debian/changelog | ||
80 | 2 | 23 | ||
81 | 3 | * SECURITY REGRESSION: Issues in UDS URIs (LP: #1945311) | 24 | * SECURITY REGRESSION: Issues in UDS URIs (LP: #1945311) |
82 | 4 | - debian/patches/CVE-2021-40438-2.patch: Fix UDS unix: scheme for P | 25 | - debian/patches/CVE-2021-40438-2.patch: Fix UDS unix: scheme for P |
83 | @@ -7,11 +28,31 @@ apache2 (2.4.48-3.1ubuntu3) impish; urgency=medium | |||
84 | 7 | hostname in modules/mappers/mod_rewrite.c, | 28 | hostname in modules/mappers/mod_rewrite.c, |
85 | 8 | modules/proxy/proxy_util.c. | 29 | modules/proxy/proxy_util.c. |
86 | 9 | 30 | ||
87 | 31 | <<<<<<< debian/changelog | ||
88 | 10 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Tue, 28 Sep 2021 08:52:26 -0400 | 32 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Tue, 28 Sep 2021 08:52:26 -0400 |
89 | 11 | 33 | ||
90 | 12 | apache2 (2.4.48-3.1ubuntu2) impish; urgency=medium | 34 | apache2 (2.4.48-3.1ubuntu2) impish; urgency=medium |
91 | 13 | 35 | ||
92 | 14 | * SECURITY UPDATE: request splitting over HTTP/2 | 36 | * SECURITY UPDATE: request splitting over HTTP/2 |
93 | 37 | ======= | ||
94 | 38 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Tue, 28 Sep 2021 07:01:16 -0400 | ||
95 | 39 | |||
96 | 40 | apache2 (2.4.29-1ubuntu4.17) bionic-security; urgency=medium | ||
97 | 41 | |||
98 | 42 | * SECURITY UPDATE: request splitting over HTTP/2 | ||
99 | 43 | - debian/patches/CVE-2021-33193-pre1.patch: process early errors via a | ||
100 | 44 | dummy HTTP/1.1 request as well in modules/http2/h2.h, | ||
101 | 45 | modules/http2/h2_request.c, modules/http2/h2_session.c, | ||
102 | 46 | modules/http2/h2_stream.c. | ||
103 | 47 | - debian/patches/CVE-2021-33193-pre2.patch: sync with github standalone | ||
104 | 48 | version 1.15.17 in modules/http2/h2_bucket_beam.c, | ||
105 | 49 | modules/http2/h2_config.c, modules/http2/h2_config.h, | ||
106 | 50 | modules/http2/h2_h2.c, modules/http2/h2_headers.c, | ||
107 | 51 | modules/http2/h2_headers.h, modules/http2/h2_mplx.c, | ||
108 | 52 | modules/http2/h2_request.c, modules/http2/h2_stream.h, | ||
109 | 53 | modules/http2/h2_task.c, modules/http2/h2_task.h, | ||
110 | 54 | modules/http2/h2_version.h. | ||
111 | 55 | >>>>>>> debian/changelog | ||
112 | 15 | - debian/patches/CVE-2021-33193.patch: refactor request parsing in | 56 | - debian/patches/CVE-2021-33193.patch: refactor request parsing in |
113 | 16 | include/ap_mmn.h, include/http_core.h, include/http_protocol.h, | 57 | include/ap_mmn.h, include/http_core.h, include/http_protocol.h, |
114 | 17 | include/http_vhost.h, modules/http2/h2_request.c, server/core.c, | 58 | include/http_vhost.h, modules/http2/h2_request.c, server/core.c, |
115 | @@ -21,10 +62,13 @@ apache2 (2.4.48-3.1ubuntu2) impish; urgency=medium | |||
116 | 21 | - debian/patches/CVE-2021-34798.patch: add NULL check in | 62 | - debian/patches/CVE-2021-34798.patch: add NULL check in |
117 | 22 | server/scoreboard.c. | 63 | server/scoreboard.c. |
118 | 23 | - CVE-2021-34798 | 64 | - CVE-2021-34798 |
119 | 65 | <<<<<<< debian/changelog | ||
120 | 24 | * SECURITY UPDATE: DoS in mod_proxy_uwsgi | 66 | * SECURITY UPDATE: DoS in mod_proxy_uwsgi |
121 | 25 | - debian/patches/CVE-2021-36160.patch: fix PATH_INFO setting for | 67 | - debian/patches/CVE-2021-36160.patch: fix PATH_INFO setting for |
122 | 26 | generic worker in modules/proxy/mod_proxy_uwsgi.c. | 68 | generic worker in modules/proxy/mod_proxy_uwsgi.c. |
123 | 27 | - CVE-2021-36160 | 69 | - CVE-2021-36160 |
124 | 70 | ======= | ||
125 | 71 | >>>>>>> debian/changelog | ||
126 | 28 | * SECURITY UPDATE: buffer overflow in ap_escape_quotes | 72 | * SECURITY UPDATE: buffer overflow in ap_escape_quotes |
127 | 29 | - debian/patches/CVE-2021-39275.patch: fix ap_escape_quotes | 73 | - debian/patches/CVE-2021-39275.patch: fix ap_escape_quotes |
128 | 30 | substitution logic in server/util.c. | 74 | substitution logic in server/util.c. |
129 | @@ -37,6 +81,7 @@ apache2 (2.4.48-3.1ubuntu2) impish; urgency=medium | |||
130 | 37 | configured UDS path in modules/proxy/proxy_util.c. | 81 | configured UDS path in modules/proxy/proxy_util.c. |
131 | 38 | - CVE-2021-40438 | 82 | - CVE-2021-40438 |
132 | 39 | 83 | ||
133 | 84 | <<<<<<< debian/changelog | ||
134 | 40 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Thu, 23 Sep 2021 12:51:16 -0400 | 85 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Thu, 23 Sep 2021 12:51:16 -0400 |
135 | 41 | 86 | ||
136 | 42 | apache2 (2.4.48-3.1ubuntu1) impish; urgency=medium | 87 | apache2 (2.4.48-3.1ubuntu1) impish; urgency=medium |
137 | @@ -174,6 +219,12 @@ apache2 (2.4.46-4ubuntu2) impish; urgency=medium | |||
138 | 174 | - debian/patches/CVE-2020-13950.patch: don't dereference NULL proxy | 219 | - debian/patches/CVE-2020-13950.patch: don't dereference NULL proxy |
139 | 175 | connection in modules/proxy/mod_proxy_http.c. | 220 | connection in modules/proxy/mod_proxy_http.c. |
140 | 176 | - CVE-2020-13950 | 221 | - CVE-2020-13950 |
141 | 222 | ======= | ||
142 | 223 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Thu, 23 Sep 2021 13:01:10 -0400 | ||
143 | 224 | |||
144 | 225 | apache2 (2.4.29-1ubuntu4.16) bionic-security; urgency=medium | ||
145 | 226 | |||
146 | 227 | >>>>>>> debian/changelog | ||
147 | 177 | * SECURITY UPDATE: stack overflow via Digest nonce in mod_auth_digest | 228 | * SECURITY UPDATE: stack overflow via Digest nonce in mod_auth_digest |
148 | 178 | - debian/patches/CVE-2020-35452.patch: fast validation of the nonce's | 229 | - debian/patches/CVE-2020-35452.patch: fast validation of the nonce's |
149 | 179 | base64 to fail early if the format can't match anyway in | 230 | base64 to fail early if the format can't match anyway in |
150 | @@ -191,6 +242,7 @@ apache2 (2.4.46-4ubuntu2) impish; urgency=medium | |||
151 | 191 | - debian/patches/CVE-2021-30641.patch: change default behavior in | 242 | - debian/patches/CVE-2021-30641.patch: change default behavior in |
152 | 192 | server/request.c. | 243 | server/request.c. |
153 | 193 | - CVE-2021-30641 | 244 | - CVE-2021-30641 |
154 | 245 | <<<<<<< debian/changelog | ||
155 | 194 | 246 | ||
156 | 195 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Thu, 17 Jun 2021 13:09:41 -0400 | 247 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Thu, 17 Jun 2021 13:09:41 -0400 |
157 | 196 | 248 | ||
158 | @@ -573,6 +625,143 @@ apache2 (2.4.38-3ubuntu1) eoan; urgency=low | |||
159 | 573 | apache2 (2.4.38-3) unstable; urgency=high | 625 | apache2 (2.4.38-3) unstable; urgency=high |
160 | 574 | 626 | ||
161 | 575 | [ Marc Deslauriers ] | 627 | [ Marc Deslauriers ] |
162 | 628 | ======= | ||
163 | 629 | * This update does _not_ include the changes from 2.4.29-1ubuntu4.15 in | ||
164 | 630 | bionic-proposed. | ||
165 | 631 | |||
166 | 632 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Fri, 18 Jun 2021 07:06:22 -0400 | ||
167 | 633 | |||
168 | 634 | apache2 (2.4.29-1ubuntu4.14) bionic-security; urgency=medium | ||
169 | 635 | |||
170 | 636 | * SECURITY UPDATE: mod_rewrite redirect issue | ||
171 | 637 | - debian/patches/CVE-2020-1927-1.patch: factor out default regex flags | ||
172 | 638 | in include/ap_regex.h, server/core.c, server/util_pcre.c. | ||
173 | 639 | - debian/patches/CVE-2020-1927-2.patch: add AP_REG_NO_DEFAULT to allow | ||
174 | 640 | opt-out of pcre defaults in include/ap_regex.h, | ||
175 | 641 | modules/filters/mod_substitute.c, server/util_pcre.c, | ||
176 | 642 | server/util_regex.c. | ||
177 | 643 | - CVE-2020-1927 | ||
178 | 644 | * SECURITY UPDATE: mod_proxy_ftp uninitialized memory issue | ||
179 | 645 | - debian/patches/CVE-2020-1934.patch: trap bad FTP responses in | ||
180 | 646 | modules/proxy/mod_proxy_ftp.c. | ||
181 | 647 | - CVE-2020-1934 | ||
182 | 648 | * SECURITY UPDATE: DoS via invalid Cache-Digest header | ||
183 | 649 | - debian/patches/CVE-2020-9490.patch: remove support for abandoned | ||
184 | 650 | http-wg draft in modules/http2/h2_push.c, modules/http2/h2_push.h. | ||
185 | 651 | - CVE-2020-9490 | ||
186 | 652 | * SECURITY UPDATE: concurrent use of memory pools in HTTP/2 module | ||
187 | 653 | - debian/patches/CVE-2020-11993-pre1.patch: fixed rare cases where a h2 | ||
188 | 654 | worker could deadlock the main connection in modules/http2/*. | ||
189 | 655 | - debian/patches/CVE-2020-11993.patch: fix logging and rename | ||
190 | 656 | terminology in modules/http2/*. | ||
191 | 657 | - CVE-2020-11993 | ||
192 | 658 | |||
193 | 659 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Wed, 12 Aug 2020 17:33:25 -0400 | ||
194 | 660 | |||
195 | 661 | apache2 (2.4.29-1ubuntu4.13) bionic-security; urgency=medium | ||
196 | 662 | |||
197 | 663 | * Add additional missing commits to TLSv1.3 support. (LP: #1867223) | ||
198 | 664 | - debian/patches/tlsv1.3-support-2.patch: fix whitespace and copy/paste | ||
199 | 665 | typos in modules/ssl/ssl_engine_kernel.c. | ||
200 | 666 | - debian/patches/tlsv1.3-support-3.patch: fail with 403 if | ||
201 | 667 | SSL_verify_client_post_handshake fails in | ||
202 | 668 | modules/ssl/ssl_engine_kernel.c. | ||
203 | 669 | - debian/patches/tlsv1.3-support-4.patch: disable AUTO_RETRY mode for | ||
204 | 670 | OpenSSL 1.1.1, which fixes post-handshake authentication in | ||
205 | 671 | modules/ssl/ssl_engine_init.c. | ||
206 | 672 | - debian/patches/tlsv1.3-support-5.patch: retrieve and set | ||
207 | 673 | sslconn->client_cert here for both "modern" and classic access | ||
208 | 674 | control in modules/ssl/ssl_engine_kernel.c. | ||
209 | 675 | |||
210 | 676 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Fri, 13 Mar 2020 08:26:16 -0400 | ||
211 | 677 | |||
212 | 678 | apache2 (2.4.29-1ubuntu4.12) bionic; urgency=medium | ||
213 | 679 | |||
214 | 680 | * Add TLSv1.3 support. (LP: #1845263) | ||
215 | 681 | - debian/patches/tlsv1.3-support.patch: backport upstream 2.4 commit | ||
216 | 682 | which introduced TLSv1.3 support. | ||
217 | 683 | |||
218 | 684 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Tue, 03 Dec 2019 10:55:03 -0500 | ||
219 | 685 | |||
220 | 686 | apache2 (2.4.29-1ubuntu4.11) bionic-security; urgency=medium | ||
221 | 687 | |||
222 | 688 | * SECURITY REGRESSION: mod_proxy balancer XSS/CSRF hardening broke | ||
223 | 689 | browsers which change case in headers and breaks balancers | ||
224 | 690 | loading in some configurations (LP: #1842701) | ||
225 | 691 | - drop d/p/CVE-2019-10092-3.patch | ||
226 | 692 | |||
227 | 693 | -- Steve Beattie <sbeattie@ubuntu.com> Mon, 16 Sep 2019 05:58:48 -0700 | ||
228 | 694 | |||
229 | 695 | apache2 (2.4.29-1ubuntu4.10) bionic-security; urgency=medium | ||
230 | 696 | |||
231 | 697 | * SECURITY UPDATE: HTTP/2 internal data buffering denial of service. | ||
232 | 698 | - d/p/mod_http2-1.15.4-backport-0004-CVE-2019-9517.patch: improve | ||
233 | 699 | http/2 module keepalive throttling. | ||
234 | 700 | - CVE-2019-9517 | ||
235 | 701 | * SECURITY UPDATE: Upgrade request from http/1.1 to http/2 crash | ||
236 | 702 | denial of service (LP: #1840188) | ||
237 | 703 | - d/p/mod_http2-1.14.1-backport-0019-Merge-r1852038-r1852101-from-trunk-CVE-2019-0197.patch: | ||
238 | 704 | re-use slave connections and fix slave connection keepalives | ||
239 | 705 | counter. | ||
240 | 706 | - CVE-2019-0197 | ||
241 | 707 | * SECURITY UPDATE: mod_http2 memory corruption on early pushes | ||
242 | 708 | - included in mod_http2 1.15.4 backport | ||
243 | 709 | - CVE-2019-10081 | ||
244 | 710 | * SECURITY UPDATE: read-after-free in mod_http2 h2 connection | ||
245 | 711 | shutdown. | ||
246 | 712 | - included in mod_http2 1.15.4 backport | ||
247 | 713 | - CVE-2019-10082 | ||
248 | 714 | * SECURITY UPDATE: Limited cross-site scripting in mod_proxy | ||
249 | 715 | error page. | ||
250 | 716 | - d/p/CVE-2019-10092-1.patch: Remove request details from built-in | ||
251 | 717 | error documents. | ||
252 | 718 | - d/p/CVE-2019-10092-2.patch: Add missing log numbers. | ||
253 | 719 | - d/p/CVE-2019-10092-3.patch: mod_proxy: Improve XSRF/XSS | ||
254 | 720 | protection. | ||
255 | 721 | - CVE-2019-10092-1 | ||
256 | 722 | * SECURITY UPDATE: mod_rewrite potential open redirect. | ||
257 | 723 | - d/p/CVE-2019-10098.patch: Set PCRE_DOTALL by default. | ||
258 | 724 | - CVE-2019-10098 | ||
259 | 725 | * Backport mod_http2 v1.14.1 and v1.15.4 for CVE-2019-9517, | ||
260 | 726 | CVE-2019-10081, and CVE-2019-10082 fixes: | ||
261 | 727 | - add d/p/mod_http2-1.14.1-backport-*.patches and | ||
262 | 728 | d/p/mod_http2-1.15.4-backport-*.patches | ||
263 | 729 | - dropped the following patches included above: | ||
264 | 730 | + d/p/CVE-2018-1302.patch | ||
265 | 731 | + d/p/CVE-2018-1333.patch | ||
266 | 732 | + d/p/CVE-2018-11763.patch | ||
267 | 733 | + d/p/CVE-2018-17189.patch | ||
268 | 734 | + d/p/CVE-2019-0196.patch | ||
269 | 735 | |||
270 | 736 | -- Steve Beattie <sbeattie@ubuntu.com> Mon, 26 Aug 2019 06:41:23 -0700 | ||
271 | 737 | |||
272 | 738 | apache2 (2.4.29-1ubuntu4.8) bionic; urgency=medium | ||
273 | 739 | |||
274 | 740 | * d/p/ssl-read-rc-value-openssl-1.1.1.patch: Handle SSL_read() return code 0 | ||
275 | 741 | similarly to <0 with openssl 1.1.1 | ||
276 | 742 | * d/p/clear-retry-flags-before-abort.patch: clear retry flags before | ||
277 | 743 | aborting on client-initiated reneg (LP: #1836329) | ||
278 | 744 | |||
279 | 745 | -- Andreas Hasenack <andreas@canonical.com> Tue, 16 Jul 2019 15:14:45 -0300 | ||
280 | 746 | |||
281 | 747 | apache2 (2.4.29-1ubuntu4.7) bionic; urgency=medium | ||
282 | 748 | |||
283 | 749 | * d/p/disable-ssl-1.1.1-auto-retry.patch: fix client certificate | ||
284 | 750 | authentication when built with openssl 1.1.1 (LP: #1833039) | ||
285 | 751 | |||
286 | 752 | -- Andreas Hasenack <andreas@canonical.com> Fri, 28 Jun 2019 13:49:35 -0300 | ||
287 | 753 | |||
288 | 754 | apache2 (2.4.29-1ubuntu4.6) bionic-security; urgency=medium | ||
289 | 755 | |||
290 | 756 | * SECURITY UPDATE: slowloris DoS in mod_http2 | ||
291 | 757 | - debian/patches/CVE-2018-17189.patch: change cleanup strategy for | ||
292 | 758 | slave connections in modules/http2/h2_conn.c. | ||
293 | 759 | - CVE-2018-17189 | ||
294 | 760 | * SECURITY UPDATE: mod_session expiry time issue | ||
295 | 761 | - debian/patches/CVE-2018-17199.patch: always decode session attributes | ||
296 | 762 | early in modules/session/mod_session.c. | ||
297 | 763 | - CVE-2018-17199 | ||
298 | 764 | >>>>>>> debian/changelog | ||
299 | 576 | * SECURITY UPDATE: read-after-free on a string compare in mod_http2 | 765 | * SECURITY UPDATE: read-after-free on a string compare in mod_http2 |
300 | 577 | - debian/patches/CVE-2019-0196.patch: disentangelment of stream and | 766 | - debian/patches/CVE-2019-0196.patch: disentangelment of stream and |
301 | 578 | request method in modules/http2/h2_request.c. | 767 | request method in modules/http2/h2_request.c. |
302 | @@ -583,10 +772,13 @@ apache2 (2.4.38-3) unstable; urgency=high | |||
303 | 583 | server/mpm/event/event.c, server/mpm/prefork/prefork.c, | 772 | server/mpm/event/event.c, server/mpm/prefork/prefork.c, |
304 | 584 | server/mpm/worker/worker.c. | 773 | server/mpm/worker/worker.c. |
305 | 585 | - CVE-2019-0211 | 774 | - CVE-2019-0211 |
306 | 775 | <<<<<<< debian/changelog | ||
307 | 586 | * SECURITY UPDATE: mod_ssl access control bypass | 776 | * SECURITY UPDATE: mod_ssl access control bypass |
308 | 587 | - debian/patches/CVE-2019-0215.patch: restore SSL verify state after | 777 | - debian/patches/CVE-2019-0215.patch: restore SSL verify state after |
309 | 588 | PHA failure in TLSv1.3 in modules/ssl/ssl_engine_kernel.c. | 778 | PHA failure in TLSv1.3 in modules/ssl/ssl_engine_kernel.c. |
310 | 589 | - CVE-2019-0215 | 779 | - CVE-2019-0215 |
311 | 780 | ======= | ||
312 | 781 | >>>>>>> debian/changelog | ||
313 | 590 | * SECURITY UPDATE: mod_auth_digest access control bypass | 782 | * SECURITY UPDATE: mod_auth_digest access control bypass |
314 | 591 | - debian/patches/CVE-2019-0217.patch: fix a race condition in | 783 | - debian/patches/CVE-2019-0217.patch: fix a race condition in |
315 | 592 | modules/aaa/mod_auth_digest.c. | 784 | modules/aaa/mod_auth_digest.c. |
316 | @@ -601,6 +793,7 @@ apache2 (2.4.38-3) unstable; urgency=high | |||
317 | 601 | server/util.c. | 793 | server/util.c. |
318 | 602 | - CVE-2019-0220 | 794 | - CVE-2019-0220 |
319 | 603 | 795 | ||
320 | 796 | <<<<<<< debian/changelog | ||
321 | 604 | [ Stefan Fritsch ] | 797 | [ Stefan Fritsch ] |
322 | 605 | * Pull security fixes from 2.4.39 via Ubuntu | 798 | * Pull security fixes from 2.4.39 via Ubuntu |
323 | 606 | * CVE-2019-0197: mod_http2: Fix possible crash on late upgrade | 799 | * CVE-2019-0197: mod_http2: Fix possible crash on late upgrade |
324 | @@ -765,11 +958,35 @@ apache2 (2.4.35-1) unstable; urgency=medium | |||
325 | 765 | apache2 (2.4.34-1ubuntu2) cosmic; urgency=medium | 958 | apache2 (2.4.34-1ubuntu2) cosmic; urgency=medium |
326 | 766 | 959 | ||
327 | 767 | * SECURITY UPDATE: denial of service in HTTP/2 via large SETTINGS frames | 960 | * SECURITY UPDATE: denial of service in HTTP/2 via large SETTINGS frames |
328 | 961 | ======= | ||
329 | 962 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Wed, 03 Apr 2019 09:22:37 -0400 | ||
330 | 963 | |||
331 | 964 | apache2 (2.4.29-1ubuntu4.5) bionic; urgency=medium | ||
332 | 965 | |||
333 | 966 | * d/debhelper/apache2-maintscript-helper: fix typo in apache2_switch_mpm()'s | ||
334 | 967 | a2query call. (LP: #1782806) | ||
335 | 968 | |||
336 | 969 | -- Andreas Hasenack <andreas@canonical.com> Wed, 10 Oct 2018 15:59:25 -0300 | ||
337 | 970 | |||
338 | 971 | apache2 (2.4.29-1ubuntu4.4) bionic-security; urgency=medium | ||
339 | 972 | |||
340 | 973 | * SECURITY UPDATE: DoS in HTTP/2 via NULL pointer | ||
341 | 974 | - debian/patches/CVE-2018-1302.patch: remove obsolete stream detach | ||
342 | 975 | code in modules/http2/h2_bucket_beam.c, modules/http2/h2_stream.c, | ||
343 | 976 | modules/http2/h2_stream.h. | ||
344 | 977 | - CVE-2018-1302 | ||
345 | 978 | * SECURITY UPDATE: DoS in HTTP/2 via worker exhaustion | ||
346 | 979 | - debian/patches/CVE-2018-1333.patch: always wake up any conditional | ||
347 | 980 | waits when streams are aborted in modules/http2/h2_bucket_beam.c. | ||
348 | 981 | - CVE-2018-1333 | ||
349 | 982 | * SECURITY UPDATE: DoS in HTTP/2 via large SETTINGS frames | ||
350 | 983 | >>>>>>> debian/changelog | ||
351 | 768 | - debian/patches/CVE-2018-11763.patch: rework connection IO event | 984 | - debian/patches/CVE-2018-11763.patch: rework connection IO event |
352 | 769 | handling in modules/http2/h2_session.c, modules/http2/h2_session.h, | 985 | handling in modules/http2/h2_session.c, modules/http2/h2_session.h, |
353 | 770 | modules/http2/h2_version.h. | 986 | modules/http2/h2_version.h. |
354 | 771 | - CVE-2018-11763 | 987 | - CVE-2018-11763 |
355 | 772 | 988 | ||
356 | 989 | <<<<<<< debian/changelog | ||
357 | 773 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Wed, 03 Oct 2018 09:57:22 -0400 | 990 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Wed, 03 Oct 2018 09:57:22 -0400 |
358 | 774 | 991 | ||
359 | 775 | apache2 (2.4.34-1ubuntu1) cosmic; urgency=medium | 992 | apache2 (2.4.34-1ubuntu1) cosmic; urgency=medium |
360 | @@ -963,6 +1180,26 @@ apache2 (2.4.29-2) unstable; urgency=medium | |||
361 | 963 | * Add Build-Depends on libbrotli-dev and enable brotli module | 1180 | * Add Build-Depends on libbrotli-dev and enable brotli module |
362 | 964 | 1181 | ||
363 | 965 | -- Ondřej Surý <ondrej@debian.org> Sun, 14 Jan 2018 11:01:58 +0000 | 1182 | -- Ondřej Surý <ondrej@debian.org> Sun, 14 Jan 2018 11:01:58 +0000 |
364 | 1183 | ======= | ||
365 | 1184 | -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Wed, 03 Oct 2018 10:41:08 -0400 | ||
366 | 1185 | |||
367 | 1186 | apache2 (2.4.29-1ubuntu4.3) bionic; urgency=medium | ||
368 | 1187 | |||
369 | 1188 | * d/p/balance-member-long-hostname-part{1,2}.patch: Provide an RFC1035 | ||
370 | 1189 | compliant version of the hostname in the | ||
371 | 1190 | proxy_worker_shared structure. A hostname that is too long is no longer a | ||
372 | 1191 | fatal error. (LP: #1750356) | ||
373 | 1192 | |||
374 | 1193 | -- Andreas Hasenack <andreas@canonical.com> Wed, 27 Jun 2018 14:05:04 -0300 | ||
375 | 1194 | |||
376 | 1195 | apache2 (2.4.29-1ubuntu4.2) bionic; urgency=medium | ||
377 | 1196 | |||
378 | 1197 | * debian/patches/includeoptional-ignore-non-existent.patch: silently | ||
379 | 1198 | ignore a not existent file path with IncludeOptional . Closes LP: | ||
380 | 1199 | #1766186. | ||
381 | 1200 | |||
382 | 1201 | -- Andreas Hasenack <andreas@canonical.com> Thu, 07 Jun 2018 18:10:10 -0300 | ||
383 | 1202 | >>>>>>> debian/changelog | ||
384 | 966 | 1203 | ||
385 | 967 | apache2 (2.4.29-1ubuntu4.1) bionic-security; urgency=medium | 1204 | apache2 (2.4.29-1ubuntu4.1) bionic-security; urgency=medium |
386 | 968 | 1205 | ||
387 | @@ -3072,6 +3309,18 @@ apache2 (2.2.21-5ubuntu1) precise; urgency=low | |||
388 | 3072 | 3309 | ||
389 | 3073 | -- Chuck Short <zulcss@ubuntu.com> Mon, 09 Jan 2012 06:26:31 +0000 | 3310 | -- Chuck Short <zulcss@ubuntu.com> Mon, 09 Jan 2012 06:26:31 +0000 |
390 | 3074 | 3311 | ||
391 | 3312 | apache2 (2.2.21-5ubuntu1) precise; urgency=low | ||
392 | 3313 | |||
393 | 3314 | * Merge from Debian testing. Remaining changes: | ||
394 | 3315 | - debian/{control, rules}: Enable PIE hardening. | ||
395 | 3316 | - debian/{control, rules, apache2.2-common.ufw.profile}: Add ufw profiles. | ||
396 | 3317 | - debian/control: Add bzr tag and point it to our tree | ||
397 | 3318 | - debian/apache2.py, debian/apache2.2-common.install: Add apport hook. | ||
398 | 3319 | - debian/control, debian/ask-for-passphrase, debian/config-dir/mods-available/ssl.conf: | ||
399 | 3320 | Plymouth aware passphrase dialog program ask-for-passphrase. | ||
400 | 3321 | |||
401 | 3322 | -- Chuck Short <zulcss@ubuntu.com> Mon, 09 Jan 2012 06:26:31 +0000 | ||
402 | 3323 | |||
403 | 3075 | apache2 (2.2.21-5) unstable; urgency=low | 3324 | apache2 (2.2.21-5) unstable; urgency=low |
404 | 3076 | 3325 | ||
405 | 3077 | [ Arno Töll ] | 3326 | [ Arno Töll ] |
406 | diff --git a/debian/control b/debian/control | |||
407 | index c12b174..9c00a61 100644 | |||
408 | --- a/debian/control | |||
409 | +++ b/debian/control | |||
410 | @@ -7,6 +7,7 @@ Uploaders: Stefan Fritsch <sf@debian.org>, | |||
411 | 7 | Yadd <yadd@debian.org> | 7 | Yadd <yadd@debian.org> |
412 | 8 | Section: httpd | 8 | Section: httpd |
413 | 9 | Priority: optional | 9 | Priority: optional |
414 | 10 | <<<<<<< debian/control | ||
415 | 10 | Build-Depends: debhelper-compat (= 13), | 11 | Build-Depends: debhelper-compat (= 13), |
416 | 11 | dpkg-dev (>= 1.16.1~), | 12 | dpkg-dev (>= 1.16.1~), |
417 | 12 | bison, | 13 | bison, |
418 | @@ -25,6 +26,15 @@ Build-Depends: debhelper-compat (= 13), | |||
419 | 25 | zlib1g-dev, | 26 | zlib1g-dev, |
420 | 26 | libcurl4-openssl-dev | libcurl4-dev, | 27 | libcurl4-openssl-dev | libcurl4-dev, |
421 | 27 | libjansson-dev | 28 | libjansson-dev |
422 | 29 | ======= | ||
423 | 30 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> | ||
424 | 31 | XSBC-Original-Maintainer: Debian Apache Maintainers <debian-apache@lists.debian.org> | ||
425 | 32 | Uploaders: Stefan Fritsch <sf@debian.org>, Arno Töll <arno@debian.org> | ||
426 | 33 | Build-Depends: debhelper (>= 9.20160709~), lsb-release, dpkg-dev (>= 1.16.1~), | ||
427 | 34 | libaprutil1-dev (>= 1.5.0), libapr1-dev (>= 1.5.0), libpcre3-dev, zlib1g-dev, | ||
428 | 35 | libnghttp2-dev, libssl-dev (>= 1.1), perl, | ||
429 | 36 | liblua5.2-dev, libxml2-dev, autotools-dev, gawk | awk | ||
430 | 37 | >>>>>>> debian/control | ||
431 | 28 | Build-Conflicts: autoconf2.13 | 38 | Build-Conflicts: autoconf2.13 |
432 | 29 | Standards-Version: 4.5.1 | 39 | Standards-Version: 4.5.1 |
433 | 30 | Vcs-Browser: https://salsa.debian.org/apache-team/apache2 | 40 | Vcs-Browser: https://salsa.debian.org/apache-team/apache2 |
434 | @@ -43,6 +53,7 @@ Depends: apache2-bin (= ${binary:Version}), | |||
435 | 43 | procps [!hurd-i386], | 53 | procps [!hurd-i386], |
436 | 44 | ${misc:Depends} | 54 | ${misc:Depends} |
437 | 45 | Recommends: ssl-cert | 55 | Recommends: ssl-cert |
438 | 56 | <<<<<<< debian/control | ||
439 | 46 | Suggests: apache2-doc, | 57 | Suggests: apache2-doc, |
440 | 47 | apache2-suexec-pristine | apache2-suexec-custom, | 58 | apache2-suexec-pristine | apache2-suexec-custom, |
441 | 48 | www-browser, | 59 | www-browser, |
442 | @@ -57,6 +68,11 @@ Provides: httpd, | |||
443 | 57 | Replaces: apache2.2-bin, | 68 | Replaces: apache2.2-bin, |
444 | 58 | apache2.2-common, | 69 | apache2.2-common, |
445 | 59 | libapache2-mod-proxy-uwsgi (<< 2.4.33) | 70 | libapache2-mod-proxy-uwsgi (<< 2.4.33) |
446 | 71 | ======= | ||
447 | 72 | Conflicts: apache2.2-common, apache2.2-bin | ||
448 | 73 | Replaces: apache2.2-common, apache2.2-bin | ||
449 | 74 | Suggests: www-browser, apache2-doc, apache2-suexec-pristine | apache2-suexec-custom, ufw | ||
450 | 75 | >>>>>>> debian/control | ||
451 | 60 | Description: Apache HTTP Server | 76 | Description: Apache HTTP Server |
452 | 61 | The Apache HTTP Server Project's goal is to build a secure, efficient and | 77 | The Apache HTTP Server Project's goal is to build a secure, efficient and |
453 | 62 | extensible HTTP server as standards-compliant open source software. The | 78 | extensible HTTP server as standards-compliant open source software. The |
454 | diff --git a/debian/patches/086_svn_cross_compiles b/debian/patches/086_svn_cross_compiles | |||
455 | 63 | new file mode 100644 | 79 | new file mode 100644 |
456 | index 0000000..b237908 | |||
457 | --- /dev/null | |||
458 | +++ b/debian/patches/086_svn_cross_compiles | |||
459 | @@ -0,0 +1,118 @@ | |||
460 | 1 | Description: Pull upstream fixes for autotools for cross-compiling | ||
461 | 2 | Author: Adam Conrad <adconrad@ubuntu.com> | ||
462 | 3 | Origin: upstream, http://svn.eu.apache.org/viewvc?view=revision&revision=1328445 | ||
463 | 4 | Origin: upstream, http://svn.eu.apache.org/viewvc?view=revision&revision=1327907 | ||
464 | 5 | Origin: upstream, http://svn.eu.apache.org/viewvc?view=revision&revision=1328390 | ||
465 | 6 | Origin: upstream, http://svn.eu.apache.org/viewvc?view=revision&revision=1328714 | ||
466 | 7 | Forwarded: not-needed | ||
467 | 8 | |||
468 | 9 | Index: apache2-2.4.29/acinclude.m4 | ||
469 | 10 | =================================================================== | ||
470 | 11 | --- apache2-2.4.29.orig/acinclude.m4 2017-11-10 10:56:51.488205250 -0500 | ||
471 | 12 | +++ apache2-2.4.29/acinclude.m4 2017-11-10 10:56:51.484205199 -0500 | ||
472 | 13 | @@ -55,6 +55,8 @@ AC_DEFUN([APACHE_GEN_CONFIG_VARS],[ | ||
473 | 14 | APACHE_SUBST(CPPFLAGS) | ||
474 | 15 | APACHE_SUBST(CFLAGS) | ||
475 | 16 | APACHE_SUBST(CXXFLAGS) | ||
476 | 17 | + APACHE_SUBST(CC_FOR_BUILD) | ||
477 | 18 | + APACHE_SUBST(CFLAGS_FOR_BUILD) | ||
478 | 19 | APACHE_SUBST(LTFLAGS) | ||
479 | 20 | APACHE_SUBST(LDFLAGS) | ||
480 | 21 | APACHE_SUBST(LT_LDFLAGS) | ||
481 | 22 | @@ -697,7 +699,7 @@ int main(void) | ||
482 | 23 | { | ||
483 | 24 | return sizeof(void *) < sizeof(long); | ||
484 | 25 | }], [ap_cv_void_ptr_lt_long=no], [ap_cv_void_ptr_lt_long=yes], | ||
485 | 26 | - [ap_cv_void_ptr_lt_long=yes])]) | ||
486 | 27 | + [ap_cv_void_ptr_lt_long="cross compile - not checked"])]) | ||
487 | 28 | |||
488 | 29 | if test "$ap_cv_void_ptr_lt_long" = "yes"; then | ||
489 | 30 | AC_MSG_ERROR([Size of "void *" is less than size of "long"]) | ||
490 | 31 | Index: apache2-2.4.29/configure | ||
491 | 32 | =================================================================== | ||
492 | 33 | --- apache2-2.4.29.orig/configure 2017-11-10 10:56:51.488205250 -0500 | ||
493 | 34 | +++ apache2-2.4.29/configure 2017-11-10 10:56:51.488205250 -0500 | ||
494 | 35 | @@ -662,6 +662,8 @@ HTTPD_LDFLAGS | ||
495 | 36 | SH_LDFLAGS | ||
496 | 37 | LT_LDFLAGS | ||
497 | 38 | LTFLAGS | ||
498 | 39 | +CFLAGS_FOR_BUILD | ||
499 | 40 | +CC_FOR_BUILD | ||
500 | 41 | CXXFLAGS | ||
501 | 42 | CXX | ||
502 | 43 | other_targets | ||
503 | 44 | @@ -6071,6 +6073,12 @@ fi | ||
504 | 45 | |||
505 | 46 | |||
506 | 47 | |||
507 | 48 | +if test "x${build_alias}" != "x${host_alias}"; then | ||
508 | 49 | + if test "x${CC_FOR_BUILD}" = "x"; then | ||
509 | 50 | + CC_FOR_BUILD=cc | ||
510 | 51 | + fi | ||
511 | 52 | +fi | ||
512 | 53 | + | ||
513 | 54 | if test "x${cache_file}" = "x/dev/null"; then | ||
514 | 55 | # Likewise, ensure that CC and CPP are passed through to the pcre | ||
515 | 56 | # configure script iff caching is disabled (the autoconf 2.5x default). | ||
516 | 57 | @@ -7698,7 +7706,7 @@ if ${ap_cv_void_ptr_lt_long+:} false; th | ||
517 | 58 | $as_echo_n "(cached) " >&6 | ||
518 | 59 | else | ||
519 | 60 | if test "$cross_compiling" = yes; then : | ||
520 | 61 | - ap_cv_void_ptr_lt_long=yes | ||
521 | 62 | + ap_cv_void_ptr_lt_long="cross compile - not checked" | ||
522 | 63 | else | ||
523 | 64 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
524 | 65 | /* end confdefs.h. */ | ||
525 | 66 | @@ -37522,6 +37530,14 @@ $as_echo "$as_me: " >&6;} | ||
526 | 67 | |||
527 | 68 | |||
528 | 69 | |||
529 | 70 | + APACHE_VAR_SUBST="$APACHE_VAR_SUBST CC_FOR_BUILD" | ||
530 | 71 | + | ||
531 | 72 | + | ||
532 | 73 | + | ||
533 | 74 | + APACHE_VAR_SUBST="$APACHE_VAR_SUBST CFLAGS_FOR_BUILD" | ||
534 | 75 | + | ||
535 | 76 | + | ||
536 | 77 | + | ||
537 | 78 | APACHE_VAR_SUBST="$APACHE_VAR_SUBST LTFLAGS" | ||
538 | 79 | |||
539 | 80 | |||
540 | 81 | Index: apache2-2.4.29/configure.in | ||
541 | 82 | =================================================================== | ||
542 | 83 | --- apache2-2.4.29.orig/configure.in 2017-11-10 10:56:51.488205250 -0500 | ||
543 | 84 | +++ apache2-2.4.29/configure.in 2017-11-10 10:56:51.488205250 -0500 | ||
544 | 85 | @@ -206,6 +206,14 @@ AC_PROG_CPP | ||
545 | 86 | dnl Try to get c99 support for variadic macros | ||
546 | 87 | ifdef([AC_PROG_CC_C99], [AC_PROG_CC_C99]) | ||
547 | 88 | |||
548 | 89 | +dnl In case of cross compilation we set CC_FOR_BUILD to cc unless | ||
549 | 90 | +dnl we got already CC_FOR_BUILD from environment. | ||
550 | 91 | +if test "x${build_alias}" != "x${host_alias}"; then | ||
551 | 92 | + if test "x${CC_FOR_BUILD}" = "x"; then | ||
552 | 93 | + CC_FOR_BUILD=cc | ||
553 | 94 | + fi | ||
554 | 95 | +fi | ||
555 | 96 | + | ||
556 | 97 | if test "x${cache_file}" = "x/dev/null"; then | ||
557 | 98 | # Likewise, ensure that CC and CPP are passed through to the pcre | ||
558 | 99 | # configure script iff caching is disabled (the autoconf 2.5x default). | ||
559 | 100 | Index: apache2-2.4.29/server/Makefile.in | ||
560 | 101 | =================================================================== | ||
561 | 102 | --- apache2-2.4.29.orig/server/Makefile.in 2017-11-10 10:56:51.488205250 -0500 | ||
562 | 103 | +++ apache2-2.4.29/server/Makefile.in 2017-11-10 10:56:51.488205250 -0500 | ||
563 | 104 | @@ -24,9 +24,14 @@ TARGETS = delete-exports $(LTLIBRARY_NAM | ||
564 | 105 | include $(top_builddir)/build/rules.mk | ||
565 | 106 | include $(top_srcdir)/build/library.mk | ||
566 | 107 | |||
567 | 108 | +ifdef CC_FOR_BUILD | ||
568 | 109 | +gen_test_char: gen_test_char.c | ||
569 | 110 | + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DCROSS_COMPILE -o $@ $< | ||
570 | 111 | +else | ||
571 | 112 | gen_test_char_OBJECTS = gen_test_char.lo | ||
572 | 113 | gen_test_char: $(gen_test_char_OBJECTS) | ||
573 | 114 | $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS) | ||
574 | 115 | +endif | ||
575 | 116 | |||
576 | 117 | test_char.h: gen_test_char | ||
577 | 118 | ./gen_test_char > test_char.h | ||
578 | diff --git a/debian/patches/CVE-2017-15710.patch b/debian/patches/CVE-2017-15710.patch | |||
579 | 0 | new file mode 100644 | 119 | new file mode 100644 |
580 | index 0000000..a218970 | |||
581 | --- /dev/null | |||
582 | +++ b/debian/patches/CVE-2017-15710.patch | |||
583 | @@ -0,0 +1,24 @@ | |||
584 | 1 | Description: fix DoS via missing header with AuthLDAPCharsetConfig | ||
585 | 2 | Origin: upstream, http://svn.apache.org/viewvc?view=revision&revision=1824456 | ||
586 | 3 | |||
587 | 4 | Index: apache2-2.4.29/modules/aaa/mod_authnz_ldap.c | ||
588 | 5 | =================================================================== | ||
589 | 6 | --- apache2-2.4.29.orig/modules/aaa/mod_authnz_ldap.c 2017-06-29 07:31:20.000000000 -0400 | ||
590 | 7 | +++ apache2-2.4.29/modules/aaa/mod_authnz_ldap.c 2018-04-18 09:14:38.995193064 -0400 | ||
591 | 8 | @@ -126,9 +126,13 @@ static char* derive_codepage_from_lang ( | ||
592 | 9 | |||
593 | 10 | charset = (char*) apr_hash_get(charset_conversions, language, APR_HASH_KEY_STRING); | ||
594 | 11 | |||
595 | 12 | - if (!charset) { | ||
596 | 13 | - language[2] = '\0'; | ||
597 | 14 | - charset = (char*) apr_hash_get(charset_conversions, language, APR_HASH_KEY_STRING); | ||
598 | 15 | + /* | ||
599 | 16 | + * Test if language values like 'en-US' return a match from the charset | ||
600 | 17 | + * conversion map when shortened to 'en'. | ||
601 | 18 | + */ | ||
602 | 19 | + if (!charset && strlen(language) > 3 && language[2] == '-') { | ||
603 | 20 | + char *language_short = apr_pstrndup(p, language, 2); | ||
604 | 21 | + charset = (char*) apr_hash_get(charset_conversions, language_short, APR_HASH_KEY_STRING); | ||
605 | 22 | } | ||
606 | 23 | |||
607 | 24 | if (charset) { | ||
608 | diff --git a/debian/patches/CVE-2017-15715.patch b/debian/patches/CVE-2017-15715.patch | |||
609 | 0 | new file mode 100644 | 25 | new file mode 100644 |
610 | index 0000000..157a0b2 | |||
611 | --- /dev/null | |||
612 | +++ b/debian/patches/CVE-2017-15715.patch | |||
613 | @@ -0,0 +1,192 @@ | |||
614 | 1 | Description: fix incorrect <FilesMatch> matching | ||
615 | 2 | Origin: upstream, https://svn.apache.org/viewvc?view=revision&revision=1824472 | ||
616 | 3 | |||
617 | 4 | Index: apache2-2.4.29/include/ap_regex.h | ||
618 | 5 | =================================================================== | ||
619 | 6 | --- apache2-2.4.29.orig/include/ap_regex.h 2014-01-05 11:14:26.000000000 -0500 | ||
620 | 7 | +++ apache2-2.4.29/include/ap_regex.h 2018-04-18 09:14:53.391220215 -0400 | ||
621 | 8 | @@ -77,6 +77,8 @@ extern "C" { | ||
622 | 9 | #define AP_REG_NOMEM 0x20 /* nomem in our code */ | ||
623 | 10 | #define AP_REG_DOTALL 0x40 /* perl's /s flag */ | ||
624 | 11 | |||
625 | 12 | +#define AP_REG_DOLLAR_ENDONLY 0x200 /* '$' matches at end of subject string only */ | ||
626 | 13 | + | ||
627 | 14 | #define AP_REG_MATCH "MATCH_" /** suggested prefix for ap_regname */ | ||
628 | 15 | |||
629 | 16 | /* Error values: */ | ||
630 | 17 | @@ -103,6 +105,26 @@ typedef struct { | ||
631 | 18 | /* The functions */ | ||
632 | 19 | |||
633 | 20 | /** | ||
634 | 21 | + * Get default compile flags | ||
635 | 22 | + * @return Bitwise OR of AP_REG_* flags | ||
636 | 23 | + */ | ||
637 | 24 | +AP_DECLARE(int) ap_regcomp_get_default_cflags(void); | ||
638 | 25 | + | ||
639 | 26 | +/** | ||
640 | 27 | + * Set default compile flags | ||
641 | 28 | + * @param cflags Bitwise OR of AP_REG_* flags | ||
642 | 29 | + */ | ||
643 | 30 | +AP_DECLARE(void) ap_regcomp_set_default_cflags(int cflags); | ||
644 | 31 | + | ||
645 | 32 | +/** | ||
646 | 33 | + * Get the AP_REG_* corresponding to the string. | ||
647 | 34 | + * @param name The name (i.e. AP_REG_<name>) | ||
648 | 35 | + * @return The AP_REG_*, or zero if the string is unknown | ||
649 | 36 | + * | ||
650 | 37 | + */ | ||
651 | 38 | +AP_DECLARE(int) ap_regcomp_default_cflag_by_name(const char *name); | ||
652 | 39 | + | ||
653 | 40 | +/** | ||
654 | 41 | * Compile a regular expression. | ||
655 | 42 | * @param preg Returned compiled regex | ||
656 | 43 | * @param regex The regular expression string | ||
657 | 44 | Index: apache2-2.4.29/server/core.c | ||
658 | 45 | =================================================================== | ||
659 | 46 | --- apache2-2.4.29.orig/server/core.c 2017-09-08 09:13:11.000000000 -0400 | ||
660 | 47 | +++ apache2-2.4.29/server/core.c 2018-04-18 09:14:53.387220208 -0400 | ||
661 | 48 | @@ -48,6 +48,7 @@ | ||
662 | 49 | #include "mod_core.h" | ||
663 | 50 | #include "mod_proxy.h" | ||
664 | 51 | #include "ap_listen.h" | ||
665 | 52 | +#include "ap_regex.h" | ||
666 | 53 | |||
667 | 54 | #include "mod_so.h" /* for ap_find_loaded_module_symbol */ | ||
668 | 55 | |||
669 | 56 | @@ -2846,6 +2847,58 @@ static const char *virtualhost_section(c | ||
670 | 57 | return errmsg; | ||
671 | 58 | } | ||
672 | 59 | |||
673 | 60 | +static const char *set_regex_default_options(cmd_parms *cmd, | ||
674 | 61 | + void *dummy, | ||
675 | 62 | + const char *arg) | ||
676 | 63 | +{ | ||
677 | 64 | + const command_rec *thiscmd = cmd->cmd; | ||
678 | 65 | + int cflags, cflag; | ||
679 | 66 | + | ||
680 | 67 | + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); | ||
681 | 68 | + if (err != NULL) { | ||
682 | 69 | + return err; | ||
683 | 70 | + } | ||
684 | 71 | + | ||
685 | 72 | + cflags = ap_regcomp_get_default_cflags(); | ||
686 | 73 | + while (*arg) { | ||
687 | 74 | + const char *name = ap_getword_conf(cmd->pool, &arg); | ||
688 | 75 | + int how = 0; | ||
689 | 76 | + | ||
690 | 77 | + if (strcasecmp(name, "none") == 0) { | ||
691 | 78 | + cflags = 0; | ||
692 | 79 | + continue; | ||
693 | 80 | + } | ||
694 | 81 | + | ||
695 | 82 | + if (*name == '+') { | ||
696 | 83 | + name++; | ||
697 | 84 | + how = +1; | ||
698 | 85 | + } | ||
699 | 86 | + else if (*name == '-') { | ||
700 | 87 | + name++; | ||
701 | 88 | + how = -1; | ||
702 | 89 | + } | ||
703 | 90 | + | ||
704 | 91 | + cflag = ap_regcomp_default_cflag_by_name(name); | ||
705 | 92 | + if (!cflag) { | ||
706 | 93 | + return apr_psprintf(cmd->pool, "%s: option '%s' unknown", | ||
707 | 94 | + thiscmd->name, name); | ||
708 | 95 | + } | ||
709 | 96 | + | ||
710 | 97 | + if (how > 0) { | ||
711 | 98 | + cflags |= cflag; | ||
712 | 99 | + } | ||
713 | 100 | + else if (how < 0) { | ||
714 | 101 | + cflags &= ~cflag; | ||
715 | 102 | + } | ||
716 | 103 | + else { | ||
717 | 104 | + cflags = cflag; | ||
718 | 105 | + } | ||
719 | 106 | + } | ||
720 | 107 | + ap_regcomp_set_default_cflags(cflags); | ||
721 | 108 | + | ||
722 | 109 | + return NULL; | ||
723 | 110 | +} | ||
724 | 111 | + | ||
725 | 112 | static const char *set_server_alias(cmd_parms *cmd, void *dummy, | ||
726 | 113 | const char *arg) | ||
727 | 114 | { | ||
728 | 115 | @@ -4421,6 +4474,9 @@ AP_INIT_TAKE12("RLimitNPROC", no_set_lim | ||
729 | 116 | OR_ALL, "soft/hard limits for max number of processes per uid"), | ||
730 | 117 | #endif | ||
731 | 118 | |||
732 | 119 | +AP_INIT_RAW_ARGS("RegexDefaultOptions", set_regex_default_options, NULL, RSRC_CONF, | ||
733 | 120 | + "default options for regexes (prefixed by '+' to add, '-' to del)"), | ||
734 | 121 | + | ||
735 | 122 | /* internal recursion stopper */ | ||
736 | 123 | AP_INIT_TAKE12("LimitInternalRecursion", set_recursion_limit, NULL, RSRC_CONF, | ||
737 | 124 | "maximum recursion depth of internal redirects and subrequests"), | ||
738 | 125 | @@ -4856,6 +4912,8 @@ static int core_pre_config(apr_pool_t *p | ||
739 | 126 | apr_pool_cleanup_register(pconf, NULL, reset_config_defines, | ||
740 | 127 | apr_pool_cleanup_null); | ||
741 | 128 | |||
742 | 129 | + ap_regcomp_set_default_cflags(AP_REG_DOLLAR_ENDONLY); | ||
743 | 130 | + | ||
744 | 131 | mpm_common_pre_config(pconf); | ||
745 | 132 | |||
746 | 133 | return OK; | ||
747 | 134 | Index: apache2-2.4.29/server/util_pcre.c | ||
748 | 135 | =================================================================== | ||
749 | 136 | --- apache2-2.4.29.orig/server/util_pcre.c 2014-01-05 11:14:26.000000000 -0500 | ||
750 | 137 | +++ apache2-2.4.29/server/util_pcre.c 2018-04-18 09:14:53.391220215 -0400 | ||
751 | 138 | @@ -111,6 +111,38 @@ AP_DECLARE(void) ap_regfree(ap_regex_t * | ||
752 | 139 | * Compile a regular expression * | ||
753 | 140 | *************************************************/ | ||
754 | 141 | |||
755 | 142 | +static int default_cflags = AP_REG_DOLLAR_ENDONLY; | ||
756 | 143 | + | ||
757 | 144 | +AP_DECLARE(int) ap_regcomp_get_default_cflags(void) | ||
758 | 145 | +{ | ||
759 | 146 | + return default_cflags; | ||
760 | 147 | +} | ||
761 | 148 | + | ||
762 | 149 | +AP_DECLARE(void) ap_regcomp_set_default_cflags(int cflags) | ||
763 | 150 | +{ | ||
764 | 151 | + default_cflags = cflags; | ||
765 | 152 | +} | ||
766 | 153 | + | ||
767 | 154 | +AP_DECLARE(int) ap_regcomp_default_cflag_by_name(const char *name) | ||
768 | 155 | +{ | ||
769 | 156 | + int cflag = 0; | ||
770 | 157 | + | ||
771 | 158 | + if (ap_cstr_casecmp(name, "ICASE") == 0) { | ||
772 | 159 | + cflag = AP_REG_ICASE; | ||
773 | 160 | + } | ||
774 | 161 | + else if (ap_cstr_casecmp(name, "DOTALL") == 0) { | ||
775 | 162 | + cflag = AP_REG_DOTALL; | ||
776 | 163 | + } | ||
777 | 164 | + else if (ap_cstr_casecmp(name, "DOLLAR_ENDONLY") == 0) { | ||
778 | 165 | + cflag = AP_REG_DOLLAR_ENDONLY; | ||
779 | 166 | + } | ||
780 | 167 | + else if (ap_cstr_casecmp(name, "EXTENDED") == 0) { | ||
781 | 168 | + cflag = AP_REG_EXTENDED; | ||
782 | 169 | + } | ||
783 | 170 | + | ||
784 | 171 | + return cflag; | ||
785 | 172 | +} | ||
786 | 173 | + | ||
787 | 174 | /* | ||
788 | 175 | * Arguments: | ||
789 | 176 | * preg points to a structure for recording the compiled expression | ||
790 | 177 | @@ -127,12 +159,15 @@ AP_DECLARE(int) ap_regcomp(ap_regex_t * | ||
791 | 178 | int errcode = 0; | ||
792 | 179 | int options = PCRE_DUPNAMES; | ||
793 | 180 | |||
794 | 181 | + cflags |= default_cflags; | ||
795 | 182 | if ((cflags & AP_REG_ICASE) != 0) | ||
796 | 183 | options |= PCRE_CASELESS; | ||
797 | 184 | if ((cflags & AP_REG_NEWLINE) != 0) | ||
798 | 185 | options |= PCRE_MULTILINE; | ||
799 | 186 | if ((cflags & AP_REG_DOTALL) != 0) | ||
800 | 187 | options |= PCRE_DOTALL; | ||
801 | 188 | + if ((cflags & AP_REG_DOLLAR_ENDONLY) != 0) | ||
802 | 189 | + options |= PCRE_DOLLAR_ENDONLY; | ||
803 | 190 | |||
804 | 191 | preg->re_pcre = | ||
805 | 192 | pcre_compile2(pattern, options, &errcode, &errorptr, &erroffset, NULL); | ||
806 | diff --git a/debian/patches/CVE-2018-1283.patch b/debian/patches/CVE-2018-1283.patch | |||
807 | 0 | new file mode 100644 | 193 | new file mode 100644 |
808 | index 0000000..b596b3c | |||
809 | --- /dev/null | |||
810 | +++ b/debian/patches/CVE-2018-1283.patch | |||
811 | @@ -0,0 +1,28 @@ | |||
812 | 1 | Description: fix mod_session header manipulation | ||
813 | 2 | Origin: upstream, https://svn.apache.org/viewvc?view=revision&revision=1824477 | ||
814 | 3 | |||
815 | 4 | Index: apache2-2.4.29/modules/session/mod_session.c | ||
816 | 5 | =================================================================== | ||
817 | 6 | --- apache2-2.4.29.orig/modules/session/mod_session.c 2016-11-14 06:15:08.000000000 -0500 | ||
818 | 7 | +++ apache2-2.4.29/modules/session/mod_session.c 2018-04-18 09:15:12.551256243 -0400 | ||
819 | 8 | @@ -510,12 +510,15 @@ static int session_fixups(request_rec * | ||
820 | 9 | */ | ||
821 | 10 | ap_session_load(r, &z); | ||
822 | 11 | |||
823 | 12 | - if (z && conf->env) { | ||
824 | 13 | - session_identity_encode(r, z); | ||
825 | 14 | - if (z->encoded) { | ||
826 | 15 | - apr_table_set(r->subprocess_env, HTTP_SESSION, z->encoded); | ||
827 | 16 | - z->encoded = NULL; | ||
828 | 17 | + if (conf->env) { | ||
829 | 18 | + if (z) { | ||
830 | 19 | + session_identity_encode(r, z); | ||
831 | 20 | + if (z->encoded) { | ||
832 | 21 | + apr_table_set(r->subprocess_env, HTTP_SESSION, z->encoded); | ||
833 | 22 | + z->encoded = NULL; | ||
834 | 23 | + } | ||
835 | 24 | } | ||
836 | 25 | + apr_table_unset(r->headers_in, "Session"); | ||
837 | 26 | } | ||
838 | 27 | |||
839 | 28 | return OK; | ||
840 | diff --git a/debian/patches/CVE-2018-1301.patch b/debian/patches/CVE-2018-1301.patch | |||
841 | 0 | new file mode 100644 | 29 | new file mode 100644 |
842 | index 0000000..c4fc07a | |||
843 | --- /dev/null | |||
844 | +++ b/debian/patches/CVE-2018-1301.patch | |||
845 | @@ -0,0 +1,200 @@ | |||
846 | 1 | Description: fix DoS via specially-crafted request | ||
847 | 2 | Origin: upstream, https://svn.apache.org/viewvc?view=revision&revision=1824469 | ||
848 | 3 | |||
849 | 4 | Index: apache2-2.4.29/server/protocol.c | ||
850 | 5 | =================================================================== | ||
851 | 6 | --- apache2-2.4.29.orig/server/protocol.c 2017-10-10 13:51:13.000000000 -0400 | ||
852 | 7 | +++ apache2-2.4.29/server/protocol.c 2018-04-18 09:15:27.027283380 -0400 | ||
853 | 8 | @@ -225,6 +225,11 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
854 | 9 | int fold = flags & AP_GETLINE_FOLD; | ||
855 | 10 | int crlf = flags & AP_GETLINE_CRLF; | ||
856 | 11 | |||
857 | 12 | + if (!n) { | ||
858 | 13 | + /* Needs room for NUL byte at least */ | ||
859 | 14 | + return APR_BADARG; | ||
860 | 15 | + } | ||
861 | 16 | + | ||
862 | 17 | /* | ||
863 | 18 | * Initialize last_char as otherwise a random value will be compared | ||
864 | 19 | * against APR_ASCII_LF at the end of the loop if bb only contains | ||
865 | 20 | @@ -238,14 +243,15 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
866 | 21 | rv = ap_get_brigade(r->proto_input_filters, bb, AP_MODE_GETLINE, | ||
867 | 22 | APR_BLOCK_READ, 0); | ||
868 | 23 | if (rv != APR_SUCCESS) { | ||
869 | 24 | - return rv; | ||
870 | 25 | + goto cleanup; | ||
871 | 26 | } | ||
872 | 27 | |||
873 | 28 | /* Something horribly wrong happened. Someone didn't block! | ||
874 | 29 | * (this also happens at the end of each keepalive connection) | ||
875 | 30 | */ | ||
876 | 31 | if (APR_BRIGADE_EMPTY(bb)) { | ||
877 | 32 | - return APR_EGENERAL; | ||
878 | 33 | + rv = APR_EGENERAL; | ||
879 | 34 | + goto cleanup; | ||
880 | 35 | } | ||
881 | 36 | |||
882 | 37 | for (e = APR_BRIGADE_FIRST(bb); | ||
883 | 38 | @@ -263,7 +269,7 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
884 | 39 | |||
885 | 40 | rv = apr_bucket_read(e, &str, &len, APR_BLOCK_READ); | ||
886 | 41 | if (rv != APR_SUCCESS) { | ||
887 | 42 | - return rv; | ||
888 | 43 | + goto cleanup; | ||
889 | 44 | } | ||
890 | 45 | |||
891 | 46 | if (len == 0) { | ||
892 | 47 | @@ -276,17 +282,8 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
893 | 48 | |||
894 | 49 | /* Would this overrun our buffer? If so, we'll die. */ | ||
895 | 50 | if (n < bytes_handled + len) { | ||
896 | 51 | - *read = bytes_handled; | ||
897 | 52 | - if (*s) { | ||
898 | 53 | - /* ensure this string is NUL terminated */ | ||
899 | 54 | - if (bytes_handled > 0) { | ||
900 | 55 | - (*s)[bytes_handled-1] = '\0'; | ||
901 | 56 | - } | ||
902 | 57 | - else { | ||
903 | 58 | - (*s)[0] = '\0'; | ||
904 | 59 | - } | ||
905 | 60 | - } | ||
906 | 61 | - return APR_ENOSPC; | ||
907 | 62 | + rv = APR_ENOSPC; | ||
908 | 63 | + goto cleanup; | ||
909 | 64 | } | ||
910 | 65 | |||
911 | 66 | /* Do we have to handle the allocation ourselves? */ | ||
912 | 67 | @@ -294,7 +291,7 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
913 | 68 | /* We'll assume the common case where one bucket is enough. */ | ||
914 | 69 | if (!*s) { | ||
915 | 70 | current_alloc = len; | ||
916 | 71 | - *s = apr_palloc(r->pool, current_alloc); | ||
917 | 72 | + *s = apr_palloc(r->pool, current_alloc + 1); | ||
918 | 73 | } | ||
919 | 74 | else if (bytes_handled + len > current_alloc) { | ||
920 | 75 | /* Increase the buffer size */ | ||
921 | 76 | @@ -305,7 +302,7 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
922 | 77 | new_size = (bytes_handled + len) * 2; | ||
923 | 78 | } | ||
924 | 79 | |||
925 | 80 | - new_buffer = apr_palloc(r->pool, new_size); | ||
926 | 81 | + new_buffer = apr_palloc(r->pool, new_size + 1); | ||
927 | 82 | |||
928 | 83 | /* Copy what we already had. */ | ||
929 | 84 | memcpy(new_buffer, *s, bytes_handled); | ||
930 | 85 | @@ -329,19 +326,15 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
931 | 86 | } | ||
932 | 87 | } | ||
933 | 88 | |||
934 | 89 | - if (crlf && (last_char <= *s || last_char[-1] != APR_ASCII_CR)) { | ||
935 | 90 | - *last_char = '\0'; | ||
936 | 91 | - bytes_handled = last_char - *s; | ||
937 | 92 | - *read = bytes_handled; | ||
938 | 93 | - return APR_EINVAL; | ||
939 | 94 | - } | ||
940 | 95 | - | ||
941 | 96 | - /* Now NUL-terminate the string at the end of the line; | ||
942 | 97 | + /* Now terminate the string at the end of the line; | ||
943 | 98 | * if the last-but-one character is a CR, terminate there */ | ||
944 | 99 | if (last_char > *s && last_char[-1] == APR_ASCII_CR) { | ||
945 | 100 | last_char--; | ||
946 | 101 | } | ||
947 | 102 | - *last_char = '\0'; | ||
948 | 103 | + else if (crlf) { | ||
949 | 104 | + rv = APR_EINVAL; | ||
950 | 105 | + goto cleanup; | ||
951 | 106 | + } | ||
952 | 107 | bytes_handled = last_char - *s; | ||
953 | 108 | |||
954 | 109 | /* If we're folding, we have more work to do. | ||
955 | 110 | @@ -361,7 +354,7 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
956 | 111 | rv = ap_get_brigade(r->proto_input_filters, bb, AP_MODE_SPECULATIVE, | ||
957 | 112 | APR_BLOCK_READ, 1); | ||
958 | 113 | if (rv != APR_SUCCESS) { | ||
959 | 114 | - return rv; | ||
960 | 115 | + goto cleanup; | ||
961 | 116 | } | ||
962 | 117 | |||
963 | 118 | if (APR_BRIGADE_EMPTY(bb)) { | ||
964 | 119 | @@ -378,7 +371,7 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
965 | 120 | rv = apr_bucket_read(e, &str, &len, APR_BLOCK_READ); | ||
966 | 121 | if (rv != APR_SUCCESS) { | ||
967 | 122 | apr_brigade_cleanup(bb); | ||
968 | 123 | - return rv; | ||
969 | 124 | + goto cleanup; | ||
970 | 125 | } | ||
971 | 126 | |||
972 | 127 | /* Found one, so call ourselves again to get the next line. | ||
973 | 128 | @@ -395,10 +388,8 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
974 | 129 | if (c == APR_ASCII_BLANK || c == APR_ASCII_TAB) { | ||
975 | 130 | /* Do we have enough space? We may be full now. */ | ||
976 | 131 | if (bytes_handled >= n) { | ||
977 | 132 | - *read = n; | ||
978 | 133 | - /* ensure this string is terminated */ | ||
979 | 134 | - (*s)[n-1] = '\0'; | ||
980 | 135 | - return APR_ENOSPC; | ||
981 | 136 | + rv = APR_ENOSPC; | ||
982 | 137 | + goto cleanup; | ||
983 | 138 | } | ||
984 | 139 | else { | ||
985 | 140 | apr_size_t next_size, next_len; | ||
986 | 141 | @@ -411,7 +402,6 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
987 | 142 | tmp = NULL; | ||
988 | 143 | } | ||
989 | 144 | else { | ||
990 | 145 | - /* We're null terminated. */ | ||
991 | 146 | tmp = last_char; | ||
992 | 147 | } | ||
993 | 148 | |||
994 | 149 | @@ -420,7 +410,7 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
995 | 150 | rv = ap_rgetline_core(&tmp, next_size, | ||
996 | 151 | &next_len, r, 0, bb); | ||
997 | 152 | if (rv != APR_SUCCESS) { | ||
998 | 153 | - return rv; | ||
999 | 154 | + goto cleanup; | ||
1000 | 155 | } | ||
1001 | 156 | |||
1002 | 157 | if (do_alloc && next_len > 0) { | ||
1003 | 158 | @@ -434,7 +424,7 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
1004 | 159 | memcpy(new_buffer, *s, bytes_handled); | ||
1005 | 160 | |||
1006 | 161 | /* copy the new line, including the trailing null */ | ||
1007 | 162 | - memcpy(new_buffer + bytes_handled, tmp, next_len + 1); | ||
1008 | 163 | + memcpy(new_buffer + bytes_handled, tmp, next_len); | ||
1009 | 164 | *s = new_buffer; | ||
1010 | 165 | } | ||
1011 | 166 | |||
1012 | 167 | @@ -447,8 +437,21 @@ AP_DECLARE(apr_status_t) ap_rgetline_cor | ||
1013 | 168 | } | ||
1014 | 169 | } | ||
1015 | 170 | } | ||
1016 | 171 | + | ||
1017 | 172 | +cleanup: | ||
1018 | 173 | + if (bytes_handled >= n) { | ||
1019 | 174 | + bytes_handled = n - 1; | ||
1020 | 175 | + } | ||
1021 | 176 | + if (*s) { | ||
1022 | 177 | + /* ensure the string is NUL terminated */ | ||
1023 | 178 | + (*s)[bytes_handled] = '\0'; | ||
1024 | 179 | + } | ||
1025 | 180 | *read = bytes_handled; | ||
1026 | 181 | |||
1027 | 182 | + if (rv != APR_SUCCESS) { | ||
1028 | 183 | + return rv; | ||
1029 | 184 | + } | ||
1030 | 185 | + | ||
1031 | 186 | /* PR#43039: We shouldn't accept NULL bytes within the line */ | ||
1032 | 187 | if (strlen(*s) < bytes_handled) { | ||
1033 | 188 | return APR_EINVAL; | ||
1034 | 189 | @@ -487,6 +490,11 @@ AP_DECLARE(int) ap_getline(char *s, int | ||
1035 | 190 | apr_size_t len; | ||
1036 | 191 | apr_bucket_brigade *tmp_bb; | ||
1037 | 192 | |||
1038 | 193 | + if (n < 1) { | ||
1039 | 194 | + /* Can't work since we always NUL terminate */ | ||
1040 | 195 | + return -1; | ||
1041 | 196 | + } | ||
1042 | 197 | + | ||
1043 | 198 | tmp_bb = apr_brigade_create(r->pool, r->connection->bucket_alloc); | ||
1044 | 199 | rv = ap_rgetline(&tmp_s, n, &len, r, flags, tmp_bb); | ||
1045 | 200 | apr_brigade_destroy(tmp_bb); | ||
1046 | diff --git a/debian/patches/CVE-2018-1303.patch b/debian/patches/CVE-2018-1303.patch | |||
1047 | 0 | new file mode 100644 | 201 | new file mode 100644 |
1048 | index 0000000..42192c8 | |||
1049 | --- /dev/null | |||
1050 | +++ b/debian/patches/CVE-2018-1303.patch | |||
1051 | @@ -0,0 +1,17 @@ | |||
1052 | 1 | Description: fix mod_cache_socache DoS | ||
1053 | 2 | Origin: upstream, https://svn.apache.org/viewvc?view=revision&revision=1824475 | ||
1054 | 3 | |||
1055 | 4 | Index: apache2-2.4.29/modules/cache/mod_cache_socache.c | ||
1056 | 5 | =================================================================== | ||
1057 | 6 | --- apache2-2.4.29.orig/modules/cache/mod_cache_socache.c 2017-06-29 07:31:20.000000000 -0400 | ||
1058 | 7 | +++ apache2-2.4.29/modules/cache/mod_cache_socache.c 2018-04-18 09:15:39.675307037 -0400 | ||
1059 | 8 | @@ -213,7 +213,8 @@ static apr_status_t read_table(cache_han | ||
1060 | 9 | "Premature end of cache headers."); | ||
1061 | 10 | return APR_EGENERAL; | ||
1062 | 11 | } | ||
1063 | 12 | - while (apr_isspace(buffer[colon])) { | ||
1064 | 13 | + /* Do not go past the \r from above as apr_isspace('\r') is true */ | ||
1065 | 14 | + while (apr_isspace(buffer[colon]) && (colon < *slider)) { | ||
1066 | 15 | colon++; | ||
1067 | 16 | } | ||
1068 | 17 | apr_table_addn(table, apr_pstrndup(r->pool, (const char *) buffer | ||
1069 | diff --git a/debian/patches/CVE-2018-1312.patch b/debian/patches/CVE-2018-1312.patch | |||
1070 | 0 | new file mode 100644 | 18 | new file mode 100644 |
1071 | index 0000000..f91999a | |||
1072 | --- /dev/null | |||
1073 | +++ b/debian/patches/CVE-2018-1312.patch | |||
1074 | @@ -0,0 +1,403 @@ | |||
1075 | 1 | Description: fix insecure nonce generation | ||
1076 | 2 | Origin: upstream, https://svn.apache.org/viewvc?view=revision&revision=1824481 | ||
1077 | 3 | Bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=54637 | ||
1078 | 4 | |||
1079 | 5 | Index: apache2-2.4.29/modules/aaa/mod_auth_digest.c | ||
1080 | 6 | =================================================================== | ||
1081 | 7 | --- apache2-2.4.29.orig/modules/aaa/mod_auth_digest.c 2017-07-05 20:02:54.000000000 -0400 | ||
1082 | 8 | +++ apache2-2.4.29/modules/aaa/mod_auth_digest.c 2018-04-18 09:15:50.839327873 -0400 | ||
1083 | 9 | @@ -26,20 +26,13 @@ | ||
1084 | 10 | * reports to the Apache bug-database, or send them directly to me | ||
1085 | 11 | * at ronald@innovation.ch. | ||
1086 | 12 | * | ||
1087 | 13 | - * Requires either /dev/random (or equivalent) or the truerand library, | ||
1088 | 14 | - * available for instance from | ||
1089 | 15 | - * ftp://research.att.com/dist/mab/librand.shar | ||
1090 | 16 | - * | ||
1091 | 17 | * Open Issues: | ||
1092 | 18 | * - qop=auth-int (when streams and trailer support available) | ||
1093 | 19 | * - nonce-format configurability | ||
1094 | 20 | * - Proxy-Authorization-Info header is set by this module, but is | ||
1095 | 21 | * currently ignored by mod_proxy (needs patch to mod_proxy) | ||
1096 | 22 | - * - generating the secret takes a while (~ 8 seconds) if using the | ||
1097 | 23 | - * truerand library | ||
1098 | 24 | * - The source of the secret should be run-time directive (with server | ||
1099 | 25 | - * scope: RSRC_CONF). However, that could be tricky when trying to | ||
1100 | 26 | - * choose truerand vs. file... | ||
1101 | 27 | + * scope: RSRC_CONF) | ||
1102 | 28 | * - shared-mem not completely tested yet. Seems to work ok for me, | ||
1103 | 29 | * but... (definitely won't work on Windoze) | ||
1104 | 30 | * - Sharing a realm among multiple servers has following problems: | ||
1105 | 31 | @@ -52,6 +45,8 @@ | ||
1106 | 32 | * captures a packet sent to one server and sends it to another | ||
1107 | 33 | * one. Should we add "AuthDigestNcCheck Strict"? | ||
1108 | 34 | * - expired nonces give amaya fits. | ||
1109 | 35 | + * - MD5-sess and auth-int are not yet implemented. An incomplete | ||
1110 | 36 | + * implementation has been removed and can be retrieved from svn history. | ||
1111 | 37 | */ | ||
1112 | 38 | |||
1113 | 39 | #include "apr_sha1.h" | ||
1114 | 40 | @@ -94,7 +89,6 @@ typedef struct digest_config_struct { | ||
1115 | 41 | apr_array_header_t *qop_list; | ||
1116 | 42 | apr_sha1_ctx_t nonce_ctx; | ||
1117 | 43 | apr_time_t nonce_lifetime; | ||
1118 | 44 | - const char *nonce_format; | ||
1119 | 45 | int check_nc; | ||
1120 | 46 | const char *algorithm; | ||
1121 | 47 | char *uri_list; | ||
1122 | 48 | @@ -112,7 +106,8 @@ typedef struct digest_config_struct { | ||
1123 | 49 | #define NONCE_HASH_LEN (2*APR_SHA1_DIGESTSIZE) | ||
1124 | 50 | #define NONCE_LEN (int )(NONCE_TIME_LEN + NONCE_HASH_LEN) | ||
1125 | 51 | |||
1126 | 52 | -#define SECRET_LEN 20 | ||
1127 | 53 | +#define SECRET_LEN 20 | ||
1128 | 54 | +#define RETAINED_DATA_ID "mod_auth_digest" | ||
1129 | 55 | |||
1130 | 56 | |||
1131 | 57 | /* client list definitions */ | ||
1132 | 58 | @@ -121,7 +116,6 @@ typedef struct hash_entry { | ||
1133 | 59 | unsigned long key; /* the key for this entry */ | ||
1134 | 60 | struct hash_entry *next; /* next entry in the bucket */ | ||
1135 | 61 | unsigned long nonce_count; /* for nonce-count checking */ | ||
1136 | 62 | - char ha1[2*APR_MD5_DIGESTSIZE+1]; /* for algorithm=MD5-sess */ | ||
1137 | 63 | char last_nonce[NONCE_LEN+1]; /* for one-time nonce's */ | ||
1138 | 64 | } client_entry; | ||
1139 | 65 | |||
1140 | 66 | @@ -170,7 +164,7 @@ typedef union time_union { | ||
1141 | 67 | unsigned char arr[sizeof(apr_time_t)]; | ||
1142 | 68 | } time_rec; | ||
1143 | 69 | |||
1144 | 70 | -static unsigned char secret[SECRET_LEN]; | ||
1145 | 71 | +static unsigned char *secret; | ||
1146 | 72 | |||
1147 | 73 | /* client-list, opaque, and one-time-nonce stuff */ | ||
1148 | 74 | |||
1149 | 75 | @@ -228,35 +222,11 @@ static apr_status_t cleanup_tables(void | ||
1150 | 76 | return APR_SUCCESS; | ||
1151 | 77 | } | ||
1152 | 78 | |||
1153 | 79 | -static apr_status_t initialize_secret(server_rec *s) | ||
1154 | 80 | -{ | ||
1155 | 81 | - apr_status_t status; | ||
1156 | 82 | - | ||
1157 | 83 | - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01757) | ||
1158 | 84 | - "generating secret for digest authentication ..."); | ||
1159 | 85 | - | ||
1160 | 86 | -#if APR_HAS_RANDOM | ||
1161 | 87 | - status = apr_generate_random_bytes(secret, sizeof(secret)); | ||
1162 | 88 | -#else | ||
1163 | 89 | -#error APR random number support is missing; you probably need to install the truerand library. | ||
1164 | 90 | -#endif | ||
1165 | 91 | - | ||
1166 | 92 | - if (status != APR_SUCCESS) { | ||
1167 | 93 | - ap_log_error(APLOG_MARK, APLOG_CRIT, status, s, APLOGNO(01758) | ||
1168 | 94 | - "error generating secret"); | ||
1169 | 95 | - return status; | ||
1170 | 96 | - } | ||
1171 | 97 | - | ||
1172 | 98 | - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01759) "done"); | ||
1173 | 99 | - | ||
1174 | 100 | - return APR_SUCCESS; | ||
1175 | 101 | -} | ||
1176 | 102 | - | ||
1177 | 103 | static void log_error_and_cleanup(char *msg, apr_status_t sts, server_rec *s) | ||
1178 | 104 | { | ||
1179 | 105 | ap_log_error(APLOG_MARK, APLOG_ERR, sts, s, APLOGNO(01760) | ||
1180 | 106 | - "%s - all nonce-count checking, one-time nonces, and " | ||
1181 | 107 | - "MD5-sess algorithm disabled", msg); | ||
1182 | 108 | + "%s - all nonce-count checking and one-time nonces" | ||
1183 | 109 | + "disabled", msg); | ||
1184 | 110 | |||
1185 | 111 | cleanup_tables(NULL); | ||
1186 | 112 | } | ||
1187 | 113 | @@ -386,16 +356,32 @@ static int initialize_tables(server_rec | ||
1188 | 114 | static int pre_init(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) | ||
1189 | 115 | { | ||
1190 | 116 | apr_status_t rv; | ||
1191 | 117 | + void *retained; | ||
1192 | 118 | |||
1193 | 119 | rv = ap_mutex_register(pconf, client_mutex_type, NULL, APR_LOCK_DEFAULT, 0); | ||
1194 | 120 | - if (rv == APR_SUCCESS) { | ||
1195 | 121 | - rv = ap_mutex_register(pconf, opaque_mutex_type, NULL, APR_LOCK_DEFAULT, | ||
1196 | 122 | - 0); | ||
1197 | 123 | - } | ||
1198 | 124 | - if (rv != APR_SUCCESS) { | ||
1199 | 125 | - return rv; | ||
1200 | 126 | - } | ||
1201 | 127 | + if (rv != APR_SUCCESS) | ||
1202 | 128 | + return !OK; | ||
1203 | 129 | + rv = ap_mutex_register(pconf, opaque_mutex_type, NULL, APR_LOCK_DEFAULT, 0); | ||
1204 | 130 | + if (rv != APR_SUCCESS) | ||
1205 | 131 | + return !OK; | ||
1206 | 132 | |||
1207 | 133 | + retained = ap_retained_data_get(RETAINED_DATA_ID); | ||
1208 | 134 | + if (retained == NULL) { | ||
1209 | 135 | + retained = ap_retained_data_create(RETAINED_DATA_ID, SECRET_LEN); | ||
1210 | 136 | + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, APLOGNO(01757) | ||
1211 | 137 | + "generating secret for digest authentication"); | ||
1212 | 138 | +#if APR_HAS_RANDOM | ||
1213 | 139 | + rv = apr_generate_random_bytes(retained, SECRET_LEN); | ||
1214 | 140 | +#else | ||
1215 | 141 | +#error APR random number support is missing | ||
1216 | 142 | +#endif | ||
1217 | 143 | + if (rv != APR_SUCCESS) { | ||
1218 | 144 | + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, APLOGNO(01758) | ||
1219 | 145 | + "error generating secret"); | ||
1220 | 146 | + return !OK; | ||
1221 | 147 | + } | ||
1222 | 148 | + } | ||
1223 | 149 | + secret = retained; | ||
1224 | 150 | return OK; | ||
1225 | 151 | } | ||
1226 | 152 | |||
1227 | 153 | @@ -408,10 +394,6 @@ static int initialize_module(apr_pool_t | ||
1228 | 154 | if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG) | ||
1229 | 155 | return OK; | ||
1230 | 156 | |||
1231 | 157 | - if (initialize_secret(s) != APR_SUCCESS) { | ||
1232 | 158 | - return !OK; | ||
1233 | 159 | - } | ||
1234 | 160 | - | ||
1235 | 161 | #if APR_HAS_SHARED_MEMORY | ||
1236 | 162 | /* Note: this stuff is currently fixed for the lifetime of the server, | ||
1237 | 163 | * i.e. even across restarts. This means that A) any shmem-size | ||
1238 | 164 | @@ -492,6 +474,16 @@ static void *create_digest_dir_config(ap | ||
1239 | 165 | static const char *set_realm(cmd_parms *cmd, void *config, const char *realm) | ||
1240 | 166 | { | ||
1241 | 167 | digest_config_rec *conf = (digest_config_rec *) config; | ||
1242 | 168 | +#ifdef AP_DEBUG | ||
1243 | 169 | + int i; | ||
1244 | 170 | + | ||
1245 | 171 | + /* check that we got random numbers */ | ||
1246 | 172 | + for (i = 0; i < SECRET_LEN; i++) { | ||
1247 | 173 | + if (secret[i] != 0) | ||
1248 | 174 | + break; | ||
1249 | 175 | + } | ||
1250 | 176 | + ap_assert(i < SECRET_LEN); | ||
1251 | 177 | +#endif | ||
1252 | 178 | |||
1253 | 179 | /* The core already handles the realm, but it's just too convenient to | ||
1254 | 180 | * grab it ourselves too and cache some setups. However, we need to | ||
1255 | 181 | @@ -505,7 +497,7 @@ static const char *set_realm(cmd_parms * | ||
1256 | 182 | * and directives outside a virtual host section) | ||
1257 | 183 | */ | ||
1258 | 184 | apr_sha1_init(&conf->nonce_ctx); | ||
1259 | 185 | - apr_sha1_update_binary(&conf->nonce_ctx, secret, sizeof(secret)); | ||
1260 | 186 | + apr_sha1_update_binary(&conf->nonce_ctx, secret, SECRET_LEN); | ||
1261 | 187 | apr_sha1_update_binary(&conf->nonce_ctx, (const unsigned char *) realm, | ||
1262 | 188 | strlen(realm)); | ||
1263 | 189 | |||
1264 | 190 | @@ -599,8 +591,7 @@ static const char *set_nonce_lifetime(cm | ||
1265 | 191 | static const char *set_nonce_format(cmd_parms *cmd, void *config, | ||
1266 | 192 | const char *fmt) | ||
1267 | 193 | { | ||
1268 | 194 | - ((digest_config_rec *) config)->nonce_format = fmt; | ||
1269 | 195 | - return "AuthDigestNonceFormat is not implemented (yet)"; | ||
1270 | 196 | + return "AuthDigestNonceFormat is not implemented"; | ||
1271 | 197 | } | ||
1272 | 198 | |||
1273 | 199 | static const char *set_nc_check(cmd_parms *cmd, void *config, int flag) | ||
1274 | 200 | @@ -621,7 +612,7 @@ static const char *set_algorithm(cmd_par | ||
1275 | 201 | { | ||
1276 | 202 | if (!strcasecmp(alg, "MD5-sess")) { | ||
1277 | 203 | return "AuthDigestAlgorithm: ERROR: algorithm `MD5-sess' " | ||
1278 | 204 | - "is not fully implemented"; | ||
1279 | 205 | + "is not implemented"; | ||
1280 | 206 | } | ||
1281 | 207 | else if (strcasecmp(alg, "MD5")) { | ||
1282 | 208 | return apr_pstrcat(cmd->pool, "Invalid algorithm in AuthDigestAlgorithm: ", alg, NULL); | ||
1283 | 209 | @@ -1147,7 +1138,7 @@ static const char *gen_nonce(apr_pool_t | ||
1284 | 210 | static client_entry *gen_client(const request_rec *r) | ||
1285 | 211 | { | ||
1286 | 212 | unsigned long op; | ||
1287 | 213 | - client_entry new_entry = { 0, NULL, 0, "", "" }, *entry; | ||
1288 | 214 | + client_entry new_entry = { 0, NULL, 0, "" }, *entry; | ||
1289 | 215 | |||
1290 | 216 | if (!opaque_cntr) { | ||
1291 | 217 | return NULL; | ||
1292 | 218 | @@ -1168,92 +1159,6 @@ static client_entry *gen_client(const re | ||
1293 | 219 | |||
1294 | 220 | |||
1295 | 221 | /* | ||
1296 | 222 | - * MD5-sess code. | ||
1297 | 223 | - * | ||
1298 | 224 | - * If you want to use algorithm=MD5-sess you must write get_userpw_hash() | ||
1299 | 225 | - * yourself (see below). The dummy provided here just uses the hash from | ||
1300 | 226 | - * the auth-file, i.e. it is only useful for testing client implementations | ||
1301 | 227 | - * of MD5-sess . | ||
1302 | 228 | - */ | ||
1303 | 229 | - | ||
1304 | 230 | -/* | ||
1305 | 231 | - * get_userpw_hash() will be called each time a new session needs to be | ||
1306 | 232 | - * generated and is expected to return the equivalent of | ||
1307 | 233 | - * | ||
1308 | 234 | - * h_urp = ap_md5(r->pool, | ||
1309 | 235 | - * apr_pstrcat(r->pool, username, ":", ap_auth_name(r), ":", passwd)) | ||
1310 | 236 | - * ap_md5(r->pool, | ||
1311 | 237 | - * (unsigned char *) apr_pstrcat(r->pool, h_urp, ":", resp->nonce, ":", | ||
1312 | 238 | - * resp->cnonce, NULL)); | ||
1313 | 239 | - * | ||
1314 | 240 | - * or put differently, it must return | ||
1315 | 241 | - * | ||
1316 | 242 | - * MD5(MD5(username ":" realm ":" password) ":" nonce ":" cnonce) | ||
1317 | 243 | - * | ||
1318 | 244 | - * If something goes wrong, the failure must be logged and NULL returned. | ||
1319 | 245 | - * | ||
1320 | 246 | - * You must implement this yourself, which will probably consist of code | ||
1321 | 247 | - * contacting the password server with the necessary information (typically | ||
1322 | 248 | - * the username, realm, nonce, and cnonce) and receiving the hash from it. | ||
1323 | 249 | - * | ||
1324 | 250 | - * TBD: This function should probably be in a separate source file so that | ||
1325 | 251 | - * people need not modify mod_auth_digest.c each time they install a new | ||
1326 | 252 | - * version of apache. | ||
1327 | 253 | - */ | ||
1328 | 254 | -static const char *get_userpw_hash(const request_rec *r, | ||
1329 | 255 | - const digest_header_rec *resp, | ||
1330 | 256 | - const digest_config_rec *conf) | ||
1331 | 257 | -{ | ||
1332 | 258 | - return ap_md5(r->pool, | ||
1333 | 259 | - (unsigned char *) apr_pstrcat(r->pool, conf->ha1, ":", resp->nonce, | ||
1334 | 260 | - ":", resp->cnonce, NULL)); | ||
1335 | 261 | -} | ||
1336 | 262 | - | ||
1337 | 263 | - | ||
1338 | 264 | -/* Retrieve current session H(A1). If there is none and "generate" is | ||
1339 | 265 | - * true then a new session for MD5-sess is generated and stored in the | ||
1340 | 266 | - * client struct; if generate is false, or a new session could not be | ||
1341 | 267 | - * generated then NULL is returned (in case of failure to generate the | ||
1342 | 268 | - * failure reason will have been logged already). | ||
1343 | 269 | - */ | ||
1344 | 270 | -static const char *get_session_HA1(const request_rec *r, | ||
1345 | 271 | - digest_header_rec *resp, | ||
1346 | 272 | - const digest_config_rec *conf, | ||
1347 | 273 | - int generate) | ||
1348 | 274 | -{ | ||
1349 | 275 | - const char *ha1 = NULL; | ||
1350 | 276 | - | ||
1351 | 277 | - /* return the current sessions if there is one */ | ||
1352 | 278 | - if (resp->opaque && resp->client && resp->client->ha1[0]) { | ||
1353 | 279 | - return resp->client->ha1; | ||
1354 | 280 | - } | ||
1355 | 281 | - else if (!generate) { | ||
1356 | 282 | - return NULL; | ||
1357 | 283 | - } | ||
1358 | 284 | - | ||
1359 | 285 | - /* generate a new session */ | ||
1360 | 286 | - if (!resp->client) { | ||
1361 | 287 | - resp->client = gen_client(r); | ||
1362 | 288 | - } | ||
1363 | 289 | - if (resp->client) { | ||
1364 | 290 | - ha1 = get_userpw_hash(r, resp, conf); | ||
1365 | 291 | - if (ha1) { | ||
1366 | 292 | - memcpy(resp->client->ha1, ha1, sizeof(resp->client->ha1)); | ||
1367 | 293 | - } | ||
1368 | 294 | - } | ||
1369 | 295 | - | ||
1370 | 296 | - return ha1; | ||
1371 | 297 | -} | ||
1372 | 298 | - | ||
1373 | 299 | - | ||
1374 | 300 | -static void clear_session(const digest_header_rec *resp) | ||
1375 | 301 | -{ | ||
1376 | 302 | - if (resp->client) { | ||
1377 | 303 | - resp->client->ha1[0] = '\0'; | ||
1378 | 304 | - } | ||
1379 | 305 | -} | ||
1380 | 306 | - | ||
1381 | 307 | -/* | ||
1382 | 308 | * Authorization challenge generation code (for WWW-Authenticate) | ||
1383 | 309 | */ | ||
1384 | 310 | |||
1385 | 311 | @@ -1291,8 +1196,7 @@ static void note_digest_auth_failure(req | ||
1386 | 312 | |||
1387 | 313 | if (resp->opaque == NULL) { | ||
1388 | 314 | /* new client */ | ||
1389 | 315 | - if ((conf->check_nc || conf->nonce_lifetime == 0 | ||
1390 | 316 | - || !strcasecmp(conf->algorithm, "MD5-sess")) | ||
1391 | 317 | + if ((conf->check_nc || conf->nonce_lifetime == 0) | ||
1392 | 318 | && (resp->client = gen_client(r)) != NULL) { | ||
1393 | 319 | opaque = ltox(r->pool, resp->client->key); | ||
1394 | 320 | } | ||
1395 | 321 | @@ -1332,15 +1236,6 @@ static void note_digest_auth_failure(req | ||
1396 | 322 | memcpy(resp->client->last_nonce, nonce, NONCE_LEN+1); | ||
1397 | 323 | } | ||
1398 | 324 | |||
1399 | 325 | - /* Setup MD5-sess stuff. Note that we just clear out the session | ||
1400 | 326 | - * info here, since we can't generate a new session until the request | ||
1401 | 327 | - * from the client comes in with the cnonce. | ||
1402 | 328 | - */ | ||
1403 | 329 | - | ||
1404 | 330 | - if (!strcasecmp(conf->algorithm, "MD5-sess")) { | ||
1405 | 331 | - clear_session(resp); | ||
1406 | 332 | - } | ||
1407 | 333 | - | ||
1408 | 334 | /* setup domain attribute. We want to send this attribute wherever | ||
1409 | 335 | * possible so that the client won't send the Authorization header | ||
1410 | 336 | * unnecessarily (it's usually > 200 bytes!). | ||
1411 | 337 | @@ -1606,24 +1501,9 @@ static const char *new_digest(const requ | ||
1412 | 338 | { | ||
1413 | 339 | const char *ha1, *ha2, *a2; | ||
1414 | 340 | |||
1415 | 341 | - if (resp->algorithm && !strcasecmp(resp->algorithm, "MD5-sess")) { | ||
1416 | 342 | - ha1 = get_session_HA1(r, resp, conf, 1); | ||
1417 | 343 | - if (!ha1) { | ||
1418 | 344 | - return NULL; | ||
1419 | 345 | - } | ||
1420 | 346 | - } | ||
1421 | 347 | - else { | ||
1422 | 348 | - ha1 = conf->ha1; | ||
1423 | 349 | - } | ||
1424 | 350 | + ha1 = conf->ha1; | ||
1425 | 351 | |||
1426 | 352 | - if (resp->message_qop && !strcasecmp(resp->message_qop, "auth-int")) { | ||
1427 | 353 | - a2 = apr_pstrcat(r->pool, resp->method, ":", resp->uri, ":", | ||
1428 | 354 | - ap_md5(r->pool, (const unsigned char*) ""), NULL); | ||
1429 | 355 | - /* TBD */ | ||
1430 | 356 | - } | ||
1431 | 357 | - else { | ||
1432 | 358 | - a2 = apr_pstrcat(r->pool, resp->method, ":", resp->uri, NULL); | ||
1433 | 359 | - } | ||
1434 | 360 | + a2 = apr_pstrcat(r->pool, resp->method, ":", resp->uri, NULL); | ||
1435 | 361 | ha2 = ap_md5(r->pool, (const unsigned char *)a2); | ||
1436 | 362 | |||
1437 | 363 | return ap_md5(r->pool, | ||
1438 | 364 | @@ -1871,8 +1751,7 @@ static int authenticate_digest_user(requ | ||
1439 | 365 | } | ||
1440 | 366 | |||
1441 | 367 | if (resp->algorithm != NULL | ||
1442 | 368 | - && strcasecmp(resp->algorithm, "MD5") | ||
1443 | 369 | - && strcasecmp(resp->algorithm, "MD5-sess")) { | ||
1444 | 370 | + && strcasecmp(resp->algorithm, "MD5")) { | ||
1445 | 371 | ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01789) | ||
1446 | 372 | "unknown algorithm `%s' received: %s", | ||
1447 | 373 | resp->algorithm, r->uri); | ||
1448 | 374 | @@ -2024,27 +1903,9 @@ static int add_auth_info(request_rec *r) | ||
1449 | 375 | |||
1450 | 376 | /* calculate rspauth attribute | ||
1451 | 377 | */ | ||
1452 | 378 | - if (resp->algorithm && !strcasecmp(resp->algorithm, "MD5-sess")) { | ||
1453 | 379 | - ha1 = get_session_HA1(r, resp, conf, 0); | ||
1454 | 380 | - if (!ha1) { | ||
1455 | 381 | - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01795) | ||
1456 | 382 | - "internal error: couldn't find session " | ||
1457 | 383 | - "info for user %s", resp->username); | ||
1458 | 384 | - return !OK; | ||
1459 | 385 | - } | ||
1460 | 386 | - } | ||
1461 | 387 | - else { | ||
1462 | 388 | - ha1 = conf->ha1; | ||
1463 | 389 | - } | ||
1464 | 390 | + ha1 = conf->ha1; | ||
1465 | 391 | |||
1466 | 392 | - if (resp->message_qop && !strcasecmp(resp->message_qop, "auth-int")) { | ||
1467 | 393 | - a2 = apr_pstrcat(r->pool, ":", resp->uri, ":", | ||
1468 | 394 | - ap_md5(r->pool,(const unsigned char *) ""), NULL); | ||
1469 | 395 | - /* TBD */ | ||
1470 | 396 | - } | ||
1471 | 397 | - else { | ||
1472 | 398 | - a2 = apr_pstrcat(r->pool, ":", resp->uri, NULL); | ||
1473 | 399 | - } | ||
1474 | 400 | + a2 = apr_pstrcat(r->pool, ":", resp->uri, NULL); | ||
1475 | 401 | ha2 = ap_md5(r->pool, (const unsigned char *)a2); | ||
1476 | 402 | |||
1477 | 403 | resp_dig = ap_md5(r->pool, | ||
1478 | diff --git a/debian/patches/CVE-2018-17199.patch b/debian/patches/CVE-2018-17199.patch | |||
1479 | 0 | new file mode 100644 | 404 | new file mode 100644 |
1480 | index 0000000..e42f56b | |||
1481 | --- /dev/null | |||
1482 | +++ b/debian/patches/CVE-2018-17199.patch | |||
1483 | @@ -0,0 +1,85 @@ | |||
1484 | 1 | From 34f58ae20d9a85f2a1508a9a732874239491d456 Mon Sep 17 00:00:00 2001 | ||
1485 | 2 | From: Hank Ibell <hwibell@apache.org> | ||
1486 | 3 | Date: Tue, 15 Jan 2019 19:54:41 +0000 | ||
1487 | 4 | Subject: [PATCH] mod_session: Always decode session attributes early. | ||
1488 | 5 | |||
1489 | 6 | Backport r1850947 from trunk | ||
1490 | 7 | Submitted by: hwibell | ||
1491 | 8 | Reviewed by: hwibell, covener, wrowe | ||
1492 | 9 | |||
1493 | 10 | |||
1494 | 11 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1851409 13f79535-47bb-0310-9956-ffa450edef68 | ||
1495 | 12 | --- | ||
1496 | 13 | CHANGES | 2 ++ | ||
1497 | 14 | STATUS | 5 ----- | ||
1498 | 15 | modules/session/mod_session.c | 25 ++++++++++++++----------- | ||
1499 | 16 | 3 files changed, 16 insertions(+), 16 deletions(-) | ||
1500 | 17 | |||
1501 | 18 | #diff --git a/CHANGES b/CHANGES | ||
1502 | 19 | #index c4d9f6c2ea8..4b0a07fdcf5 100644 | ||
1503 | 20 | #--- a/CHANGES | ||
1504 | 21 | #+++ b/CHANGES | ||
1505 | 22 | #@@ -9,6 +9,8 @@ Changes with Apache 2.4.38 | ||
1506 | 23 | # and we should just set the value for the environment variable | ||
1507 | 24 | # like in the pattern case. [Ruediger Pluem] | ||
1508 | 25 | # | ||
1509 | 26 | #+ *) mod_session: Always decode session attributes early. [Hank Ibell] | ||
1510 | 27 | #+ | ||
1511 | 28 | # *) core: Incorrect values for environment variables are substituted when | ||
1512 | 29 | # multiple environment variables are specified in a directive. [Hank Ibell] | ||
1513 | 30 | # | ||
1514 | 31 | #diff --git a/STATUS b/STATUS | ||
1515 | 32 | #index 00070f9f247..45a92ba4d81 100644 | ||
1516 | 33 | #--- a/STATUS | ||
1517 | 34 | #+++ b/STATUS | ||
1518 | 35 | #@@ -125,11 +125,6 @@ RELEASE SHOWSTOPPERS: | ||
1519 | 36 | # PATCHES ACCEPTED TO BACKPORT FROM TRUNK: | ||
1520 | 37 | # [ start all new proposals below, under PATCHES PROPOSED. ] | ||
1521 | 38 | # | ||
1522 | 39 | #- *) mod_session: Always decode session attributes early. | ||
1523 | 40 | #- trunk patch: http://svn.apache.org/r1850947 | ||
1524 | 41 | #- 2.4.x patch: svn merge -c 1850947 ^/httpd/httpd/trunk . | ||
1525 | 42 | #- +1: hwibell, covener, wrowe | ||
1526 | 43 | #- | ||
1527 | 44 | # *) mod_ssl (ssl_engine_io.c: bio_filter_out_write, bio_filter_in_read) | ||
1528 | 45 | # Clear retry flags before aborting on client-initiated reneg. [Joe Orton] | ||
1529 | 46 | # PR: 63052 | ||
1530 | 47 | diff --git a/modules/session/mod_session.c b/modules/session/mod_session.c | ||
1531 | 48 | index d517020d995..64e6e4a8132 100644 | ||
1532 | 49 | --- a/modules/session/mod_session.c | ||
1533 | 50 | +++ b/modules/session/mod_session.c | ||
1534 | 51 | @@ -126,20 +126,23 @@ static apr_status_t ap_session_load(request_rec * r, session_rec ** z) | ||
1535 | 52 | |||
1536 | 53 | /* found a session that hasn't expired? */ | ||
1537 | 54 | now = apr_time_now(); | ||
1538 | 55 | + | ||
1539 | 56 | if (zz) { | ||
1540 | 57 | - if (zz->expiry && zz->expiry < now) { | ||
1541 | 58 | + /* load the session attibutes */ | ||
1542 | 59 | + rv = ap_run_session_decode(r, zz); | ||
1543 | 60 | + | ||
1544 | 61 | + /* having a session we cannot decode is just as good as having | ||
1545 | 62 | + none at all */ | ||
1546 | 63 | + if (OK != rv) { | ||
1547 | 64 | + ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01817) | ||
1548 | 65 | + "error while decoding the session, " | ||
1549 | 66 | + "session not loaded: %s", r->uri); | ||
1550 | 67 | zz = NULL; | ||
1551 | 68 | } | ||
1552 | 69 | - else { | ||
1553 | 70 | - /* having a session we cannot decode is just as good as having | ||
1554 | 71 | - none at all */ | ||
1555 | 72 | - rv = ap_run_session_decode(r, zz); | ||
1556 | 73 | - if (OK != rv) { | ||
1557 | 74 | - ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01817) | ||
1558 | 75 | - "error while decoding the session, " | ||
1559 | 76 | - "session not loaded: %s", r->uri); | ||
1560 | 77 | - zz = NULL; | ||
1561 | 78 | - } | ||
1562 | 79 | + | ||
1563 | 80 | + /* invalidate session if session is expired */ | ||
1564 | 81 | + if (zz && zz->expiry && zz->expiry < now) { | ||
1565 | 82 | + zz = NULL; | ||
1566 | 83 | } | ||
1567 | 84 | } | ||
1568 | 85 | |||
1569 | diff --git a/debian/patches/CVE-2019-0211.patch b/debian/patches/CVE-2019-0211.patch | |||
1570 | 0 | new file mode 100644 | 86 | new file mode 100644 |
1571 | index 0000000..be70aac | |||
1572 | --- /dev/null | |||
1573 | +++ b/debian/patches/CVE-2019-0211.patch | |||
1574 | @@ -0,0 +1,249 @@ | |||
1575 | 1 | From df7edb5ddae609ea1fd4285f7439f0d590d97b37 Mon Sep 17 00:00:00 2001 | ||
1576 | 2 | From: Yann Ylavic <ylavic@apache.org> | ||
1577 | 3 | Date: Wed, 13 Mar 2019 08:59:54 +0000 | ||
1578 | 4 | Subject: [PATCH] Merge r1855306 from trunk: | ||
1579 | 5 | |||
1580 | 6 | MPMs unix: bind the bucket number of each child to its slot number | ||
1581 | 7 | |||
1582 | 8 | We need not remember each child's bucket number in SHM for restarts, for the | ||
1583 | 9 | lifetime of the httpd main process the bucket number can be bound to the slot | ||
1584 | 10 | number such that: bucket = slot % num_buckets. | ||
1585 | 11 | |||
1586 | 12 | This both simplifies the logic and helps children maintenance per bucket in | ||
1587 | 13 | threaded MPMs, where previously perform_idle_server_maintenance() could create | ||
1588 | 14 | or kill children processes for the buckets it was not in charge of. | ||
1589 | 15 | |||
1590 | 16 | Submitted by: ylavic | ||
1591 | 17 | Reviewed by: ylavic, rpluem, jorton | ||
1592 | 18 | |||
1593 | 19 | |||
1594 | 20 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855378 13f79535-47bb-0310-9956-ffa450edef68 | ||
1595 | 21 | --- | ||
1596 | 22 | CHANGES | 3 +++ | ||
1597 | 23 | include/scoreboard.h | 4 +++- | ||
1598 | 24 | server/mpm/event/event.c | 13 ++++++++----- | ||
1599 | 25 | server/mpm/prefork/prefork.c | 19 +++++++------------ | ||
1600 | 26 | server/mpm/worker/worker.c | 10 ++++++---- | ||
1601 | 27 | 5 files changed, 27 insertions(+), 22 deletions(-) | ||
1602 | 28 | |||
1603 | 29 | #diff --git a/CHANGES b/CHANGES | ||
1604 | 30 | #index e79251389d5..6b560802119 100644 | ||
1605 | 31 | #--- a/CHANGES | ||
1606 | 32 | #+++ b/CHANGES | ||
1607 | 33 | #@@ -1,6 +1,9 @@ | ||
1608 | 34 | # -*- coding: utf-8 -*- | ||
1609 | 35 | # Changes with Apache 2.4.39 | ||
1610 | 36 | # | ||
1611 | 37 | #+ *) MPMs unix: bind the bucket number of each child to its slot number, for a | ||
1612 | 38 | #+ more efficient per bucket maintenance. [Yann Ylavic] | ||
1613 | 39 | #+ | ||
1614 | 40 | # *) mod_auth_digest: Fix a race condition. Authentication with valid | ||
1615 | 41 | # credentials could be refused in case of concurrent accesses from | ||
1616 | 42 | # different users. PR 63124. [Simon Kappel <simon.kappel axis.com>] | ||
1617 | 43 | Index: apache2-2.4.29/include/scoreboard.h | ||
1618 | 44 | =================================================================== | ||
1619 | 45 | --- apache2-2.4.29.orig/include/scoreboard.h 2019-04-03 09:22:04.140590533 -0400 | ||
1620 | 46 | +++ apache2-2.4.29/include/scoreboard.h 2019-04-03 09:22:04.140590533 -0400 | ||
1621 | 47 | @@ -143,7 +143,9 @@ struct process_score { | ||
1622 | 48 | apr_uint32_t lingering_close; /* async connections in lingering close */ | ||
1623 | 49 | apr_uint32_t keep_alive; /* async connections in keep alive */ | ||
1624 | 50 | apr_uint32_t suspended; /* connections suspended by some module */ | ||
1625 | 51 | - int bucket; /* Listener bucket used by this child */ | ||
1626 | 52 | + int bucket; /* Listener bucket used by this child; this field is DEPRECATED | ||
1627 | 53 | + * and no longer updated by the MPMs (i.e. always zero). | ||
1628 | 54 | + */ | ||
1629 | 55 | }; | ||
1630 | 56 | |||
1631 | 57 | /* Scoreboard is now in 'local' memory, since it isn't updated once created, | ||
1632 | 58 | Index: apache2-2.4.29/server/mpm/event/event.c | ||
1633 | 59 | =================================================================== | ||
1634 | 60 | --- apache2-2.4.29.orig/server/mpm/event/event.c 2019-04-03 09:22:04.140590533 -0400 | ||
1635 | 61 | +++ apache2-2.4.29/server/mpm/event/event.c 2019-04-03 09:22:04.140590533 -0400 | ||
1636 | 62 | @@ -2553,7 +2553,6 @@ static int make_child(server_rec * s, in | ||
1637 | 63 | |||
1638 | 64 | ap_scoreboard_image->parent[slot].quiescing = 0; | ||
1639 | 65 | ap_scoreboard_image->parent[slot].not_accepting = 0; | ||
1640 | 66 | - ap_scoreboard_image->parent[slot].bucket = bucket; | ||
1641 | 67 | event_note_child_started(slot, pid); | ||
1642 | 68 | active_daemons++; | ||
1643 | 69 | retained->total_daemons++; | ||
1644 | 70 | @@ -2592,6 +2591,7 @@ static void perform_idle_server_maintena | ||
1645 | 71 | * that threads_per_child is always > 0 */ | ||
1646 | 72 | int status = SERVER_DEAD; | ||
1647 | 73 | int child_threads_active = 0; | ||
1648 | 74 | + int bucket = i % num_buckets; | ||
1649 | 75 | |||
1650 | 76 | if (i >= retained->max_daemons_limit && | ||
1651 | 77 | free_length == retained->idle_spawn_rate[child_bucket]) { | ||
1652 | 78 | @@ -2615,7 +2615,7 @@ static void perform_idle_server_maintena | ||
1653 | 79 | */ | ||
1654 | 80 | if (status <= SERVER_READY && !ps->quiescing && !ps->not_accepting | ||
1655 | 81 | && ps->generation == retained->mpm->my_generation | ||
1656 | 82 | - && ps->bucket == child_bucket) | ||
1657 | 83 | + && bucket == child_bucket) | ||
1658 | 84 | { | ||
1659 | 85 | ++idle_thread_count; | ||
1660 | 86 | } | ||
1661 | 87 | @@ -2626,7 +2626,9 @@ static void perform_idle_server_maintena | ||
1662 | 88 | last_non_dead = i; | ||
1663 | 89 | } | ||
1664 | 90 | active_thread_count += child_threads_active; | ||
1665 | 91 | - if (!ps->pid && free_length < retained->idle_spawn_rate[child_bucket]) | ||
1666 | 92 | + if (!ps->pid | ||
1667 | 93 | + && bucket == child_bucket | ||
1668 | 94 | + && free_length < retained->idle_spawn_rate[child_bucket]) | ||
1669 | 95 | free_slots[free_length++] = i; | ||
1670 | 96 | else if (child_threads_active == threads_per_child) | ||
1671 | 97 | had_healthy_child = 1; | ||
1672 | 98 | @@ -2809,13 +2811,14 @@ static void server_main_loop(int remaini | ||
1673 | 99 | retained->total_daemons--; | ||
1674 | 100 | if (processed_status == APEXIT_CHILDSICK) { | ||
1675 | 101 | /* resource shortage, minimize the fork rate */ | ||
1676 | 102 | - retained->idle_spawn_rate[ps->bucket] = 1; | ||
1677 | 103 | + retained->idle_spawn_rate[child_slot % num_buckets] = 1; | ||
1678 | 104 | } | ||
1679 | 105 | else if (remaining_children_to_start) { | ||
1680 | 106 | /* we're still doing a 1-for-1 replacement of dead | ||
1681 | 107 | * children with new children | ||
1682 | 108 | */ | ||
1683 | 109 | - make_child(ap_server_conf, child_slot, ps->bucket); | ||
1684 | 110 | + make_child(ap_server_conf, child_slot, | ||
1685 | 111 | + child_slot % num_buckets); | ||
1686 | 112 | --remaining_children_to_start; | ||
1687 | 113 | } | ||
1688 | 114 | } | ||
1689 | 115 | Index: apache2-2.4.29/server/mpm/prefork/prefork.c | ||
1690 | 116 | =================================================================== | ||
1691 | 117 | --- apache2-2.4.29.orig/server/mpm/prefork/prefork.c 2019-04-03 09:22:04.140590533 -0400 | ||
1692 | 118 | +++ apache2-2.4.29/server/mpm/prefork/prefork.c 2019-04-03 09:22:04.140590533 -0400 | ||
1693 | 119 | @@ -637,8 +637,9 @@ static void child_main(int child_num_arg | ||
1694 | 120 | } | ||
1695 | 121 | |||
1696 | 122 | |||
1697 | 123 | -static int make_child(server_rec *s, int slot, int bucket) | ||
1698 | 124 | +static int make_child(server_rec *s, int slot) | ||
1699 | 125 | { | ||
1700 | 126 | + int bucket = slot % retained->mpm->num_buckets; | ||
1701 | 127 | int pid; | ||
1702 | 128 | |||
1703 | 129 | if (slot + 1 > retained->max_daemons_limit) { | ||
1704 | 130 | @@ -716,7 +717,6 @@ static int make_child(server_rec *s, int | ||
1705 | 131 | child_main(slot, bucket); | ||
1706 | 132 | } | ||
1707 | 133 | |||
1708 | 134 | - ap_scoreboard_image->parent[slot].bucket = bucket; | ||
1709 | 135 | prefork_note_child_started(slot, pid); | ||
1710 | 136 | |||
1711 | 137 | return 0; | ||
1712 | 138 | @@ -732,7 +732,7 @@ static void startup_children(int number_ | ||
1713 | 139 | if (ap_scoreboard_image->servers[i][0].status != SERVER_DEAD) { | ||
1714 | 140 | continue; | ||
1715 | 141 | } | ||
1716 | 142 | - if (make_child(ap_server_conf, i, i % retained->mpm->num_buckets) < 0) { | ||
1717 | 143 | + if (make_child(ap_server_conf, i) < 0) { | ||
1718 | 144 | break; | ||
1719 | 145 | } | ||
1720 | 146 | --number_to_start; | ||
1721 | 147 | @@ -741,8 +741,6 @@ static void startup_children(int number_ | ||
1722 | 148 | |||
1723 | 149 | static void perform_idle_server_maintenance(apr_pool_t *p) | ||
1724 | 150 | { | ||
1725 | 151 | - static int bucket_make_child_record = -1; | ||
1726 | 152 | - static int bucket_kill_child_record = -1; | ||
1727 | 153 | int i; | ||
1728 | 154 | int idle_count; | ||
1729 | 155 | worker_score *ws; | ||
1730 | 156 | @@ -789,6 +787,7 @@ static void perform_idle_server_maintena | ||
1731 | 157 | } | ||
1732 | 158 | retained->max_daemons_limit = last_non_dead + 1; | ||
1733 | 159 | if (idle_count > ap_daemons_max_free) { | ||
1734 | 160 | + static int bucket_kill_child_record = -1; | ||
1735 | 161 | /* kill off one child... we use the pod because that'll cause it to | ||
1736 | 162 | * shut down gracefully, in case it happened to pick up a request | ||
1737 | 163 | * while we were counting | ||
1738 | 164 | @@ -819,10 +818,7 @@ static void perform_idle_server_maintena | ||
1739 | 165 | idle_count, total_non_dead); | ||
1740 | 166 | } | ||
1741 | 167 | for (i = 0; i < free_length; ++i) { | ||
1742 | 168 | - bucket_make_child_record++; | ||
1743 | 169 | - bucket_make_child_record %= retained->mpm->num_buckets; | ||
1744 | 170 | - make_child(ap_server_conf, free_slots[i], | ||
1745 | 171 | - bucket_make_child_record); | ||
1746 | 172 | + make_child(ap_server_conf, free_slots[i]); | ||
1747 | 173 | } | ||
1748 | 174 | /* the next time around we want to spawn twice as many if this | ||
1749 | 175 | * wasn't good enough, but not if we've just done a graceful | ||
1750 | 176 | @@ -867,7 +863,7 @@ static int prefork_run(apr_pool_t *_pcon | ||
1751 | 177 | |||
1752 | 178 | if (one_process) { | ||
1753 | 179 | AP_MONCONTROL(1); | ||
1754 | 180 | - make_child(ap_server_conf, 0, 0); | ||
1755 | 181 | + make_child(ap_server_conf, 0); | ||
1756 | 182 | /* NOTREACHED */ | ||
1757 | 183 | ap_assert(0); | ||
1758 | 184 | return !OK; | ||
1759 | 185 | @@ -976,8 +972,7 @@ static int prefork_run(apr_pool_t *_pcon | ||
1760 | 186 | /* we're still doing a 1-for-1 replacement of dead | ||
1761 | 187 | * children with new children | ||
1762 | 188 | */ | ||
1763 | 189 | - make_child(ap_server_conf, child_slot, | ||
1764 | 190 | - ap_get_scoreboard_process(child_slot)->bucket); | ||
1765 | 191 | + make_child(ap_server_conf, child_slot); | ||
1766 | 192 | --remaining_children_to_start; | ||
1767 | 193 | } | ||
1768 | 194 | #if APR_HAS_OTHER_CHILD | ||
1769 | 195 | Index: apache2-2.4.29/server/mpm/worker/worker.c | ||
1770 | 196 | =================================================================== | ||
1771 | 197 | --- apache2-2.4.29.orig/server/mpm/worker/worker.c 2019-04-03 09:22:04.140590533 -0400 | ||
1772 | 198 | +++ apache2-2.4.29/server/mpm/worker/worker.c 2019-04-03 09:22:04.140590533 -0400 | ||
1773 | 199 | @@ -1312,7 +1312,6 @@ static int make_child(server_rec *s, int | ||
1774 | 200 | worker_note_child_lost_slot(slot, pid); | ||
1775 | 201 | } | ||
1776 | 202 | ap_scoreboard_image->parent[slot].quiescing = 0; | ||
1777 | 203 | - ap_scoreboard_image->parent[slot].bucket = bucket; | ||
1778 | 204 | worker_note_child_started(slot, pid); | ||
1779 | 205 | return 0; | ||
1780 | 206 | } | ||
1781 | 207 | @@ -1361,6 +1360,7 @@ static void perform_idle_server_maintena | ||
1782 | 208 | int any_dead_threads = 0; | ||
1783 | 209 | int all_dead_threads = 1; | ||
1784 | 210 | int child_threads_active = 0; | ||
1785 | 211 | + int bucket = i % num_buckets; | ||
1786 | 212 | |||
1787 | 213 | if (i >= retained->max_daemons_limit && | ||
1788 | 214 | totally_free_length == retained->idle_spawn_rate[child_bucket]) { | ||
1789 | 215 | @@ -1393,7 +1393,7 @@ static void perform_idle_server_maintena | ||
1790 | 216 | if (status <= SERVER_READY && | ||
1791 | 217 | !ps->quiescing && | ||
1792 | 218 | ps->generation == retained->mpm->my_generation && | ||
1793 | 219 | - ps->bucket == child_bucket) { | ||
1794 | 220 | + bucket == child_bucket) { | ||
1795 | 221 | ++idle_thread_count; | ||
1796 | 222 | } | ||
1797 | 223 | if (status >= SERVER_READY && status < SERVER_GRACEFUL) { | ||
1798 | 224 | @@ -1403,6 +1403,7 @@ static void perform_idle_server_maintena | ||
1799 | 225 | } | ||
1800 | 226 | active_thread_count += child_threads_active; | ||
1801 | 227 | if (any_dead_threads | ||
1802 | 228 | + && bucket == child_bucket | ||
1803 | 229 | && totally_free_length < retained->idle_spawn_rate[child_bucket] | ||
1804 | 230 | && free_length < MAX_SPAWN_RATE / num_buckets | ||
1805 | 231 | && (!ps->pid /* no process in the slot */ | ||
1806 | 232 | @@ -1588,14 +1589,15 @@ static void server_main_loop(int remaini | ||
1807 | 233 | ps->quiescing = 0; | ||
1808 | 234 | if (processed_status == APEXIT_CHILDSICK) { | ||
1809 | 235 | /* resource shortage, minimize the fork rate */ | ||
1810 | 236 | - retained->idle_spawn_rate[ps->bucket] = 1; | ||
1811 | 237 | + retained->idle_spawn_rate[child_slot % num_buckets] = 1; | ||
1812 | 238 | } | ||
1813 | 239 | else if (remaining_children_to_start | ||
1814 | 240 | && child_slot < ap_daemons_limit) { | ||
1815 | 241 | /* we're still doing a 1-for-1 replacement of dead | ||
1816 | 242 | * children with new children | ||
1817 | 243 | */ | ||
1818 | 244 | - make_child(ap_server_conf, child_slot, ps->bucket); | ||
1819 | 245 | + make_child(ap_server_conf, child_slot, | ||
1820 | 246 | + child_slot % num_buckets); | ||
1821 | 247 | --remaining_children_to_start; | ||
1822 | 248 | } | ||
1823 | 249 | } | ||
1824 | diff --git a/debian/patches/CVE-2019-0217.patch b/debian/patches/CVE-2019-0217.patch | |||
1825 | 0 | new file mode 100644 | 250 | new file mode 100644 |
1826 | index 0000000..e8f1090 | |||
1827 | --- /dev/null | |||
1828 | +++ b/debian/patches/CVE-2019-0217.patch | |||
1829 | @@ -0,0 +1,147 @@ | |||
1830 | 1 | From 44b3ddc560c490c60600998fa2bf59b142d08e05 Mon Sep 17 00:00:00 2001 | ||
1831 | 2 | From: Joe Orton <jorton@apache.org> | ||
1832 | 3 | Date: Tue, 12 Mar 2019 09:24:26 +0000 | ||
1833 | 4 | Subject: [PATCH] Merge r1853190 from trunk: | ||
1834 | 5 | |||
1835 | 6 | Fix a race condition. Authentication with valid credentials could be | ||
1836 | 7 | refused in case of concurrent accesses from different users. | ||
1837 | 8 | |||
1838 | 9 | PR: 63124 | ||
1839 | 10 | Submitted by: Simon Kappel <simon.kappel axis.com> | ||
1840 | 11 | Reviewed by: jailletc36, icing, jorton | ||
1841 | 12 | |||
1842 | 13 | |||
1843 | 14 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855298 13f79535-47bb-0310-9956-ffa450edef68 | ||
1844 | 15 | --- | ||
1845 | 16 | CHANGES | 4 ++++ | ||
1846 | 17 | modules/aaa/mod_auth_digest.c | 26 ++++++++++++-------------- | ||
1847 | 18 | 2 files changed, 16 insertions(+), 14 deletions(-) | ||
1848 | 19 | |||
1849 | 20 | #diff --git a/CHANGES b/CHANGES | ||
1850 | 21 | #index 08fc740db30..e79251389d5 100644 | ||
1851 | 22 | #--- a/CHANGES | ||
1852 | 23 | #+++ b/CHANGES | ||
1853 | 24 | #@@ -1,6 +1,10 @@ | ||
1854 | 25 | # -*- coding: utf-8 -*- | ||
1855 | 26 | # Changes with Apache 2.4.39 | ||
1856 | 27 | # | ||
1857 | 28 | #+ *) mod_auth_digest: Fix a race condition. Authentication with valid | ||
1858 | 29 | #+ credentials could be refused in case of concurrent accesses from | ||
1859 | 30 | #+ different users. PR 63124. [Simon Kappel <simon.kappel axis.com>] | ||
1860 | 31 | #+ | ||
1861 | 32 | # *) mod_proxy_wstunnel: Fix websocket proxy over UDS. | ||
1862 | 33 | # PR 62932 <pavel dcmsys.com> | ||
1863 | 34 | # | ||
1864 | 35 | diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c | ||
1865 | 36 | index a67f06986f2..b76094114dd 100644 | ||
1866 | 37 | --- a/modules/aaa/mod_auth_digest.c | ||
1867 | 38 | +++ b/modules/aaa/mod_auth_digest.c | ||
1868 | 39 | @@ -92,7 +92,6 @@ typedef struct digest_config_struct { | ||
1869 | 40 | int check_nc; | ||
1870 | 41 | const char *algorithm; | ||
1871 | 42 | char *uri_list; | ||
1872 | 43 | - const char *ha1; | ||
1873 | 44 | } digest_config_rec; | ||
1874 | 45 | |||
1875 | 46 | |||
1876 | 47 | @@ -153,6 +152,7 @@ typedef struct digest_header_struct { | ||
1877 | 48 | apr_time_t nonce_time; | ||
1878 | 49 | enum hdr_sts auth_hdr_sts; | ||
1879 | 50 | int needed_auth; | ||
1880 | 51 | + const char *ha1; | ||
1881 | 52 | client_entry *client; | ||
1882 | 53 | } digest_header_rec; | ||
1883 | 54 | |||
1884 | 55 | @@ -1304,7 +1304,7 @@ static int hook_note_digest_auth_failure(request_rec *r, const char *auth_type) | ||
1885 | 56 | */ | ||
1886 | 57 | |||
1887 | 58 | static authn_status get_hash(request_rec *r, const char *user, | ||
1888 | 59 | - digest_config_rec *conf) | ||
1889 | 60 | + digest_config_rec *conf, const char **rethash) | ||
1890 | 61 | { | ||
1891 | 62 | authn_status auth_result; | ||
1892 | 63 | char *password; | ||
1893 | 64 | @@ -1356,7 +1356,7 @@ static authn_status get_hash(request_rec *r, const char *user, | ||
1894 | 65 | } while (current_provider); | ||
1895 | 66 | |||
1896 | 67 | if (auth_result == AUTH_USER_FOUND) { | ||
1897 | 68 | - conf->ha1 = password; | ||
1898 | 69 | + *rethash = password; | ||
1899 | 70 | } | ||
1900 | 71 | |||
1901 | 72 | return auth_result; | ||
1902 | 73 | @@ -1483,25 +1483,24 @@ static int check_nonce(request_rec *r, digest_header_rec *resp, | ||
1903 | 74 | |||
1904 | 75 | /* RFC-2069 */ | ||
1905 | 76 | static const char *old_digest(const request_rec *r, | ||
1906 | 77 | - const digest_header_rec *resp, const char *ha1) | ||
1907 | 78 | + const digest_header_rec *resp) | ||
1908 | 79 | { | ||
1909 | 80 | const char *ha2; | ||
1910 | 81 | |||
1911 | 82 | ha2 = ap_md5(r->pool, (unsigned char *)apr_pstrcat(r->pool, resp->method, ":", | ||
1912 | 83 | resp->uri, NULL)); | ||
1913 | 84 | return ap_md5(r->pool, | ||
1914 | 85 | - (unsigned char *)apr_pstrcat(r->pool, ha1, ":", resp->nonce, | ||
1915 | 86 | - ":", ha2, NULL)); | ||
1916 | 87 | + (unsigned char *)apr_pstrcat(r->pool, resp->ha1, ":", | ||
1917 | 88 | + resp->nonce, ":", ha2, NULL)); | ||
1918 | 89 | } | ||
1919 | 90 | |||
1920 | 91 | /* RFC-2617 */ | ||
1921 | 92 | static const char *new_digest(const request_rec *r, | ||
1922 | 93 | - digest_header_rec *resp, | ||
1923 | 94 | - const digest_config_rec *conf) | ||
1924 | 95 | + digest_header_rec *resp) | ||
1925 | 96 | { | ||
1926 | 97 | const char *ha1, *ha2, *a2; | ||
1927 | 98 | |||
1928 | 99 | - ha1 = conf->ha1; | ||
1929 | 100 | + ha1 = resp->ha1; | ||
1930 | 101 | |||
1931 | 102 | a2 = apr_pstrcat(r->pool, resp->method, ":", resp->uri, NULL); | ||
1932 | 103 | ha2 = ap_md5(r->pool, (const unsigned char *)a2); | ||
1933 | 104 | @@ -1514,7 +1513,6 @@ static const char *new_digest(const request_rec *r, | ||
1934 | 105 | NULL)); | ||
1935 | 106 | } | ||
1936 | 107 | |||
1937 | 108 | - | ||
1938 | 109 | static void copy_uri_components(apr_uri_t *dst, | ||
1939 | 110 | apr_uri_t *src, request_rec *r) { | ||
1940 | 111 | if (src->scheme && src->scheme[0] != '\0') { | ||
1941 | 112 | @@ -1759,7 +1757,7 @@ static int authenticate_digest_user(request_rec *r) | ||
1942 | 113 | return HTTP_UNAUTHORIZED; | ||
1943 | 114 | } | ||
1944 | 115 | |||
1945 | 116 | - return_code = get_hash(r, r->user, conf); | ||
1946 | 117 | + return_code = get_hash(r, r->user, conf, &resp->ha1); | ||
1947 | 118 | |||
1948 | 119 | if (return_code == AUTH_USER_NOT_FOUND) { | ||
1949 | 120 | ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01790) | ||
1950 | 121 | @@ -1789,7 +1787,7 @@ static int authenticate_digest_user(request_rec *r) | ||
1951 | 122 | |||
1952 | 123 | if (resp->message_qop == NULL) { | ||
1953 | 124 | /* old (rfc-2069) style digest */ | ||
1954 | 125 | - if (strcmp(resp->digest, old_digest(r, resp, conf->ha1))) { | ||
1955 | 126 | + if (strcmp(resp->digest, old_digest(r, resp))) { | ||
1956 | 127 | ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01792) | ||
1957 | 128 | "user %s: password mismatch: %s", r->user, | ||
1958 | 129 | r->uri); | ||
1959 | 130 | @@ -1819,7 +1817,7 @@ static int authenticate_digest_user(request_rec *r) | ||
1960 | 131 | return HTTP_UNAUTHORIZED; | ||
1961 | 132 | } | ||
1962 | 133 | |||
1963 | 134 | - exp_digest = new_digest(r, resp, conf); | ||
1964 | 135 | + exp_digest = new_digest(r, resp); | ||
1965 | 136 | if (!exp_digest) { | ||
1966 | 137 | /* we failed to allocate a client struct */ | ||
1967 | 138 | return HTTP_INTERNAL_SERVER_ERROR; | ||
1968 | 139 | @@ -1903,7 +1901,7 @@ static int add_auth_info(request_rec *r) | ||
1969 | 140 | |||
1970 | 141 | /* calculate rspauth attribute | ||
1971 | 142 | */ | ||
1972 | 143 | - ha1 = conf->ha1; | ||
1973 | 144 | + ha1 = resp->ha1; | ||
1974 | 145 | |||
1975 | 146 | a2 = apr_pstrcat(r->pool, ":", resp->uri, NULL); | ||
1976 | 147 | ha2 = ap_md5(r->pool, (const unsigned char *)a2); | ||
1977 | diff --git a/debian/patches/CVE-2019-0220-1.patch b/debian/patches/CVE-2019-0220-1.patch | |||
1978 | 0 | new file mode 100644 | 148 | new file mode 100644 |
1979 | index 0000000..86cc667 | |||
1980 | --- /dev/null | |||
1981 | +++ b/debian/patches/CVE-2019-0220-1.patch | |||
1982 | @@ -0,0 +1,259 @@ | |||
1983 | 1 | Backport of: | ||
1984 | 2 | |||
1985 | 3 | From 9bc1917a27a2323e535aadb081e38172ae0e3fc2 Mon Sep 17 00:00:00 2001 | ||
1986 | 4 | From: Stefan Eissing <icing@apache.org> | ||
1987 | 5 | Date: Mon, 18 Mar 2019 08:49:59 +0000 | ||
1988 | 6 | Subject: [PATCH] Merge of r1855705 from trunk: | ||
1989 | 7 | |||
1990 | 8 | core: merge consecutive slashes in the path | ||
1991 | 9 | |||
1992 | 10 | |||
1993 | 11 | |||
1994 | 12 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855737 13f79535-47bb-0310-9956-ffa450edef68 | ||
1995 | 13 | --- | ||
1996 | 14 | CHANGES | 4 ++++ | ||
1997 | 15 | docs/manual/mod/core.xml | 26 ++++++++++++++++++++++++++ | ||
1998 | 16 | include/ap_mmn.h | 4 +++- | ||
1999 | 17 | include/http_core.h | 2 +- | ||
2000 | 18 | include/httpd.h | 14 ++++++++++++-- | ||
2001 | 19 | server/core.c | 13 +++++++++++++ | ||
2002 | 20 | server/request.c | 25 +++++++++---------------- | ||
2003 | 21 | server/util.c | 10 +++++++--- | ||
2004 | 22 | 8 files changed, 75 insertions(+), 23 deletions(-) | ||
2005 | 23 | |||
2006 | 24 | #diff --git a/CHANGES b/CHANGES | ||
2007 | 25 | #index e3e8a98db24..9dd7045c232 100644 | ||
2008 | 26 | #--- a/CHANGES | ||
2009 | 27 | #+++ b/CHANGES | ||
2010 | 28 | #@@ -1,6 +1,10 @@ | ||
2011 | 29 | # -*- coding: utf-8 -*- | ||
2012 | 30 | # Changes with Apache 2.4.39 | ||
2013 | 31 | # | ||
2014 | 32 | #+ *) core: new configuration option 'MergeSlashes on|off' that controls handling of | ||
2015 | 33 | #+ multiple, consecutive slash ('/') characters in the path component of the request URL. | ||
2016 | 34 | #+ [Eric Covener] | ||
2017 | 35 | #+ | ||
2018 | 36 | # *) mod_http2: when SSL renegotiation is inhibited and a 403 ErrorDocument is | ||
2019 | 37 | # in play, the proper HTTP/2 stream reset did not trigger with H2_ERR_HTTP_1_1_REQUIRED. | ||
2020 | 38 | # Fixed. [Michael Kaufmann] | ||
2021 | 39 | #diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml | ||
2022 | 40 | #index fc664116727..460b4367621 100644 | ||
2023 | 41 | #--- a/docs/manual/mod/core.xml | ||
2024 | 42 | #+++ b/docs/manual/mod/core.xml | ||
2025 | 43 | #@@ -5138,4 +5138,30 @@ recognized methods to modules.</p> | ||
2026 | 44 | # <seealso><directive module="mod_allowmethods">AllowMethods</directive></seealso> | ||
2027 | 45 | # </directivesynopsis> | ||
2028 | 46 | # | ||
2029 | 47 | #+<directivesynopsis> | ||
2030 | 48 | #+<name>MergeSlashes</name> | ||
2031 | 49 | #+<description>Controls whether the server merges consecutive slashes in URLs. | ||
2032 | 50 | #+</description> | ||
2033 | 51 | #+<syntax>MergeSlashes ON|OFF</syntax> | ||
2034 | 52 | #+<default>MergeSlashes ON</default> | ||
2035 | 53 | #+<contextlist><context>server config</context><context>virtual host</context> | ||
2036 | 54 | #+</contextlist> | ||
2037 | 55 | #+<compatibility>Added in 2.5.1</compatibility> | ||
2038 | 56 | #+ | ||
2039 | 57 | #+<usage> | ||
2040 | 58 | #+ <p>By default, the server merges (or collapses) multiple consecutive slash | ||
2041 | 59 | #+ ('/') characters in the path component of the request URL.</p> | ||
2042 | 60 | #+ | ||
2043 | 61 | #+ <p>When mapping URL's to the filesystem, these multiple slashes are not | ||
2044 | 62 | #+ significant. However, URL's handled other ways, such as by CGI or proxy, | ||
2045 | 63 | #+ might prefer to retain the significance of multiple consecutive slashes. | ||
2046 | 64 | #+ In these cases <directive>MergeSlashes</directive> can be set to | ||
2047 | 65 | #+ <em>OFF</em> to retain the multiple consecutive slashes. In these | ||
2048 | 66 | #+ configurations, regular expressions used in the configuration file that match | ||
2049 | 67 | #+ the path component of the URL (<directive>LocationMatch</directive>, | ||
2050 | 68 | #+ <directive>RewriteRule</directive>, ...) need to take into account multiple | ||
2051 | 69 | #+ consecutive slashes.</p> | ||
2052 | 70 | #+</usage> | ||
2053 | 71 | #+</directivesynopsis> | ||
2054 | 72 | #+ | ||
2055 | 73 | # </modulesynopsis> | ||
2056 | 74 | Index: apache2-2.4.29/include/http_core.h | ||
2057 | 75 | =================================================================== | ||
2058 | 76 | --- apache2-2.4.29.orig/include/http_core.h 2019-04-03 09:22:24.452651658 -0400 | ||
2059 | 77 | +++ apache2-2.4.29/include/http_core.h 2019-04-03 09:22:24.448651645 -0400 | ||
2060 | 78 | @@ -740,7 +740,7 @@ typedef struct { | ||
2061 | 79 | #define AP_HTTP_METHODS_LENIENT 1 | ||
2062 | 80 | #define AP_HTTP_METHODS_REGISTERED 2 | ||
2063 | 81 | char http_methods; | ||
2064 | 82 | - | ||
2065 | 83 | + unsigned int merge_slashes; | ||
2066 | 84 | } core_server_config; | ||
2067 | 85 | |||
2068 | 86 | /* for AddOutputFiltersByType in core.c */ | ||
2069 | 87 | Index: apache2-2.4.29/include/httpd.h | ||
2070 | 88 | =================================================================== | ||
2071 | 89 | --- apache2-2.4.29.orig/include/httpd.h 2019-04-03 09:22:24.452651658 -0400 | ||
2072 | 90 | +++ apache2-2.4.29/include/httpd.h 2019-04-03 09:22:24.448651645 -0400 | ||
2073 | 91 | @@ -1691,12 +1691,22 @@ AP_DECLARE(int) ap_unescape_url_keep2f(c | ||
2074 | 92 | AP_DECLARE(int) ap_unescape_urlencoded(char *query); | ||
2075 | 93 | |||
2076 | 94 | /** | ||
2077 | 95 | - * Convert all double slashes to single slashes | ||
2078 | 96 | - * @param name The string to convert | ||
2079 | 97 | + * Convert all double slashes to single slashes, except where significant | ||
2080 | 98 | + * to the filesystem on the current platform. | ||
2081 | 99 | + * @param name The string to convert, assumed to be a filesystem path | ||
2082 | 100 | */ | ||
2083 | 101 | AP_DECLARE(void) ap_no2slash(char *name); | ||
2084 | 102 | |||
2085 | 103 | /** | ||
2086 | 104 | + * Convert all double slashes to single slashes, except where significant | ||
2087 | 105 | + * to the filesystem on the current platform. | ||
2088 | 106 | + * @param name The string to convert | ||
2089 | 107 | + * @param is_fs_path if set to 0, the significance of any double-slashes is | ||
2090 | 108 | + * ignored. | ||
2091 | 109 | + */ | ||
2092 | 110 | +AP_DECLARE(void) ap_no2slash_ex(char *name, int is_fs_path); | ||
2093 | 111 | + | ||
2094 | 112 | +/** | ||
2095 | 113 | * Remove all ./ and xx/../ substrings from a file name. Also remove | ||
2096 | 114 | * any leading ../ or /../ substrings. | ||
2097 | 115 | * @param name the file name to parse | ||
2098 | 116 | Index: apache2-2.4.29/server/core.c | ||
2099 | 117 | =================================================================== | ||
2100 | 118 | --- apache2-2.4.29.orig/server/core.c 2019-04-03 09:22:24.452651658 -0400 | ||
2101 | 119 | +++ apache2-2.4.29/server/core.c 2019-04-03 09:22:24.448651645 -0400 | ||
2102 | 120 | @@ -490,6 +490,7 @@ static void *create_core_server_config(a | ||
2103 | 121 | |||
2104 | 122 | conf->protocols = apr_array_make(a, 5, sizeof(const char *)); | ||
2105 | 123 | conf->protocols_honor_order = -1; | ||
2106 | 124 | + conf->merge_slashes = AP_CORE_CONFIG_UNSET; | ||
2107 | 125 | |||
2108 | 126 | return (void *)conf; | ||
2109 | 127 | } | ||
2110 | 128 | @@ -555,6 +556,7 @@ static void *merge_core_server_configs(a | ||
2111 | 129 | conf->protocols_honor_order = ((virt->protocols_honor_order < 0)? | ||
2112 | 130 | base->protocols_honor_order : | ||
2113 | 131 | virt->protocols_honor_order); | ||
2114 | 132 | + AP_CORE_MERGE_FLAG(merge_slashes, conf, base, virt); | ||
2115 | 133 | |||
2116 | 134 | return conf; | ||
2117 | 135 | } | ||
2118 | 136 | @@ -1862,6 +1864,13 @@ static const char *set_qualify_redirect_ | ||
2119 | 137 | return NULL; | ||
2120 | 138 | } | ||
2121 | 139 | |||
2122 | 140 | +static const char *set_core_server_flag(cmd_parms *cmd, void *s_, int flag) | ||
2123 | 141 | +{ | ||
2124 | 142 | + core_server_config *conf = | ||
2125 | 143 | + ap_get_core_module_config(cmd->server->module_config); | ||
2126 | 144 | + return ap_set_flag_slot(cmd, conf, flag); | ||
2127 | 145 | +} | ||
2128 | 146 | + | ||
2129 | 147 | static const char *set_override_list(cmd_parms *cmd, void *d_, int argc, char *const argv[]) | ||
2130 | 148 | { | ||
2131 | 149 | core_dir_config *d = d_; | ||
2132 | 150 | @@ -4551,6 +4560,10 @@ AP_INIT_ITERATE("HttpProtocolOptions", s | ||
2133 | 151 | "'Unsafe' or 'Strict' (default). Sets HTTP acceptance rules"), | ||
2134 | 152 | AP_INIT_ITERATE("RegisterHttpMethod", set_http_method, NULL, RSRC_CONF, | ||
2135 | 153 | "Registers non-standard HTTP methods"), | ||
2136 | 154 | +AP_INIT_FLAG("MergeSlashes", set_core_server_flag, | ||
2137 | 155 | + (void *)APR_OFFSETOF(core_server_config, merge_slashes), | ||
2138 | 156 | + RSRC_CONF, | ||
2139 | 157 | + "Controls whether consecutive slashes in the URI path are merged"), | ||
2140 | 158 | { NULL } | ||
2141 | 159 | }; | ||
2142 | 160 | |||
2143 | 161 | Index: apache2-2.4.29/server/request.c | ||
2144 | 162 | =================================================================== | ||
2145 | 163 | --- apache2-2.4.29.orig/server/request.c 2019-04-03 09:22:24.452651658 -0400 | ||
2146 | 164 | +++ apache2-2.4.29/server/request.c 2019-04-03 09:22:24.448651645 -0400 | ||
2147 | 165 | @@ -167,6 +167,8 @@ AP_DECLARE(int) ap_process_request_inter | ||
2148 | 166 | int file_req = (r->main && r->filename); | ||
2149 | 167 | int access_status; | ||
2150 | 168 | core_dir_config *d; | ||
2151 | 169 | + core_server_config *sconf = | ||
2152 | 170 | + ap_get_core_module_config(r->server->module_config); | ||
2153 | 171 | |||
2154 | 172 | /* Ignore embedded %2F's in path for proxy requests */ | ||
2155 | 173 | if (!r->proxyreq && r->parsed_uri.path) { | ||
2156 | 174 | @@ -191,6 +193,10 @@ AP_DECLARE(int) ap_process_request_inter | ||
2157 | 175 | } | ||
2158 | 176 | |||
2159 | 177 | ap_getparents(r->uri); /* OK --- shrinking transformations... */ | ||
2160 | 178 | + if (sconf->merge_slashes != AP_CORE_CONFIG_OFF) { | ||
2161 | 179 | + ap_no2slash(r->uri); | ||
2162 | 180 | + ap_no2slash(r->parsed_uri.path); | ||
2163 | 181 | + } | ||
2164 | 182 | |||
2165 | 183 | /* All file subrequests are a huge pain... they cannot bubble through the | ||
2166 | 184 | * next several steps. Only file subrequests are allowed an empty uri, | ||
2167 | 185 | @@ -1411,20 +1417,7 @@ AP_DECLARE(int) ap_location_walk(request | ||
2168 | 186 | |||
2169 | 187 | cache = prep_walk_cache(AP_NOTE_LOCATION_WALK, r); | ||
2170 | 188 | cached = (cache->cached != NULL); | ||
2171 | 189 | - | ||
2172 | 190 | - /* Location and LocationMatch differ on their behaviour w.r.t. multiple | ||
2173 | 191 | - * slashes. Location matches multiple slashes with a single slash, | ||
2174 | 192 | - * LocationMatch doesn't. An exception, for backwards brokenness is | ||
2175 | 193 | - * absoluteURIs... in which case neither match multiple slashes. | ||
2176 | 194 | - */ | ||
2177 | 195 | - if (r->uri[0] != '/') { | ||
2178 | 196 | - entry_uri = r->uri; | ||
2179 | 197 | - } | ||
2180 | 198 | - else { | ||
2181 | 199 | - char *uri = apr_pstrdup(r->pool, r->uri); | ||
2182 | 200 | - ap_no2slash(uri); | ||
2183 | 201 | - entry_uri = uri; | ||
2184 | 202 | - } | ||
2185 | 203 | + entry_uri = r->uri; | ||
2186 | 204 | |||
2187 | 205 | /* If we have an cache->cached location that matches r->uri, | ||
2188 | 206 | * and the vhost's list of locations hasn't changed, we can skip | ||
2189 | 207 | @@ -1491,7 +1484,7 @@ AP_DECLARE(int) ap_location_walk(request | ||
2190 | 208 | pmatch = apr_palloc(rxpool, nmatch*sizeof(ap_regmatch_t)); | ||
2191 | 209 | } | ||
2192 | 210 | |||
2193 | 211 | - if (ap_regexec(entry_core->r, r->uri, nmatch, pmatch, 0)) { | ||
2194 | 212 | + if (ap_regexec(entry_core->r, entry_uri, nmatch, pmatch, 0)) { | ||
2195 | 213 | continue; | ||
2196 | 214 | } | ||
2197 | 215 | |||
2198 | 216 | @@ -1501,7 +1494,7 @@ AP_DECLARE(int) ap_location_walk(request | ||
2199 | 217 | apr_table_setn(r->subprocess_env, | ||
2200 | 218 | ((const char **)entry_core->refs->elts)[i], | ||
2201 | 219 | apr_pstrndup(r->pool, | ||
2202 | 220 | - r->uri + pmatch[i].rm_so, | ||
2203 | 221 | + entry_uri + pmatch[i].rm_so, | ||
2204 | 222 | pmatch[i].rm_eo - pmatch[i].rm_so)); | ||
2205 | 223 | } | ||
2206 | 224 | } | ||
2207 | 225 | Index: apache2-2.4.29/server/util.c | ||
2208 | 226 | =================================================================== | ||
2209 | 227 | --- apache2-2.4.29.orig/server/util.c 2019-04-03 09:22:24.452651658 -0400 | ||
2210 | 228 | +++ apache2-2.4.29/server/util.c 2019-04-03 09:22:24.448651645 -0400 | ||
2211 | 229 | @@ -561,16 +561,16 @@ AP_DECLARE(void) ap_getparents(char *nam | ||
2212 | 230 | name[l] = '\0'; | ||
2213 | 231 | } | ||
2214 | 232 | } | ||
2215 | 233 | - | ||
2216 | 234 | -AP_DECLARE(void) ap_no2slash(char *name) | ||
2217 | 235 | +AP_DECLARE(void) ap_no2slash_ex(char *name, int is_fs_path) | ||
2218 | 236 | { | ||
2219 | 237 | + | ||
2220 | 238 | char *d, *s; | ||
2221 | 239 | |||
2222 | 240 | s = d = name; | ||
2223 | 241 | |||
2224 | 242 | #ifdef HAVE_UNC_PATHS | ||
2225 | 243 | /* Check for UNC names. Leave leading two slashes. */ | ||
2226 | 244 | - if (s[0] == '/' && s[1] == '/') | ||
2227 | 245 | + if (is_fs_path && s[0] == '/' && s[1] == '/') | ||
2228 | 246 | *d++ = *s++; | ||
2229 | 247 | #endif | ||
2230 | 248 | |||
2231 | 249 | @@ -587,6 +587,10 @@ AP_DECLARE(void) ap_no2slash(char *name) | ||
2232 | 250 | *d = '\0'; | ||
2233 | 251 | } | ||
2234 | 252 | |||
2235 | 253 | +AP_DECLARE(void) ap_no2slash(char *name) | ||
2236 | 254 | +{ | ||
2237 | 255 | + ap_no2slash_ex(name, 1); | ||
2238 | 256 | +} | ||
2239 | 257 | |||
2240 | 258 | /* | ||
2241 | 259 | * copy at most n leading directories of s into d | ||
2242 | diff --git a/debian/patches/CVE-2019-0220-2.patch b/debian/patches/CVE-2019-0220-2.patch | |||
2243 | 0 | new file mode 100644 | 260 | new file mode 100644 |
2244 | index 0000000..0204259 | |||
2245 | --- /dev/null | |||
2246 | +++ b/debian/patches/CVE-2019-0220-2.patch | |||
2247 | @@ -0,0 +1,50 @@ | |||
2248 | 1 | From c4ef468b25718a26f2b92cbea3ca093729b79331 Mon Sep 17 00:00:00 2001 | ||
2249 | 2 | From: Eric Covener <covener@apache.org> | ||
2250 | 3 | Date: Mon, 18 Mar 2019 12:10:15 +0000 | ||
2251 | 4 | Subject: [PATCH] merge 1855743,1855744 ^/httpd/httpd/trunk . | ||
2252 | 5 | |||
2253 | 6 | r->parsed_uri.path safety in recent backport | ||
2254 | 7 | |||
2255 | 8 | *) core: fix SEGFAULT in CONNECT with recent change | ||
2256 | 9 | 2.4.x: svn merge -c 1855743,1855744 ^/httpd/httpd/trunk . | ||
2257 | 10 | +1: rpluem, icing, covener | ||
2258 | 11 | |||
2259 | 12 | |||
2260 | 13 | |||
2261 | 14 | |||
2262 | 15 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855751 13f79535-47bb-0310-9956-ffa450edef68 | ||
2263 | 16 | --- | ||
2264 | 17 | server/request.c | 4 +++- | ||
2265 | 18 | server/util.c | 4 ++++ | ||
2266 | 19 | 2 files changed, 7 insertions(+), 1 deletion(-) | ||
2267 | 20 | |||
2268 | 21 | diff --git a/server/request.c b/server/request.c | ||
2269 | 22 | index 1ce8908824b..d5c558afa30 100644 | ||
2270 | 23 | --- a/server/request.c | ||
2271 | 24 | +++ b/server/request.c | ||
2272 | 25 | @@ -195,7 +195,9 @@ AP_DECLARE(int) ap_process_request_internal(request_rec *r) | ||
2273 | 26 | ap_getparents(r->uri); /* OK --- shrinking transformations... */ | ||
2274 | 27 | if (sconf->merge_slashes != AP_CORE_CONFIG_OFF) { | ||
2275 | 28 | ap_no2slash(r->uri); | ||
2276 | 29 | - ap_no2slash(r->parsed_uri.path); | ||
2277 | 30 | + if (r->parsed_uri.path) { | ||
2278 | 31 | + ap_no2slash(r->parsed_uri.path); | ||
2279 | 32 | + } | ||
2280 | 33 | } | ||
2281 | 34 | |||
2282 | 35 | /* All file subrequests are a huge pain... they cannot bubble through the | ||
2283 | 36 | diff --git a/server/util.c b/server/util.c | ||
2284 | 37 | index 607c4850d86..f3b17f1581e 100644 | ||
2285 | 38 | --- a/server/util.c | ||
2286 | 39 | +++ b/server/util.c | ||
2287 | 40 | @@ -566,6 +566,10 @@ AP_DECLARE(void) ap_no2slash_ex(char *name, int is_fs_path) | ||
2288 | 41 | |||
2289 | 42 | char *d, *s; | ||
2290 | 43 | |||
2291 | 44 | + if (!name || !*name) { | ||
2292 | 45 | + return; | ||
2293 | 46 | + } | ||
2294 | 47 | + | ||
2295 | 48 | s = d = name; | ||
2296 | 49 | |||
2297 | 50 | #ifdef HAVE_UNC_PATHS | ||
2298 | diff --git a/debian/patches/CVE-2019-0220-3.patch b/debian/patches/CVE-2019-0220-3.patch | |||
2299 | 0 | new file mode 100644 | 51 | new file mode 100644 |
2300 | index 0000000..7b3ff6f | |||
2301 | --- /dev/null | |||
2302 | +++ b/debian/patches/CVE-2019-0220-3.patch | |||
2303 | @@ -0,0 +1,43 @@ | |||
2304 | 1 | From 3451fc2bf8708b0dc8cd6a7d0ac0fe5b6401befc Mon Sep 17 00:00:00 2001 | ||
2305 | 2 | From: Eric Covener <covener@apache.org> | ||
2306 | 3 | Date: Tue, 19 Mar 2019 18:01:21 +0000 | ||
2307 | 4 | Subject: [PATCH] *) maintainer mode fix for util.c no2slash_ex trunk | ||
2308 | 5 | patch: http://svn.apache.org/r1855755 2.4.x patch svn merge -c 1855755 | ||
2309 | 6 | ^/httpd/httpd/trunk . +1: covener, rpluem, jim, ylavic | ||
2310 | 7 | |||
2311 | 8 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1855853 13f79535-47bb-0310-9956-ffa450edef68 | ||
2312 | 9 | --- | ||
2313 | 10 | STATUS | 6 ------ | ||
2314 | 11 | server/util.c | 2 +- | ||
2315 | 12 | 2 files changed, 1 insertion(+), 7 deletions(-) | ||
2316 | 13 | |||
2317 | 14 | #diff --git a/STATUS b/STATUS | ||
2318 | 15 | #index ffe5d22550c..1f8cb2f7884 100644 | ||
2319 | 16 | #--- a/STATUS | ||
2320 | 17 | #+++ b/STATUS | ||
2321 | 18 | #@@ -126,12 +126,6 @@ RELEASE SHOWSTOPPERS: | ||
2322 | 19 | # PATCHES ACCEPTED TO BACKPORT FROM TRUNK: | ||
2323 | 20 | # [ start all new proposals below, under PATCHES PROPOSED. ] | ||
2324 | 21 | # | ||
2325 | 22 | #- *) maintainer mode fix for util.c no2slash_ex | ||
2326 | 23 | #- trunk patch: http://svn.apache.org/r1855755 | ||
2327 | 24 | #- 2.4.x patch svn merge -c 1855755 ^/httpd/httpd/trunk . | ||
2328 | 25 | #- +1: covener, rpluem, jim, ylavic | ||
2329 | 26 | #- | ||
2330 | 27 | #- | ||
2331 | 28 | # PATCHES PROPOSED TO BACKPORT FROM TRUNK: | ||
2332 | 29 | # [ New proposals should be added at the end of the list ] | ||
2333 | 30 | # | ||
2334 | 31 | diff --git a/server/util.c b/server/util.c | ||
2335 | 32 | index f3b17f1581e..e0c558cee2d 100644 | ||
2336 | 33 | --- a/server/util.c | ||
2337 | 34 | +++ b/server/util.c | ||
2338 | 35 | @@ -566,7 +566,7 @@ AP_DECLARE(void) ap_no2slash_ex(char *name, int is_fs_path) | ||
2339 | 36 | |||
2340 | 37 | char *d, *s; | ||
2341 | 38 | |||
2342 | 39 | - if (!name || !*name) { | ||
2343 | 40 | + if (!*name) { | ||
2344 | 41 | return; | ||
2345 | 42 | } | ||
2346 | 43 | |||
2347 | diff --git a/debian/patches/CVE-2019-10092-1.patch b/debian/patches/CVE-2019-10092-1.patch | |||
2348 | 0 | new file mode 100644 | 44 | new file mode 100644 |
2349 | index 0000000..102b18e | |||
2350 | --- /dev/null | |||
2351 | +++ b/debian/patches/CVE-2019-10092-1.patch | |||
2352 | @@ -0,0 +1,245 @@ | |||
2353 | 1 | From b5aa97e7c9792ba31055507eaf9a54e1fbb17464 Mon Sep 17 00:00:00 2001 | ||
2354 | 2 | From: Stefan Eissing <icing@apache.org> | ||
2355 | 3 | Date: Fri, 2 Aug 2019 09:10:06 +0000 | ||
2356 | 4 | Subject: [PATCH] Merge of r1864191 from trunk: | ||
2357 | 5 | |||
2358 | 6 | *) core, proxy: remove request URL and headers from error docs | ||
2359 | 7 | [Eric Covener] | ||
2360 | 8 | |||
2361 | 9 | |||
2362 | 10 | |||
2363 | 11 | |||
2364 | 12 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1864207 13f79535-47bb-0310-9956-ffa450edef68 | ||
2365 | 13 | --- | ||
2366 | 14 | CHANGES | 2 + | ||
2367 | 15 | STATUS | 5 -- | ||
2368 | 16 | modules/http/http_protocol.c | 86 +++++++++++------------------------ | ||
2369 | 17 | modules/proxy/mod_proxy.c | 7 +-- | ||
2370 | 18 | modules/proxy/mod_proxy_ftp.c | 5 +- | ||
2371 | 19 | modules/proxy/proxy_util.c | 5 +- | ||
2372 | 20 | 6 files changed, 36 insertions(+), 74 deletions(-) | ||
2373 | 21 | |||
2374 | 22 | # diff --git a/CHANGES b/CHANGES | ||
2375 | 23 | # index 01f232c613..bf00b5114b 100644 | ||
2376 | 24 | # --- a/CHANGES | ||
2377 | 25 | # +++ b/CHANGES | ||
2378 | 26 | # @@ -1,6 +1,8 @@ | ||
2379 | 27 | # -*- coding: utf-8 -*- | ||
2380 | 28 | # Changes with Apache 2.4.40 | ||
2381 | 29 | # | ||
2382 | 30 | # + *) core: Remove request details from built-in error documents [Eric Covener] | ||
2383 | 31 | # + | ||
2384 | 32 | # *) mod_http2: core setting "LimitRequestFieldSize" is not additionally checked on | ||
2385 | 33 | # merged header fields, just as HTTP/1.1 does. [Stefan Eissing, Michael Kaufmann] | ||
2386 | 34 | # | ||
2387 | 35 | # diff --git a/STATUS b/STATUS | ||
2388 | 36 | # index a6f3548511..1ce0436916 100644 | ||
2389 | 37 | # --- a/STATUS | ||
2390 | 38 | # +++ b/STATUS | ||
2391 | 39 | # @@ -150,11 +150,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: | ||
2392 | 40 | # 2.4.x patch: svn merge -c 1863635 ^/httpd/httpd/trunk . | ||
2393 | 41 | # +1: jim, icing, rpluem | ||
2394 | 42 | # | ||
2395 | 43 | # - *) core, proxy: remove request URL and headers from error docs | ||
2396 | 44 | # - trunk: http://svn.apache.org/1864191 | ||
2397 | 45 | # - 2.4.x: svn merge -c 1864191 ^/httpd/httpd/trunk . | ||
2398 | 46 | # - +1: covener, rpluem, icing | ||
2399 | 47 | # - | ||
2400 | 48 | # | ||
2401 | 49 | # PATCHES PROPOSED TO BACKPORT FROM TRUNK: | ||
2402 | 50 | # [ New proposals should be added at the end of the list ] | ||
2403 | 51 | diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c | ||
2404 | 52 | index e419eb6cd4..dcafa9c68a 100644 | ||
2405 | 53 | --- a/modules/http/http_protocol.c | ||
2406 | 54 | +++ b/modules/http/http_protocol.c | ||
2407 | 55 | @@ -1132,13 +1132,10 @@ static const char *get_canned_error_string(int status, | ||
2408 | 56 | "\">here</a>.</p>\n", | ||
2409 | 57 | NULL)); | ||
2410 | 58 | case HTTP_USE_PROXY: | ||
2411 | 59 | - return(apr_pstrcat(p, | ||
2412 | 60 | - "<p>This resource is only accessible " | ||
2413 | 61 | - "through the proxy\n", | ||
2414 | 62 | - ap_escape_html(r->pool, location), | ||
2415 | 63 | - "<br />\nYou will need to configure " | ||
2416 | 64 | - "your client to use that proxy.</p>\n", | ||
2417 | 65 | - NULL)); | ||
2418 | 66 | + return("<p>This resource is only accessible " | ||
2419 | 67 | + "through the proxy\n" | ||
2420 | 68 | + "<br />\nYou will need to configure " | ||
2421 | 69 | + "your client to use that proxy.</p>\n"); | ||
2422 | 70 | case HTTP_PROXY_AUTHENTICATION_REQUIRED: | ||
2423 | 71 | case HTTP_UNAUTHORIZED: | ||
2424 | 72 | return("<p>This server could not verify that you\n" | ||
2425 | 73 | @@ -1154,34 +1151,20 @@ static const char *get_canned_error_string(int status, | ||
2426 | 74 | "error-notes", | ||
2427 | 75 | "</p>\n")); | ||
2428 | 76 | case HTTP_FORBIDDEN: | ||
2429 | 77 | - s1 = apr_pstrcat(p, | ||
2430 | 78 | - "<p>You don't have permission to access ", | ||
2431 | 79 | - ap_escape_html(r->pool, r->uri), | ||
2432 | 80 | - "\non this server.<br />\n", | ||
2433 | 81 | - NULL); | ||
2434 | 82 | - return(add_optional_notes(r, s1, "error-notes", "</p>\n")); | ||
2435 | 83 | + return(add_optional_notes(r, "<p>You don't have permission to access this resource.", "error-notes", "</p>\n")); | ||
2436 | 84 | case HTTP_NOT_FOUND: | ||
2437 | 85 | - return(apr_pstrcat(p, | ||
2438 | 86 | - "<p>The requested URL ", | ||
2439 | 87 | - ap_escape_html(r->pool, r->uri), | ||
2440 | 88 | - " was not found on this server.</p>\n", | ||
2441 | 89 | - NULL)); | ||
2442 | 90 | + return("<p>The requested URL was not found on this server.</p>\n"); | ||
2443 | 91 | case HTTP_METHOD_NOT_ALLOWED: | ||
2444 | 92 | return(apr_pstrcat(p, | ||
2445 | 93 | "<p>The requested method ", | ||
2446 | 94 | ap_escape_html(r->pool, r->method), | ||
2447 | 95 | - " is not allowed for the URL ", | ||
2448 | 96 | - ap_escape_html(r->pool, r->uri), | ||
2449 | 97 | - ".</p>\n", | ||
2450 | 98 | + " is not allowed for this URL.</p>\n", | ||
2451 | 99 | NULL)); | ||
2452 | 100 | case HTTP_NOT_ACCEPTABLE: | ||
2453 | 101 | - s1 = apr_pstrcat(p, | ||
2454 | 102 | - "<p>An appropriate representation of the " | ||
2455 | 103 | - "requested resource ", | ||
2456 | 104 | - ap_escape_html(r->pool, r->uri), | ||
2457 | 105 | - " could not be found on this server.</p>\n", | ||
2458 | 106 | - NULL); | ||
2459 | 107 | - return(add_optional_notes(r, s1, "variant-list", "")); | ||
2460 | 108 | + return(add_optional_notes(r, | ||
2461 | 109 | + "<p>An appropriate representation of the requested resource " | ||
2462 | 110 | + "could not be found on this server.</p>\n", | ||
2463 | 111 | + "variant-list", "")); | ||
2464 | 112 | case HTTP_MULTIPLE_CHOICES: | ||
2465 | 113 | return(add_optional_notes(r, "", "variant-list", "")); | ||
2466 | 114 | case HTTP_LENGTH_REQUIRED: | ||
2467 | 115 | @@ -1192,18 +1175,13 @@ static const char *get_canned_error_string(int status, | ||
2468 | 116 | NULL); | ||
2469 | 117 | return(add_optional_notes(r, s1, "error-notes", "</p>\n")); | ||
2470 | 118 | case HTTP_PRECONDITION_FAILED: | ||
2471 | 119 | - return(apr_pstrcat(p, | ||
2472 | 120 | - "<p>The precondition on the request " | ||
2473 | 121 | - "for the URL ", | ||
2474 | 122 | - ap_escape_html(r->pool, r->uri), | ||
2475 | 123 | - " evaluated to false.</p>\n", | ||
2476 | 124 | - NULL)); | ||
2477 | 125 | + return("<p>The precondition on the request " | ||
2478 | 126 | + "for this URL evaluated to false.</p>\n"); | ||
2479 | 127 | case HTTP_NOT_IMPLEMENTED: | ||
2480 | 128 | s1 = apr_pstrcat(p, | ||
2481 | 129 | "<p>", | ||
2482 | 130 | - ap_escape_html(r->pool, r->method), " to ", | ||
2483 | 131 | - ap_escape_html(r->pool, r->uri), | ||
2484 | 132 | - " not supported.<br />\n", | ||
2485 | 133 | + ap_escape_html(r->pool, r->method), " ", | ||
2486 | 134 | + " not supported for current URL.<br />\n", | ||
2487 | 135 | NULL); | ||
2488 | 136 | return(add_optional_notes(r, s1, "error-notes", "</p>\n")); | ||
2489 | 137 | case HTTP_BAD_GATEWAY: | ||
2490 | 138 | @@ -1211,29 +1189,19 @@ static const char *get_canned_error_string(int status, | ||
2491 | 139 | "response from an upstream server.<br />" CRLF; | ||
2492 | 140 | return(add_optional_notes(r, s1, "error-notes", "</p>\n")); | ||
2493 | 141 | case HTTP_VARIANT_ALSO_VARIES: | ||
2494 | 142 | - return(apr_pstrcat(p, | ||
2495 | 143 | - "<p>A variant for the requested " | ||
2496 | 144 | - "resource\n<pre>\n", | ||
2497 | 145 | - ap_escape_html(r->pool, r->uri), | ||
2498 | 146 | - "\n</pre>\nis itself a negotiable resource. " | ||
2499 | 147 | - "This indicates a configuration error.</p>\n", | ||
2500 | 148 | - NULL)); | ||
2501 | 149 | + return("<p>A variant for the requested " | ||
2502 | 150 | + "resource\n<pre>\n" | ||
2503 | 151 | + "\n</pre>\nis itself a negotiable resource. " | ||
2504 | 152 | + "This indicates a configuration error.</p>\n"); | ||
2505 | 153 | case HTTP_REQUEST_TIME_OUT: | ||
2506 | 154 | return("<p>Server timeout waiting for the HTTP request from the client.</p>\n"); | ||
2507 | 155 | case HTTP_GONE: | ||
2508 | 156 | - return(apr_pstrcat(p, | ||
2509 | 157 | - "<p>The requested resource<br />", | ||
2510 | 158 | - ap_escape_html(r->pool, r->uri), | ||
2511 | 159 | - "<br />\nis no longer available on this server " | ||
2512 | 160 | - "and there is no forwarding address.\n" | ||
2513 | 161 | - "Please remove all references to this " | ||
2514 | 162 | - "resource.</p>\n", | ||
2515 | 163 | - NULL)); | ||
2516 | 164 | + return("<p>The requested resource is no longer available on this server" | ||
2517 | 165 | + " and there is no forwarding address.\n" | ||
2518 | 166 | + "Please remove all references to this resource.</p>\n"); | ||
2519 | 167 | case HTTP_REQUEST_ENTITY_TOO_LARGE: | ||
2520 | 168 | return(apr_pstrcat(p, | ||
2521 | 169 | - "The requested resource<br />", | ||
2522 | 170 | - ap_escape_html(r->pool, r->uri), "<br />\n", | ||
2523 | 171 | - "does not allow request data with ", | ||
2524 | 172 | + "The requested resource does not allow request data with ", | ||
2525 | 173 | ap_escape_html(r->pool, r->method), | ||
2526 | 174 | " requests, or the amount of data provided in\n" | ||
2527 | 175 | "the request exceeds the capacity limit.\n", | ||
2528 | 176 | @@ -1317,11 +1285,9 @@ static const char *get_canned_error_string(int status, | ||
2529 | 177 | "the Server Name Indication (SNI) in use for this\n" | ||
2530 | 178 | "connection.</p>\n"); | ||
2531 | 179 | case HTTP_UNAVAILABLE_FOR_LEGAL_REASONS: | ||
2532 | 180 | - s1 = apr_pstrcat(p, | ||
2533 | 181 | - "<p>Access to ", ap_escape_html(r->pool, r->uri), | ||
2534 | 182 | - "\nhas been denied for legal reasons.<br />\n", | ||
2535 | 183 | - NULL); | ||
2536 | 184 | - return(add_optional_notes(r, s1, "error-notes", "</p>\n")); | ||
2537 | 185 | + return(add_optional_notes(r, | ||
2538 | 186 | + "<p>Access to this URL has been denied for legal reasons.<br />\n", | ||
2539 | 187 | + "error-notes", "</p>\n")); | ||
2540 | 188 | default: /* HTTP_INTERNAL_SERVER_ERROR */ | ||
2541 | 189 | /* | ||
2542 | 190 | * This comparison to expose error-notes could be modified to | ||
2543 | 191 | diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c | ||
2544 | 192 | index 91c2b4cdd4..5d9854b11d 100644 | ||
2545 | 193 | --- a/modules/proxy/mod_proxy.c | ||
2546 | 194 | +++ b/modules/proxy/mod_proxy.c | ||
2547 | 195 | @@ -1049,9 +1049,10 @@ static int proxy_handler(request_rec *r) | ||
2548 | 196 | char *end; | ||
2549 | 197 | maxfwd = apr_strtoi64(str, &end, 10); | ||
2550 | 198 | if (maxfwd < 0 || maxfwd == APR_INT64_MAX || *end) { | ||
2551 | 199 | - return ap_proxyerror(r, HTTP_BAD_REQUEST, | ||
2552 | 200 | - apr_psprintf(r->pool, | ||
2553 | 201 | - "Max-Forwards value '%s' could not be parsed", str)); | ||
2554 | 202 | + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO() | ||
2555 | 203 | + "Max-Forwards value '%s' could not be parsed", str); | ||
2556 | 204 | + return ap_proxyerror(r, HTTP_BAD_REQUEST, | ||
2557 | 205 | + "Max-Forwards request header could not be parsed"); | ||
2558 | 206 | } | ||
2559 | 207 | else if (maxfwd == 0) { | ||
2560 | 208 | switch (r->method_number) { | ||
2561 | 209 | diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c | ||
2562 | 210 | index 49acdcbc1c..86ce69b45c 100644 | ||
2563 | 211 | --- a/modules/proxy/mod_proxy_ftp.c | ||
2564 | 212 | +++ b/modules/proxy/mod_proxy_ftp.c | ||
2565 | 213 | @@ -1026,8 +1026,9 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, | ||
2566 | 214 | /* We break the URL into host, port, path-search */ | ||
2567 | 215 | if (r->parsed_uri.hostname == NULL) { | ||
2568 | 216 | if (APR_SUCCESS != apr_uri_parse(p, url, &uri)) { | ||
2569 | 217 | - return ap_proxyerror(r, HTTP_BAD_REQUEST, | ||
2570 | 218 | - apr_psprintf(p, "URI cannot be parsed: %s", url)); | ||
2571 | 219 | + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO() | ||
2572 | 220 | + "URI cannot be parsed: %s", url); | ||
2573 | 221 | + return ap_proxyerror(r, HTTP_BAD_REQUEST, "URI cannot be parsed"); | ||
2574 | 222 | } | ||
2575 | 223 | connectname = uri.hostname; | ||
2576 | 224 | connectport = uri.port; | ||
2577 | 225 | diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c | ||
2578 | 226 | index 0315668296..5482ab8a48 100644 | ||
2579 | 227 | --- a/modules/proxy/proxy_util.c | ||
2580 | 228 | +++ b/modules/proxy/proxy_util.c | ||
2581 | 229 | @@ -368,12 +368,9 @@ PROXY_DECLARE(char *) | ||
2582 | 230 | |||
2583 | 231 | PROXY_DECLARE(int) ap_proxyerror(request_rec *r, int statuscode, const char *message) | ||
2584 | 232 | { | ||
2585 | 233 | - const char *uri = ap_escape_html(r->pool, r->uri); | ||
2586 | 234 | apr_table_setn(r->notes, "error-notes", | ||
2587 | 235 | apr_pstrcat(r->pool, | ||
2588 | 236 | - "The proxy server could not handle the request <em><a href=\"", | ||
2589 | 237 | - uri, "\">", ap_escape_html(r->pool, r->method), " ", uri, | ||
2590 | 238 | - "</a></em>.<p>\n" | ||
2591 | 239 | + "The proxy server could not handle the request<p>" | ||
2592 | 240 | "Reason: <strong>", ap_escape_html(r->pool, message), | ||
2593 | 241 | "</strong></p>", | ||
2594 | 242 | NULL)); | ||
2595 | 243 | -- | ||
2596 | 244 | 2.17.1 | ||
2597 | 245 | |||
2598 | diff --git a/debian/patches/CVE-2019-10092-2.patch b/debian/patches/CVE-2019-10092-2.patch | |||
2599 | 0 | new file mode 100644 | 246 | new file mode 100644 |
2600 | index 0000000..2eec9fb | |||
2601 | --- /dev/null | |||
2602 | +++ b/debian/patches/CVE-2019-10092-2.patch | |||
2603 | @@ -0,0 +1,45 @@ | |||
2604 | 1 | From 7106a941f8086e06d4c1b26a8dd6d2a4695eee5a Mon Sep 17 00:00:00 2001 | ||
2605 | 2 | From: Eric Covener <covener@apache.org> | ||
2606 | 3 | Date: Thu, 8 Aug 2019 13:09:10 +0000 | ||
2607 | 4 | Subject: [PATCH] Merge r1864699 from trunk: | ||
2608 | 5 | |||
2609 | 6 | lognos | ||
2610 | 7 | |||
2611 | 8 | |||
2612 | 9 | |||
2613 | 10 | |||
2614 | 11 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1864702 13f79535-47bb-0310-9956-ffa450edef68 | ||
2615 | 12 | --- | ||
2616 | 13 | modules/proxy/mod_proxy.c | 2 +- | ||
2617 | 14 | modules/proxy/mod_proxy_ftp.c | 2 +- | ||
2618 | 15 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
2619 | 16 | |||
2620 | 17 | diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c | ||
2621 | 18 | index 5d9854b11d..8661a2dbaa 100644 | ||
2622 | 19 | --- a/modules/proxy/mod_proxy.c | ||
2623 | 20 | +++ b/modules/proxy/mod_proxy.c | ||
2624 | 21 | @@ -1049,7 +1049,7 @@ static int proxy_handler(request_rec *r) | ||
2625 | 22 | char *end; | ||
2626 | 23 | maxfwd = apr_strtoi64(str, &end, 10); | ||
2627 | 24 | if (maxfwd < 0 || maxfwd == APR_INT64_MAX || *end) { | ||
2628 | 25 | - ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO() | ||
2629 | 26 | + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(10188) | ||
2630 | 27 | "Max-Forwards value '%s' could not be parsed", str); | ||
2631 | 28 | return ap_proxyerror(r, HTTP_BAD_REQUEST, | ||
2632 | 29 | "Max-Forwards request header could not be parsed"); | ||
2633 | 30 | diff --git a/modules/proxy/mod_proxy_ftp.c b/modules/proxy/mod_proxy_ftp.c | ||
2634 | 31 | index 86ce69b45c..7ad803b97c 100644 | ||
2635 | 32 | --- a/modules/proxy/mod_proxy_ftp.c | ||
2636 | 33 | +++ b/modules/proxy/mod_proxy_ftp.c | ||
2637 | 34 | @@ -1026,7 +1026,7 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker, | ||
2638 | 35 | /* We break the URL into host, port, path-search */ | ||
2639 | 36 | if (r->parsed_uri.hostname == NULL) { | ||
2640 | 37 | if (APR_SUCCESS != apr_uri_parse(p, url, &uri)) { | ||
2641 | 38 | - ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO() | ||
2642 | 39 | + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(10189) | ||
2643 | 40 | "URI cannot be parsed: %s", url); | ||
2644 | 41 | return ap_proxyerror(r, HTTP_BAD_REQUEST, "URI cannot be parsed"); | ||
2645 | 42 | } | ||
2646 | 43 | -- | ||
2647 | 44 | 2.17.1 | ||
2648 | 45 | |||
2649 | diff --git a/debian/patches/CVE-2019-10098.patch b/debian/patches/CVE-2019-10098.patch | |||
2650 | 0 | new file mode 100644 | 46 | new file mode 100644 |
2651 | index 0000000..0ad57ba | |||
2652 | --- /dev/null | |||
2653 | +++ b/debian/patches/CVE-2019-10098.patch | |||
2654 | @@ -0,0 +1,159 @@ | |||
2655 | 1 | From 3b3117e96bc9c2afaeb5b98e9b60315006679a6d Mon Sep 17 00:00:00 2001 | ||
2656 | 2 | From: Stefan Eissing <icing@apache.org> | ||
2657 | 3 | Date: Fri, 2 Aug 2019 09:24:58 +0000 | ||
2658 | 4 | Subject: [PATCH] Merge of r1864192 from trunk: | ||
2659 | 5 | |||
2660 | 6 | *) core, rewrite: Set PCRE_DOTALL by default | ||
2661 | 7 | |||
2662 | 8 | |||
2663 | 9 | |||
2664 | 10 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1864213 13f79535-47bb-0310-9956-ffa450edef68 | ||
2665 | 11 | --- | ||
2666 | 12 | CHANGES | 3 +++ | ||
2667 | 13 | STATUS | 5 ----- | ||
2668 | 14 | docs/manual/mod/core.xml | 20 +++++++++++--------- | ||
2669 | 15 | server/util_pcre.c | 3 ++- | ||
2670 | 16 | 4 files changed, 16 insertions(+), 15 deletions(-) | ||
2671 | 17 | |||
2672 | 18 | # diff --git a/CHANGES b/CHANGES | ||
2673 | 19 | # index bf00b5114b..ad4fd27625 100644 | ||
2674 | 20 | # --- a/CHANGES | ||
2675 | 21 | # +++ b/CHANGES | ||
2676 | 22 | # @@ -1,6 +1,9 @@ | ||
2677 | 23 | # -*- coding: utf-8 -*- | ||
2678 | 24 | # Changes with Apache 2.4.40 | ||
2679 | 25 | # | ||
2680 | 26 | # + *) core, mod_rewrite: Set PCRE_DOTALL by default. Revert via | ||
2681 | 27 | # + RegexDefaultOptions -DOTALL [Yann Ylavic] | ||
2682 | 28 | # + | ||
2683 | 29 | # *) core: Remove request details from built-in error documents [Eric Covener] | ||
2684 | 30 | # | ||
2685 | 31 | # *) mod_http2: core setting "LimitRequestFieldSize" is not additionally checked on | ||
2686 | 32 | # diff --git a/STATUS b/STATUS | ||
2687 | 33 | # index 3c3cf39f48..f9bfc678fd 100644 | ||
2688 | 34 | # --- a/STATUS | ||
2689 | 35 | # +++ b/STATUS | ||
2690 | 36 | # @@ -127,11 +127,6 @@ RELEASE SHOWSTOPPERS: | ||
2691 | 37 | # PATCHES ACCEPTED TO BACKPORT FROM TRUNK: | ||
2692 | 38 | # [ start all new proposals below, under PATCHES PROPOSED. ] | ||
2693 | 39 | # | ||
2694 | 40 | # - *) core, rewrite: Set PCRE_DOTALL by default | ||
2695 | 41 | # - trunk: http://svn.apache.org/1864192 | ||
2696 | 42 | # - 2.4.x: svn merge -c 1864192 ^/httpd/httpd/trunk . | ||
2697 | 43 | # - +1: covener, rpluem, icing | ||
2698 | 44 | # - | ||
2699 | 45 | # | ||
2700 | 46 | # PATCHES PROPOSED TO BACKPORT FROM TRUNK: | ||
2701 | 47 | # [ New proposals should be added at the end of the list ] | ||
2702 | 48 | # diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml | ||
2703 | 49 | # index d9f0895af4..d4d6030dc5 100644 | ||
2704 | 50 | # --- a/docs/manual/mod/core.xml | ||
2705 | 51 | # +++ b/docs/manual/mod/core.xml | ||
2706 | 52 | # @@ -4061,7 +4061,7 @@ Protocols h2 http/1.1 | ||
2707 | 53 | # <name>RegexDefaultOptions</name> | ||
2708 | 54 | # <description>Allow to configure global/default options for regexes</description> | ||
2709 | 55 | # <syntax>RegexDefaultOptions [none] [+|-]<var>option</var> [[+|-]<var>option</var>] ...</syntax> | ||
2710 | 56 | # - <default>RegexDefaultOptions DOLLAR_ENDONLY</default> | ||
2711 | 57 | # + <default>RegexDefaultOptions DOTALL DOLLAR_ENDONLY</default> | ||
2712 | 58 | # <contextlist><context>server config</context></contextlist> | ||
2713 | 59 | # <compatibility>Only available from Apache 2.4.30 and later.</compatibility> | ||
2714 | 60 | # | ||
2715 | 61 | # @@ -4080,24 +4080,26 @@ Protocols h2 http/1.1 | ||
2716 | 62 | # <dt><code>ICASE</code></dt> | ||
2717 | 63 | # <dd>Use a case-insensitive match.</dd> | ||
2718 | 64 | # | ||
2719 | 65 | # + <dt><code>EXTENDED</code></dt> | ||
2720 | 66 | # + <dd>Perl's /x flag, ignore (unescaped-)spaces and comments in the pattern.</dd> | ||
2721 | 67 | # + | ||
2722 | 68 | # <dt><code>DOTALL</code></dt> | ||
2723 | 69 | # - <dd>Perl's /s flag.</dd> | ||
2724 | 70 | # + <dd>Perl's /s flag, '.' matches newline characters.</dd> | ||
2725 | 71 | # | ||
2726 | 72 | # <dt><code>DOLLAR_ENDONLY</code></dt> | ||
2727 | 73 | # <dd>'$' matches at end of subject string only.</dd> | ||
2728 | 74 | # - <dd>.</dd> | ||
2729 | 75 | # </dl> | ||
2730 | 76 | # <highlight language="config"> | ||
2731 | 77 | # -# | ||
2732 | 78 | # -RegexDefaultOptions +ICASE +DOLLAR_ENDONLY | ||
2733 | 79 | # +# Add the ICASE option for all regexes by default | ||
2734 | 80 | # +RegexDefaultOptions +ICASE | ||
2735 | 81 | # ... | ||
2736 | 82 | # -# Remove the ICASE option, but keep all the other already set options | ||
2737 | 83 | # -RegexDefaultOptions -ICASE | ||
2738 | 84 | # +# Remove the default DOLLAR_ENDONLY option, but keep any other one | ||
2739 | 85 | # +RegexDefaultOptions -DOLLAR_ENDONLY | ||
2740 | 86 | # ... | ||
2741 | 87 | # -# Set the default option to DOTALL, resetting any other option | ||
2742 | 88 | # +# Set the DOTALL option only, resetting any other one | ||
2743 | 89 | # RegexDefaultOptions DOTALL | ||
2744 | 90 | # ... | ||
2745 | 91 | # -# Reset all defined option | ||
2746 | 92 | # +# Reset all defined options | ||
2747 | 93 | # RegexDefaultOptions none | ||
2748 | 94 | # ... | ||
2749 | 95 | # </highlight> | ||
2750 | 96 | # diff --git a/docs/manual/mod/core.html.en b/docs/manual/mod/core.html.en | ||
2751 | 97 | # index 1cc985eb65..4c0b2fd744 100644 | ||
2752 | 98 | # --- a/docs/manual/mod/core.html.en | ||
2753 | 99 | # +++ b/docs/manual/mod/core.html.en | ||
2754 | 100 | # @@ -4069,7 +4069,7 @@ as if 'QualifyRedirectURL ON' was configured.</td></tr> | ||
2755 | 101 | # <table class="directive"> | ||
2756 | 102 | # <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Allow to configure global/default options for regexes</td></tr> | ||
2757 | 103 | # <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RegexDefaultOptions [none] [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr> | ||
2758 | 104 | # -<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>RegexDefaultOptions DOLLAR_ENDONLY</code></td></tr> | ||
2759 | 105 | # +<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>RegexDefaultOptions DOTALL DOLLAR_ENDONLY</code></td></tr> | ||
2760 | 106 | # <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr> | ||
2761 | 107 | # <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr> | ||
2762 | 108 | # <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr> | ||
2763 | 109 | # @@ -4089,23 +4089,25 @@ as if 'QualifyRedirectURL ON' was configured.</td></tr> | ||
2764 | 110 | # <dt><code>ICASE</code></dt> | ||
2765 | 111 | # <dd>Use a case-insensitive match.</dd> | ||
2766 | 112 | # | ||
2767 | 113 | # + <dt><code>EXTENDED</code></dt> | ||
2768 | 114 | # + <dd>Perl's /x flag, ignore (unescaped-)spaces and comments in the pattern.</dd> | ||
2769 | 115 | # + | ||
2770 | 116 | # <dt><code>DOTALL</code></dt> | ||
2771 | 117 | # - <dd>Perl's /s flag.</dd> | ||
2772 | 118 | # + <dd>Perl's /s flag, '.' matches newline characters.</dd> | ||
2773 | 119 | # | ||
2774 | 120 | # <dt><code>DOLLAR_ENDONLY</code></dt> | ||
2775 | 121 | # <dd>'$' matches at end of subject string only.</dd> | ||
2776 | 122 | # - <dd>.</dd> | ||
2777 | 123 | # </dl> | ||
2778 | 124 | # - <pre class="prettyprint lang-config"># | ||
2779 | 125 | # -RegexDefaultOptions +ICASE +DOLLAR_ENDONLY | ||
2780 | 126 | # + <pre class="prettyprint lang-config"># Add the ICASE option for all regexes by default | ||
2781 | 127 | # +RegexDefaultOptions +ICASE | ||
2782 | 128 | # ... | ||
2783 | 129 | # -# Remove the ICASE option, but keep all the other already set options | ||
2784 | 130 | # -RegexDefaultOptions -ICASE | ||
2785 | 131 | # +# Remove the default DOLLAR_ENDONLY option, but keep any other one | ||
2786 | 132 | # +RegexDefaultOptions -DOLLAR_ENDONLY | ||
2787 | 133 | # ... | ||
2788 | 134 | # -# Set the default option to DOTALL, resetting any other option | ||
2789 | 135 | # +# Set the DOTALL option only, resetting any other one | ||
2790 | 136 | # RegexDefaultOptions DOTALL | ||
2791 | 137 | # ... | ||
2792 | 138 | # -# Reset all defined option | ||
2793 | 139 | # +# Reset all defined options | ||
2794 | 140 | # RegexDefaultOptions none | ||
2795 | 141 | # ...</pre> | ||
2796 | 142 | # | ||
2797 | 143 | diff --git a/server/util_pcre.c b/server/util_pcre.c | ||
2798 | 144 | index f2cb1bb01e..35831f500f 100644 | ||
2799 | 145 | --- a/server/util_pcre.c | ||
2800 | 146 | +++ b/server/util_pcre.c | ||
2801 | 147 | @@ -120,7 +120,8 @@ AP_DECLARE(void) ap_regfree(ap_regex_t *preg) | ||
2802 | 148 | * Compile a regular expression * | ||
2803 | 149 | *************************************************/ | ||
2804 | 150 | |||
2805 | 151 | -static int default_cflags = AP_REG_DOLLAR_ENDONLY; | ||
2806 | 152 | +static int default_cflags = AP_REG_DOTALL | | ||
2807 | 153 | + AP_REG_DOLLAR_ENDONLY; | ||
2808 | 154 | |||
2809 | 155 | AP_DECLARE(int) ap_regcomp_get_default_cflags(void) | ||
2810 | 156 | { | ||
2811 | 157 | -- | ||
2812 | 158 | 2.17.1 | ||
2813 | 159 | |||
2814 | diff --git a/debian/patches/CVE-2020-11993-pre1.patch b/debian/patches/CVE-2020-11993-pre1.patch | |||
2815 | 0 | new file mode 100644 | 160 | new file mode 100644 |
2816 | index 0000000..25d6669 | |||
2817 | --- /dev/null | |||
2818 | +++ b/debian/patches/CVE-2020-11993-pre1.patch | |||
2819 | @@ -0,0 +1,406 @@ | |||
2820 | 1 | Backport of: | ||
2821 | 2 | |||
2822 | 3 | From 3060a9dd4d160af2e82829ce801a3a89127e36a1 Mon Sep 17 00:00:00 2001 | ||
2823 | 4 | From: Jim Jagielski <jim@apache.org> | ||
2824 | 5 | Date: Thu, 30 Jan 2020 15:14:40 +0000 | ||
2825 | 6 | Subject: [PATCH] Merge r1871810 from trunk: | ||
2826 | 7 | |||
2827 | 8 | *) mod_http2: Fixed rare cases where a h2 worker could deadlock the main connection. | ||
2828 | 9 | |||
2829 | 10 | |||
2830 | 11 | Submitted by: icing | ||
2831 | 12 | Reviewed by: icing, jim, steffenal | ||
2832 | 13 | |||
2833 | 14 | |||
2834 | 15 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1873368 13f79535-47bb-0310-9956-ffa450edef68 | ||
2835 | 16 | --- | ||
2836 | 17 | CHANGES | 3 ++ | ||
2837 | 18 | STATUS | 4 -- | ||
2838 | 19 | modules/http2/h2_mplx.c | 54 ++++++++++++-------- | ||
2839 | 20 | modules/http2/h2_session.c | 2 +- | ||
2840 | 21 | modules/http2/h2_util.c | 89 ++++++++++----------------------- | ||
2841 | 22 | modules/http2/h2_util.h | 2 - | ||
2842 | 23 | modules/http2/h2_version.h | 4 +- | ||
2843 | 24 | modules/http2/h2_workers.c | 1 - | ||
2844 | 25 | modules/http2/mod_proxy_http2.c | 8 +++ | ||
2845 | 26 | 9 files changed, 72 insertions(+), 95 deletions(-) | ||
2846 | 27 | |||
2847 | 28 | #diff --git a/CHANGES b/CHANGES | ||
2848 | 29 | #index ded0ecce34c..e12ef389501 100644 | ||
2849 | 30 | #--- a/CHANGES | ||
2850 | 31 | #+++ b/CHANGES | ||
2851 | 32 | #@@ -5,6 +5,9 @@ Changes with Apache 2.4.42 | ||
2852 | 33 | # r:notes_table, r:subprocess_env_table as read-only native table alternatives | ||
2853 | 34 | # that can be iterated over. [Eric Covener] | ||
2854 | 35 | # | ||
2855 | 36 | #+ *) mod_http2: Fixed rare cases where a h2 worker could deadlock the main connection. | ||
2856 | 37 | #+ [Yann Ylavic, Stefan Eissing] | ||
2857 | 38 | #+ | ||
2858 | 39 | # *) mod_lua: Accept nil assignments to the exposed tables (r.subprocess_env, | ||
2859 | 40 | # r.headers_out, etc) to remove the key from the table. PR63971. | ||
2860 | 41 | # [Eric Covener] | ||
2861 | 42 | #diff --git a/STATUS b/STATUS | ||
2862 | 43 | #index 991ed406b23..a610953ed89 100644 | ||
2863 | 44 | #--- a/STATUS | ||
2864 | 45 | #+++ b/STATUS | ||
2865 | 46 | #@@ -132,10 +132,6 @@ RELEASE SHOWSTOPPERS: | ||
2866 | 47 | # PATCHES ACCEPTED TO BACKPORT FROM TRUNK: | ||
2867 | 48 | # [ start all new proposals below, under PATCHES PROPOSED. ] | ||
2868 | 49 | # | ||
2869 | 50 | #- *) mod_http2: Fixed rare cases where a h2 worker could deadlock the main connection. | ||
2870 | 51 | #- trunk patch: http://svn.apache.org/r1871810 | ||
2871 | 52 | #- 2.4.x patch: svn merge -c 1871810 ^/httpd/httpd/trunk | ||
2872 | 53 | #- +1: icing, jim, steffenal(tested with 1.15.5-git) | ||
2873 | 54 | # | ||
2874 | 55 | # PATCHES PROPOSED TO BACKPORT FROM TRUNK: | ||
2875 | 56 | # [ New proposals should be added at the end of the list ] | ||
2876 | 57 | --- a/modules/http2/h2_mplx.c | ||
2877 | 58 | +++ b/modules/http2/h2_mplx.c | ||
2878 | 59 | @@ -75,13 +75,13 @@ apr_status_t h2_mplx_child_init(apr_pool | ||
2879 | 60 | #define H2_MPLX_ENTER_ALWAYS(m) \ | ||
2880 | 61 | apr_thread_mutex_lock(m->lock) | ||
2881 | 62 | |||
2882 | 63 | -#define H2_MPLX_ENTER_MAYBE(m, lock) \ | ||
2883 | 64 | - if (lock) apr_thread_mutex_lock(m->lock) | ||
2884 | 65 | +#define H2_MPLX_ENTER_MAYBE(m, dolock) \ | ||
2885 | 66 | + if (dolock) apr_thread_mutex_lock(m->lock) | ||
2886 | 67 | |||
2887 | 68 | -#define H2_MPLX_LEAVE_MAYBE(m, lock) \ | ||
2888 | 69 | - if (lock) apr_thread_mutex_unlock(m->lock) | ||
2889 | 70 | +#define H2_MPLX_LEAVE_MAYBE(m, dolock) \ | ||
2890 | 71 | + if (dolock) apr_thread_mutex_unlock(m->lock) | ||
2891 | 72 | |||
2892 | 73 | -static void check_data_for(h2_mplx *m, h2_stream *stream, int lock); | ||
2893 | 74 | +static void check_data_for(h2_mplx *m, h2_stream *stream, int mplx_is_locked); | ||
2894 | 75 | |||
2895 | 76 | static void stream_output_consumed(void *ctx, | ||
2896 | 77 | h2_bucket_beam *beam, apr_off_t length) | ||
2897 | 78 | @@ -104,6 +104,7 @@ static void stream_joined(h2_mplx *m, h2 | ||
2898 | 79 | { | ||
2899 | 80 | ap_assert(!h2_task_has_started(stream->task) || stream->task->worker_done); | ||
2900 | 81 | |||
2901 | 82 | + h2_ififo_remove(m->readyq, stream->id); | ||
2902 | 83 | h2_ihash_remove(m->shold, stream->id); | ||
2903 | 84 | h2_ihash_add(m->spurge, stream); | ||
2904 | 85 | } | ||
2905 | 86 | @@ -125,14 +126,16 @@ static void stream_cleanup(h2_mplx *m, h | ||
2906 | 87 | |||
2907 | 88 | h2_ihash_remove(m->streams, stream->id); | ||
2908 | 89 | h2_iq_remove(m->q, stream->id); | ||
2909 | 90 | - h2_ififo_remove(m->readyq, stream->id); | ||
2910 | 91 | - h2_ihash_add(m->shold, stream); | ||
2911 | 92 | |||
2912 | 93 | if (!h2_task_has_started(stream->task) || stream->task->done_done) { | ||
2913 | 94 | stream_joined(m, stream); | ||
2914 | 95 | } | ||
2915 | 96 | - else if (stream->task) { | ||
2916 | 97 | - stream->task->c->aborted = 1; | ||
2917 | 98 | + else { | ||
2918 | 99 | + h2_ififo_remove(m->readyq, stream->id); | ||
2919 | 100 | + h2_ihash_add(m->shold, stream); | ||
2920 | 101 | + if (stream->task) { | ||
2921 | 102 | + stream->task->c->aborted = 1; | ||
2922 | 103 | + } | ||
2923 | 104 | } | ||
2924 | 105 | } | ||
2925 | 106 | |||
2926 | 107 | @@ -509,12 +512,11 @@ static void output_produced(void *ctx, h | ||
2927 | 108 | h2_stream *stream = ctx; | ||
2928 | 109 | h2_mplx *m = stream->session->mplx; | ||
2929 | 110 | |||
2930 | 111 | - check_data_for(m, stream, 1); | ||
2931 | 112 | + check_data_for(m, stream, 0); | ||
2932 | 113 | } | ||
2933 | 114 | |||
2934 | 115 | static apr_status_t out_open(h2_mplx *m, int stream_id, h2_bucket_beam *beam) | ||
2935 | 116 | { | ||
2936 | 117 | - apr_status_t status = APR_SUCCESS; | ||
2937 | 118 | h2_stream *stream = h2_ihash_get(m->streams, stream_id); | ||
2938 | 119 | |||
2939 | 120 | if (!stream || !stream->task || m->aborted) { | ||
2940 | 121 | @@ -528,7 +530,7 @@ static apr_status_t out_open(h2_mplx *m, | ||
2941 | 122 | h2_beam_log(beam, m->c, APLOG_TRACE2, "out_open"); | ||
2942 | 123 | } | ||
2943 | 124 | else { | ||
2944 | 125 | - ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, m->c, | ||
2945 | 126 | + ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, | ||
2946 | 127 | "h2_mplx(%s): out open", stream->task->id); | ||
2947 | 128 | } | ||
2948 | 129 | |||
2949 | 130 | @@ -540,8 +542,8 @@ static apr_status_t out_open(h2_mplx *m, | ||
2950 | 131 | |||
2951 | 132 | /* we might see some file buckets in the output, see | ||
2952 | 133 | * if we have enough handles reserved. */ | ||
2953 | 134 | - check_data_for(m, stream, 0); | ||
2954 | 135 | - return status; | ||
2955 | 136 | + check_data_for(m, stream, 1); | ||
2956 | 137 | + return APR_SUCCESS; | ||
2957 | 138 | } | ||
2958 | 139 | |||
2959 | 140 | apr_status_t h2_mplx_out_open(h2_mplx *m, int stream_id, h2_bucket_beam *beam) | ||
2960 | 141 | @@ -583,7 +585,7 @@ static apr_status_t out_close(h2_mplx *m | ||
2961 | 142 | status = h2_beam_close(task->output.beam); | ||
2962 | 143 | h2_beam_log(task->output.beam, m->c, APLOG_TRACE2, "out_close"); | ||
2963 | 144 | output_consumed_signal(m, task); | ||
2964 | 145 | - check_data_for(m, stream, 0); | ||
2965 | 146 | + check_data_for(m, stream, 1); | ||
2966 | 147 | return status; | ||
2967 | 148 | } | ||
2968 | 149 | |||
2969 | 150 | @@ -617,15 +619,23 @@ apr_status_t h2_mplx_out_trywait(h2_mplx | ||
2970 | 151 | return status; | ||
2971 | 152 | } | ||
2972 | 153 | |||
2973 | 154 | -static void check_data_for(h2_mplx *m, h2_stream *stream, int lock) | ||
2974 | 155 | +static void check_data_for(h2_mplx *m, h2_stream *stream, int mplx_is_locked) | ||
2975 | 156 | { | ||
2976 | 157 | + /* If m->lock is already held, we must release during h2_ififo_push() | ||
2977 | 158 | + * which can wait on its not_full condition, causing a deadlock because | ||
2978 | 159 | + * no one would then be able to acquire m->lock to empty the fifo. | ||
2979 | 160 | + */ | ||
2980 | 161 | + H2_MPLX_LEAVE_MAYBE(m, mplx_is_locked); | ||
2981 | 162 | if (h2_ififo_push(m->readyq, stream->id) == APR_SUCCESS) { | ||
2982 | 163 | + H2_MPLX_ENTER_ALWAYS(m); | ||
2983 | 164 | apr_atomic_set32(&m->event_pending, 1); | ||
2984 | 165 | - H2_MPLX_ENTER_MAYBE(m, lock); | ||
2985 | 166 | if (m->added_output) { | ||
2986 | 167 | apr_thread_cond_signal(m->added_output); | ||
2987 | 168 | } | ||
2988 | 169 | - H2_MPLX_LEAVE_MAYBE(m, lock); | ||
2989 | 170 | + H2_MPLX_LEAVE_MAYBE(m, !mplx_is_locked); | ||
2990 | 171 | + } | ||
2991 | 172 | + else { | ||
2992 | 173 | + H2_MPLX_ENTER_MAYBE(m, mplx_is_locked); | ||
2993 | 174 | } | ||
2994 | 175 | } | ||
2995 | 176 | |||
2996 | 177 | @@ -678,7 +688,7 @@ apr_status_t h2_mplx_process(h2_mplx *m, | ||
2997 | 178 | h2_ihash_add(m->streams, stream); | ||
2998 | 179 | if (h2_stream_is_ready(stream)) { | ||
2999 | 180 | /* already have a response */ | ||
3000 | 181 | - check_data_for(m, stream, 0); | ||
3001 | 182 | + check_data_for(m, stream, 1); | ||
3002 | 183 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, | ||
3003 | 184 | H2_STRM_MSG(stream, "process, add to readyq")); | ||
3004 | 185 | } | ||
3005 | 186 | @@ -809,7 +819,7 @@ static void task_done(h2_mplx *m, h2_tas | ||
3006 | 187 | } | ||
3007 | 188 | |||
3008 | 189 | /* more data will not arrive, resume the stream */ | ||
3009 | 190 | - check_data_for(m, stream, 0); | ||
3010 | 191 | + check_data_for(m, stream, 1); | ||
3011 | 192 | } | ||
3012 | 193 | } | ||
3013 | 194 | else if ((stream = h2_ihash_get(m->shold, task->stream_id)) != NULL) { | ||
3014 | 195 | @@ -1062,7 +1072,7 @@ apr_status_t h2_mplx_idle(h2_mplx *m) | ||
3015 | 196 | h2_beam_is_closed(stream->output), | ||
3016 | 197 | (long)h2_beam_get_buffered(stream->output)); | ||
3017 | 198 | h2_ihash_add(m->streams, stream); | ||
3018 | 199 | - check_data_for(m, stream, 0); | ||
3019 | 200 | + check_data_for(m, stream, 1); | ||
3020 | 201 | stream->out_checked = 1; | ||
3021 | 202 | status = APR_EAGAIN; | ||
3022 | 203 | } | ||
3023 | 204 | @@ -1114,7 +1124,7 @@ apr_status_t h2_mplx_dispatch_master_eve | ||
3024 | 205 | |||
3025 | 206 | apr_status_t h2_mplx_keep_active(h2_mplx *m, h2_stream *stream) | ||
3026 | 207 | { | ||
3027 | 208 | - check_data_for(m, stream, 1); | ||
3028 | 209 | + check_data_for(m, stream, 0); | ||
3029 | 210 | return APR_SUCCESS; | ||
3030 | 211 | } | ||
3031 | 212 | |||
3032 | 213 | --- a/modules/http2/h2_session.c | ||
3033 | 214 | +++ b/modules/http2/h2_session.c | ||
3034 | 215 | @@ -2141,7 +2141,7 @@ apr_status_t h2_session_process(h2_sessi | ||
3035 | 216 | break; | ||
3036 | 217 | |||
3037 | 218 | case H2_SESSION_ST_IDLE: | ||
3038 | 219 | - if (session->idle_until && (apr_time_now() + session->idle_delay) > session->idle_until) { | ||
3039 | 220 | + if (session->idle_until && (now + session->idle_delay) > session->idle_until) { | ||
3040 | 221 | ap_log_cerror( APLOG_MARK, APLOG_TRACE1, status, c, | ||
3041 | 222 | H2_SSSN_MSG(session, "idle, timeout reached, closing")); | ||
3042 | 223 | if (session->idle_delay) { | ||
3043 | 224 | --- a/modules/http2/h2_util.c | ||
3044 | 225 | +++ b/modules/http2/h2_util.c | ||
3045 | 226 | @@ -638,15 +638,6 @@ apr_status_t h2_fifo_term(h2_fifo *fifo) | ||
3046 | 227 | apr_status_t rv; | ||
3047 | 228 | if ((rv = apr_thread_mutex_lock(fifo->lock)) == APR_SUCCESS) { | ||
3048 | 229 | fifo->aborted = 1; | ||
3049 | 230 | - apr_thread_mutex_unlock(fifo->lock); | ||
3050 | 231 | - } | ||
3051 | 232 | - return rv; | ||
3052 | 233 | -} | ||
3053 | 234 | - | ||
3054 | 235 | -apr_status_t h2_fifo_interrupt(h2_fifo *fifo) | ||
3055 | 236 | -{ | ||
3056 | 237 | - apr_status_t rv; | ||
3057 | 238 | - if ((rv = apr_thread_mutex_lock(fifo->lock)) == APR_SUCCESS) { | ||
3058 | 239 | apr_thread_cond_broadcast(fifo->not_empty); | ||
3059 | 240 | apr_thread_cond_broadcast(fifo->not_full); | ||
3060 | 241 | apr_thread_mutex_unlock(fifo->lock); | ||
3061 | 242 | @@ -710,10 +701,6 @@ static apr_status_t fifo_push(h2_fifo *f | ||
3062 | 243 | { | ||
3063 | 244 | apr_status_t rv; | ||
3064 | 245 | |||
3065 | 246 | - if (fifo->aborted) { | ||
3066 | 247 | - return APR_EOF; | ||
3067 | 248 | - } | ||
3068 | 249 | - | ||
3069 | 250 | if ((rv = apr_thread_mutex_lock(fifo->lock)) == APR_SUCCESS) { | ||
3070 | 251 | rv = fifo_push_int(fifo, elem, block); | ||
3071 | 252 | apr_thread_mutex_unlock(fifo->lock); | ||
3072 | 253 | @@ -754,10 +741,6 @@ static apr_status_t fifo_pull(h2_fifo *f | ||
3073 | 254 | { | ||
3074 | 255 | apr_status_t rv; | ||
3075 | 256 | |||
3076 | 257 | - if (fifo->aborted) { | ||
3077 | 258 | - return APR_EOF; | ||
3078 | 259 | - } | ||
3079 | 260 | - | ||
3080 | 261 | if ((rv = apr_thread_mutex_lock(fifo->lock)) == APR_SUCCESS) { | ||
3081 | 262 | rv = pull_head(fifo, pelem, block); | ||
3082 | 263 | apr_thread_mutex_unlock(fifo->lock); | ||
3083 | 264 | @@ -946,15 +929,6 @@ apr_status_t h2_ififo_term(h2_ififo *fif | ||
3084 | 265 | apr_status_t rv; | ||
3085 | 266 | if ((rv = apr_thread_mutex_lock(fifo->lock)) == APR_SUCCESS) { | ||
3086 | 267 | fifo->aborted = 1; | ||
3087 | 268 | - apr_thread_mutex_unlock(fifo->lock); | ||
3088 | 269 | - } | ||
3089 | 270 | - return rv; | ||
3090 | 271 | -} | ||
3091 | 272 | - | ||
3092 | 273 | -apr_status_t h2_ififo_interrupt(h2_ififo *fifo) | ||
3093 | 274 | -{ | ||
3094 | 275 | - apr_status_t rv; | ||
3095 | 276 | - if ((rv = apr_thread_mutex_lock(fifo->lock)) == APR_SUCCESS) { | ||
3096 | 277 | apr_thread_cond_broadcast(fifo->not_empty); | ||
3097 | 278 | apr_thread_cond_broadcast(fifo->not_full); | ||
3098 | 279 | apr_thread_mutex_unlock(fifo->lock); | ||
3099 | 280 | @@ -1018,10 +992,6 @@ static apr_status_t ififo_push(h2_ififo | ||
3100 | 281 | { | ||
3101 | 282 | apr_status_t rv; | ||
3102 | 283 | |||
3103 | 284 | - if (fifo->aborted) { | ||
3104 | 285 | - return APR_EOF; | ||
3105 | 286 | - } | ||
3106 | 287 | - | ||
3107 | 288 | if ((rv = apr_thread_mutex_lock(fifo->lock)) == APR_SUCCESS) { | ||
3108 | 289 | rv = ififo_push_int(fifo, id, block); | ||
3109 | 290 | apr_thread_mutex_unlock(fifo->lock); | ||
3110 | 291 | @@ -1062,10 +1032,6 @@ static apr_status_t ififo_pull(h2_ififo | ||
3111 | 292 | { | ||
3112 | 293 | apr_status_t rv; | ||
3113 | 294 | |||
3114 | 295 | - if (fifo->aborted) { | ||
3115 | 296 | - return APR_EOF; | ||
3116 | 297 | - } | ||
3117 | 298 | - | ||
3118 | 299 | if ((rv = apr_thread_mutex_lock(fifo->lock)) == APR_SUCCESS) { | ||
3119 | 300 | rv = ipull_head(fifo, pi, block); | ||
3120 | 301 | apr_thread_mutex_unlock(fifo->lock); | ||
3121 | 302 | @@ -1088,10 +1054,6 @@ static apr_status_t ififo_peek(h2_ififo | ||
3122 | 303 | apr_status_t rv; | ||
3123 | 304 | int id; | ||
3124 | 305 | |||
3125 | 306 | - if (fifo->aborted) { | ||
3126 | 307 | - return APR_EOF; | ||
3127 | 308 | - } | ||
3128 | 309 | - | ||
3129 | 310 | if (APR_SUCCESS == (rv = apr_thread_mutex_lock(fifo->lock))) { | ||
3130 | 311 | if (APR_SUCCESS == (rv = ipull_head(fifo, &id, block))) { | ||
3131 | 312 | switch (fn(id, ctx)) { | ||
3132 | 313 | @@ -1117,39 +1079,40 @@ apr_status_t h2_ififo_try_peek(h2_ififo | ||
3133 | 314 | return ififo_peek(fifo, fn, ctx, 0); | ||
3134 | 315 | } | ||
3135 | 316 | |||
3136 | 317 | -apr_status_t h2_ififo_remove(h2_ififo *fifo, int id) | ||
3137 | 318 | +static apr_status_t ififo_remove(h2_ififo *fifo, int id) | ||
3138 | 319 | { | ||
3139 | 320 | - apr_status_t rv; | ||
3140 | 321 | + int rc, i; | ||
3141 | 322 | |||
3142 | 323 | if (fifo->aborted) { | ||
3143 | 324 | return APR_EOF; | ||
3144 | 325 | } | ||
3145 | 326 | |||
3146 | 327 | - if ((rv = apr_thread_mutex_lock(fifo->lock)) == APR_SUCCESS) { | ||
3147 | 328 | - int i, rc; | ||
3148 | 329 | - int e; | ||
3149 | 330 | - | ||
3150 | 331 | - rc = 0; | ||
3151 | 332 | - for (i = 0; i < fifo->count; ++i) { | ||
3152 | 333 | - e = fifo->elems[inth_index(fifo, i)]; | ||
3153 | 334 | - if (e == id) { | ||
3154 | 335 | - ++rc; | ||
3155 | 336 | - } | ||
3156 | 337 | - else if (rc) { | ||
3157 | 338 | - fifo->elems[inth_index(fifo, i-rc)] = e; | ||
3158 | 339 | - } | ||
3159 | 340 | - } | ||
3160 | 341 | - if (rc) { | ||
3161 | 342 | - fifo->count -= rc; | ||
3162 | 343 | - if (fifo->count + rc == fifo->nelems) { | ||
3163 | 344 | - apr_thread_cond_broadcast(fifo->not_full); | ||
3164 | 345 | - } | ||
3165 | 346 | - rv = APR_SUCCESS; | ||
3166 | 347 | + rc = 0; | ||
3167 | 348 | + for (i = 0; i < fifo->count; ++i) { | ||
3168 | 349 | + int e = fifo->elems[inth_index(fifo, i)]; | ||
3169 | 350 | + if (e == id) { | ||
3170 | 351 | + ++rc; | ||
3171 | 352 | } | ||
3172 | 353 | - else { | ||
3173 | 354 | - rv = APR_EAGAIN; | ||
3174 | 355 | + else if (rc) { | ||
3175 | 356 | + fifo->elems[inth_index(fifo, i-rc)] = e; | ||
3176 | 357 | } | ||
3177 | 358 | - | ||
3178 | 359 | + } | ||
3179 | 360 | + if (!rc) { | ||
3180 | 361 | + return APR_EAGAIN; | ||
3181 | 362 | + } | ||
3182 | 363 | + fifo->count -= rc; | ||
3183 | 364 | + if (fifo->count + rc == fifo->nelems) { | ||
3184 | 365 | + apr_thread_cond_broadcast(fifo->not_full); | ||
3185 | 366 | + } | ||
3186 | 367 | + return APR_SUCCESS; | ||
3187 | 368 | +} | ||
3188 | 369 | + | ||
3189 | 370 | +apr_status_t h2_ififo_remove(h2_ififo *fifo, int id) | ||
3190 | 371 | +{ | ||
3191 | 372 | + apr_status_t rv; | ||
3192 | 373 | + | ||
3193 | 374 | + if ((rv = apr_thread_mutex_lock(fifo->lock)) == APR_SUCCESS) { | ||
3194 | 375 | + rv = ififo_remove(fifo, id); | ||
3195 | 376 | apr_thread_mutex_unlock(fifo->lock); | ||
3196 | 377 | } | ||
3197 | 378 | return rv; | ||
3198 | 379 | --- a/modules/http2/h2_util.h | ||
3199 | 380 | +++ b/modules/http2/h2_util.h | ||
3200 | 381 | @@ -209,7 +209,6 @@ apr_status_t h2_fifo_create(h2_fifo **pf | ||
3201 | 382 | apr_status_t h2_fifo_set_create(h2_fifo **pfifo, apr_pool_t *pool, int capacity); | ||
3202 | 383 | |||
3203 | 384 | apr_status_t h2_fifo_term(h2_fifo *fifo); | ||
3204 | 385 | -apr_status_t h2_fifo_interrupt(h2_fifo *fifo); | ||
3205 | 386 | |||
3206 | 387 | int h2_fifo_count(h2_fifo *fifo); | ||
3207 | 388 | |||
3208 | 389 | @@ -280,7 +279,6 @@ apr_status_t h2_ififo_create(h2_ififo ** | ||
3209 | 390 | apr_status_t h2_ififo_set_create(h2_ififo **pfifo, apr_pool_t *pool, int capacity); | ||
3210 | 391 | |||
3211 | 392 | apr_status_t h2_ififo_term(h2_ififo *fifo); | ||
3212 | 393 | -apr_status_t h2_ififo_interrupt(h2_ififo *fifo); | ||
3213 | 394 | |||
3214 | 395 | int h2_ififo_count(h2_ififo *fifo); | ||
3215 | 396 | |||
3216 | 397 | --- a/modules/http2/h2_workers.c | ||
3217 | 398 | +++ b/modules/http2/h2_workers.c | ||
3218 | 399 | @@ -269,7 +269,6 @@ static apr_status_t workers_pool_cleanup | ||
3219 | 400 | } | ||
3220 | 401 | |||
3221 | 402 | h2_fifo_term(workers->mplxs); | ||
3222 | 403 | - h2_fifo_interrupt(workers->mplxs); | ||
3223 | 404 | |||
3224 | 405 | cleanup_zombies(workers); | ||
3225 | 406 | } | ||
3226 | diff --git a/debian/patches/CVE-2020-11993.patch b/debian/patches/CVE-2020-11993.patch | |||
3227 | 0 | new file mode 100644 | 407 | new file mode 100644 |
3228 | index 0000000..1002f87 | |||
3229 | --- /dev/null | |||
3230 | +++ b/debian/patches/CVE-2020-11993.patch | |||
3231 | @@ -0,0 +1,1905 @@ | |||
3232 | 1 | Backport of: | ||
3233 | 2 | |||
3234 | 3 | From 63a0a87efa0925514d15c211b508f6594669888c Mon Sep 17 00:00:00 2001 | ||
3235 | 4 | From: Graham Leggett <minfrin@apache.org> | ||
3236 | 5 | Date: Wed, 8 Jul 2020 11:53:48 +0000 | ||
3237 | 6 | Subject: [PATCH] *) mod_http2: connection terminology renamed to | ||
3238 | 7 | master/secondary. trunk patch: http://svn.apache.org/r1878926 | ||
3239 | 8 | http://svn.apache.org/r1879156 2.4.x patch: | ||
3240 | 9 | https://svn.apache.org/repos/asf/httpd/httpd/patches/2.4.x/h2-master-secondary.patch | ||
3241 | 10 | +1: icing, ylavic, minfrin ylavic: nitpicking, mixed | ||
3242 | 11 | "H2_secondary_IN" and "H2_secondary_OUT" case to register the | ||
3243 | 12 | filters, but not for adding them. IIRC filters names are case | ||
3244 | 13 | insentive so shouldn't matter, just popped at my eyes.. icing: updated | ||
3245 | 14 | patch and added r1879156 to fix the eye bleed. jailletc36: CHANGES could | ||
3246 | 15 | also be looked at if it makes sense to update the terminology | ||
3247 | 16 | also here | ||
3248 | 17 | |||
3249 | 18 | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1879642 13f79535-47bb-0310-9956-ffa450edef68 | ||
3250 | 19 | --- | ||
3251 | 20 | CHANGES | 3 + | ||
3252 | 21 | STATUS | 11 -- | ||
3253 | 22 | modules/http2/h2_conn.c | 52 +++---- | ||
3254 | 23 | modules/http2/h2_conn.h | 8 +- | ||
3255 | 24 | modules/http2/h2_filter.c | 4 +- | ||
3256 | 25 | modules/http2/h2_h2.c | 10 +- | ||
3257 | 26 | modules/http2/h2_mplx.c | 283 +++++++++++++++++++------------------ | ||
3258 | 27 | modules/http2/h2_mplx.h | 160 ++++++--------------- | ||
3259 | 28 | modules/http2/h2_request.c | 7 +- | ||
3260 | 29 | modules/http2/h2_session.c | 30 ++-- | ||
3261 | 30 | modules/http2/h2_session.h | 2 +- | ||
3262 | 31 | modules/http2/h2_stream.c | 2 +- | ||
3263 | 32 | modules/http2/h2_task.c | 68 ++++----- | ||
3264 | 33 | modules/http2/h2_task.h | 2 +- | ||
3265 | 34 | modules/http2/h2_workers.c | 6 +- | ||
3266 | 35 | modules/http2/mod_http2.c | 4 +- | ||
3267 | 36 | 16 files changed, 288 insertions(+), 364 deletions(-) | ||
3268 | 37 | |||
3269 | 38 | #diff --git a/CHANGES b/CHANGES | ||
3270 | 39 | #index 50432a7ca09..31ad6741715 100644 | ||
3271 | 40 | #--- a/CHANGES | ||
3272 | 41 | #+++ b/CHANGES | ||
3273 | 42 | #@@ -1,6 +1,9 @@ | ||
3274 | 43 | # -*- coding: utf-8 -*- | ||
3275 | 44 | # Changes with Apache 2.4.44 | ||
3276 | 45 | # | ||
3277 | 46 | #+ *) mod_http2: The module now handles master/secondary connections and has marked | ||
3278 | 47 | #+ methods according to use. [Stefan Eissing] | ||
3279 | 48 | #+ | ||
3280 | 49 | # *) core: Drop an invalid Last-Modified header value coming | ||
3281 | 50 | # from a FCGI/CGI script instead of replacing it with Unix epoch. | ||
3282 | 51 | # [Luca Toscano] | ||
3283 | 52 | #diff --git a/STATUS b/STATUS | ||
3284 | 53 | #index c4d0dde0534..72220708a70 100644 | ||
3285 | 54 | #--- a/STATUS | ||
3286 | 55 | #+++ b/STATUS | ||
3287 | 56 | #@@ -135,17 +135,6 @@ RELEASE SHOWSTOPPERS: | ||
3288 | 57 | # PATCHES ACCEPTED TO BACKPORT FROM TRUNK: | ||
3289 | 58 | # [ start all new proposals below, under PATCHES PROPOSED. ] | ||
3290 | 59 | # | ||
3291 | 60 | #- *) mod_http2: connection terminology renamed to master/secondary. | ||
3292 | 61 | #- trunk patch: http://svn.apache.org/r1878926 | ||
3293 | 62 | #- http://svn.apache.org/r1879156 | ||
3294 | 63 | #- 2.4.x patch: https://svn.apache.org/repos/asf/httpd/httpd/patches/2.4.x/h2-master-secondary.patch | ||
3295 | 64 | #- +1: icing, ylavic, minfrin | ||
3296 | 65 | #- ylavic: nitpicking, mixed "H2_secondary_IN" and "H2_secondary_OUT" case to | ||
3297 | 66 | #- register the filters, but not for adding them. IIRC filters names | ||
3298 | 67 | #- are case insentive so shouldn't matter, just popped at my eyes.. | ||
3299 | 68 | #- icing: updated patch and added r1879156 to fix the eye bleed. | ||
3300 | 69 | #- jailletc36: CHANGES could also be looked at if it makes sense to update the terminology | ||
3301 | 70 | #- also here | ||
3302 | 71 | # | ||
3303 | 72 | # PATCHES PROPOSED TO BACKPORT FROM TRUNK: | ||
3304 | 73 | # [ New proposals should be added at the end of the list ] | ||
3305 | 74 | --- a/modules/http2/h2_conn.c | ||
3306 | 75 | +++ b/modules/http2/h2_conn.c | ||
3307 | 76 | @@ -138,7 +138,7 @@ apr_status_t h2_conn_child_init(apr_pool | ||
3308 | 77 | ap_register_input_filter("H2_IN", h2_filter_core_input, | ||
3309 | 78 | NULL, AP_FTYPE_CONNECTION); | ||
3310 | 79 | |||
3311 | 80 | - status = h2_mplx_child_init(pool, s); | ||
3312 | 81 | + status = h2_mplx_m_child_init(pool, s); | ||
3313 | 82 | |||
3314 | 83 | if (status == APR_SUCCESS) { | ||
3315 | 84 | status = apr_socket_create(&dummy_socket, APR_INET, SOCK_STREAM, | ||
3316 | 85 | @@ -260,7 +260,7 @@ apr_status_t h2_conn_pre_close(struct h2 | ||
3317 | 86 | return DONE; | ||
3318 | 87 | } | ||
3319 | 88 | |||
3320 | 89 | -conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent) | ||
3321 | 90 | +conn_rec *h2_secondary_create(conn_rec *master, int sec_id, apr_pool_t *parent) | ||
3322 | 91 | { | ||
3323 | 92 | apr_allocator_t *allocator; | ||
3324 | 93 | apr_status_t status; | ||
3325 | 94 | @@ -271,7 +271,7 @@ conn_rec *h2_slave_create(conn_rec *mast | ||
3326 | 95 | |||
3327 | 96 | ap_assert(master); | ||
3328 | 97 | ap_log_cerror(APLOG_MARK, APLOG_TRACE3, 0, master, | ||
3329 | 98 | - "h2_stream(%ld-%d): create slave", master->id, slave_id); | ||
3330 | 99 | + "h2_stream(%ld-%d): create secondary", master->id, sec_id); | ||
3331 | 100 | |||
3332 | 101 | /* We create a pool with its own allocator to be used for | ||
3333 | 102 | * processing a request. This is the only way to have the processing | ||
3334 | 103 | @@ -284,18 +284,18 @@ conn_rec *h2_slave_create(conn_rec *mast | ||
3335 | 104 | status = apr_pool_create_ex(&pool, parent, NULL, allocator); | ||
3336 | 105 | if (status != APR_SUCCESS) { | ||
3337 | 106 | ap_log_cerror(APLOG_MARK, APLOG_ERR, status, master, | ||
3338 | 107 | - APLOGNO(10004) "h2_session(%ld-%d): create slave pool", | ||
3339 | 108 | - master->id, slave_id); | ||
3340 | 109 | + APLOGNO(10004) "h2_session(%ld-%d): create secondary pool", | ||
3341 | 110 | + master->id, sec_id); | ||
3342 | 111 | return NULL; | ||
3343 | 112 | } | ||
3344 | 113 | apr_allocator_owner_set(allocator, pool); | ||
3345 | 114 | - apr_pool_tag(pool, "h2_slave_conn"); | ||
3346 | 115 | + apr_pool_tag(pool, "h2_secondary_conn"); | ||
3347 | 116 | |||
3348 | 117 | c = (conn_rec *) apr_palloc(pool, sizeof(conn_rec)); | ||
3349 | 118 | if (c == NULL) { | ||
3350 | 119 | ap_log_cerror(APLOG_MARK, APLOG_ERR, APR_ENOMEM, master, | ||
3351 | 120 | - APLOGNO(02913) "h2_session(%ld-%d): create slave", | ||
3352 | 121 | - master->id, slave_id); | ||
3353 | 122 | + APLOGNO(02913) "h2_session(%ld-%d): create secondary", | ||
3354 | 123 | + master->id, sec_id); | ||
3355 | 124 | apr_pool_destroy(pool); | ||
3356 | 125 | return NULL; | ||
3357 | 126 | } | ||
3358 | 127 | @@ -322,19 +322,19 @@ conn_rec *h2_slave_create(conn_rec *mast | ||
3359 | 128 | c->clogging_input_filters = 1; | ||
3360 | 129 | c->log = NULL; | ||
3361 | 130 | c->log_id = apr_psprintf(pool, "%ld-%d", | ||
3362 | 131 | - master->id, slave_id); | ||
3363 | 132 | + master->id, sec_id); | ||
3364 | 133 | c->aborted = 0; | ||
3365 | 134 | - /* We cannot install the master connection socket on the slaves, as | ||
3366 | 135 | + /* We cannot install the master connection socket on the secondary, as | ||
3367 | 136 | * modules mess with timeouts/blocking of the socket, with | ||
3368 | 137 | * unwanted side effects to the master connection processing. | ||
3369 | 138 | - * Fortunately, since we never use the slave socket, we can just install | ||
3370 | 139 | + * Fortunately, since we never use the secondary socket, we can just install | ||
3371 | 140 | * a single, process-wide dummy and everyone is happy. | ||
3372 | 141 | */ | ||
3373 | 142 | ap_set_module_config(c->conn_config, &core_module, dummy_socket); | ||
3374 | 143 | /* TODO: these should be unique to this thread */ | ||
3375 | 144 | c->sbh = master->sbh; | ||
3376 | 145 | - /* TODO: not all mpm modules have learned about slave connections yet. | ||
3377 | 146 | - * copy their config from master to slave. | ||
3378 | 147 | + /* TODO: not all mpm modules have learned about secondary connections yet. | ||
3379 | 148 | + * copy their config from master to secondary. | ||
3380 | 149 | */ | ||
3381 | 150 | if ((mpm = h2_conn_mpm_module()) != NULL) { | ||
3382 | 151 | cfg = ap_get_module_config(master->conn_config, mpm); | ||
3383 | 152 | @@ -342,38 +342,38 @@ conn_rec *h2_slave_create(conn_rec *mast | ||
3384 | 153 | } | ||
3385 | 154 | |||
3386 | 155 | ap_log_cerror(APLOG_MARK, APLOG_TRACE3, 0, c, | ||
3387 | 156 | - "h2_slave(%s): created", c->log_id); | ||
3388 | 157 | + "h2_secondary(%s): created", c->log_id); | ||
3389 | 158 | return c; | ||
3390 | 159 | } | ||
3391 | 160 | |||
3392 | 161 | -void h2_slave_destroy(conn_rec *slave) | ||
3393 | 162 | +void h2_secondary_destroy(conn_rec *secondary) | ||
3394 | 163 | { | ||
3395 | 164 | - ap_log_cerror(APLOG_MARK, APLOG_TRACE3, 0, slave, | ||
3396 | 165 | - "h2_slave(%s): destroy", slave->log_id); | ||
3397 | 166 | - slave->sbh = NULL; | ||
3398 | 167 | - apr_pool_destroy(slave->pool); | ||
3399 | 168 | + ap_log_cerror(APLOG_MARK, APLOG_TRACE3, 0, secondary, | ||
3400 | 169 | + "h2_secondary(%s): destroy", secondary->log_id); | ||
3401 | 170 | + secondary->sbh = NULL; | ||
3402 | 171 | + apr_pool_destroy(secondary->pool); | ||
3403 | 172 | } | ||
3404 | 173 | |||
3405 | 174 | -apr_status_t h2_slave_run_pre_connection(conn_rec *slave, apr_socket_t *csd) | ||
3406 | 175 | +apr_status_t h2_secondary_run_pre_connection(conn_rec *secondary, apr_socket_t *csd) | ||
3407 | 176 | { | ||
3408 | 177 | - if (slave->keepalives == 0) { | ||
3409 | 178 | + if (secondary->keepalives == 0) { | ||
3410 | 179 | /* Simulate that we had already a request on this connection. Some | ||
3411 | 180 | * hooks trigger special behaviour when keepalives is 0. | ||
3412 | 181 | * (Not necessarily in pre_connection, but later. Set it here, so it | ||
3413 | 182 | * is in place.) */ | ||
3414 | 183 | - slave->keepalives = 1; | ||
3415 | 184 | + secondary->keepalives = 1; | ||
3416 | 185 | /* We signal that this connection will be closed after the request. | ||
3417 | 186 | * Which is true in that sense that we throw away all traffic data | ||
3418 | 187 | - * on this slave connection after each requests. Although we might | ||
3419 | 188 | + * on this secondary connection after each requests. Although we might | ||
3420 | 189 | * reuse internal structures like memory pools. | ||
3421 | 190 | * The wanted effect of this is that httpd does not try to clean up | ||
3422 | 191 | * any dangling data on this connection when a request is done. Which | ||
3423 | 192 | * is unneccessary on a h2 stream. | ||
3424 | 193 | */ | ||
3425 | 194 | - slave->keepalive = AP_CONN_CLOSE; | ||
3426 | 195 | - return ap_run_pre_connection(slave, csd); | ||
3427 | 196 | + secondary->keepalive = AP_CONN_CLOSE; | ||
3428 | 197 | + return ap_run_pre_connection(secondary, csd); | ||
3429 | 198 | } | ||
3430 | 199 | - ap_assert(slave->output_filters); | ||
3431 | 200 | + ap_assert(secondary->output_filters); | ||
3432 | 201 | return APR_SUCCESS; | ||
3433 | 202 | } | ||
3434 | 203 | |||
3435 | 204 | --- a/modules/http2/h2_conn.h | ||
3436 | 205 | +++ b/modules/http2/h2_conn.h | ||
3437 | 206 | @@ -68,10 +68,10 @@ h2_mpm_type_t h2_conn_mpm_type(void); | ||
3438 | 207 | const char *h2_conn_mpm_name(void); | ||
3439 | 208 | int h2_mpm_supported(void); | ||
3440 | 209 | |||
3441 | 210 | -conn_rec *h2_slave_create(conn_rec *master, int slave_id, apr_pool_t *parent); | ||
3442 | 211 | -void h2_slave_destroy(conn_rec *slave); | ||
3443 | 212 | +conn_rec *h2_secondary_create(conn_rec *master, int sec_id, apr_pool_t *parent); | ||
3444 | 213 | +void h2_secondary_destroy(conn_rec *secondary); | ||
3445 | 214 | |||
3446 | 215 | -apr_status_t h2_slave_run_pre_connection(conn_rec *slave, apr_socket_t *csd); | ||
3447 | 216 | -void h2_slave_run_connection(conn_rec *slave); | ||
3448 | 217 | +apr_status_t h2_secondary_run_pre_connection(conn_rec *secondary, apr_socket_t *csd); | ||
3449 | 218 | +void h2_secondary_run_connection(conn_rec *secondary); | ||
3450 | 219 | |||
3451 | 220 | #endif /* defined(__mod_h2__h2_conn__) */ | ||
3452 | 221 | --- a/modules/http2/h2_filter.c | ||
3453 | 222 | +++ b/modules/http2/h2_filter.c | ||
3454 | 223 | @@ -370,7 +370,7 @@ static void add_streams(apr_bucket_briga | ||
3455 | 224 | x.s = s; | ||
3456 | 225 | x.idx = 0; | ||
3457 | 226 | bbout(bb, " \"streams\": {"); | ||
3458 | 227 | - h2_mplx_stream_do(s->mplx, add_stream, &x); | ||
3459 | 228 | + h2_mplx_m_stream_do(s->mplx, add_stream, &x); | ||
3460 | 229 | bbout(bb, "\n }%s\n", last? "" : ","); | ||
3461 | 230 | } | ||
3462 | 231 | |||
3463 | 232 | @@ -433,7 +433,7 @@ static void add_stats(apr_bucket_brigade | ||
3464 | 233 | static apr_status_t h2_status_insert(h2_task *task, apr_bucket *b) | ||
3465 | 234 | { | ||
3466 | 235 | h2_mplx *m = task->mplx; | ||
3467 | 236 | - h2_stream *stream = h2_mplx_stream_get(m, task->stream_id); | ||
3468 | 237 | + h2_stream *stream = h2_mplx_t_stream_get(m, task); | ||
3469 | 238 | h2_session *s; | ||
3470 | 239 | conn_rec *c; | ||
3471 | 240 | |||
3472 | 241 | --- a/modules/http2/h2_h2.c | ||
3473 | 242 | +++ b/modules/http2/h2_h2.c | ||
3474 | 243 | @@ -668,7 +668,7 @@ static int h2_h2_pre_close_conn(conn_rec | ||
3475 | 244 | { | ||
3476 | 245 | h2_ctx *ctx; | ||
3477 | 246 | |||
3478 | 247 | - /* slave connection? */ | ||
3479 | 248 | + /* secondary connection? */ | ||
3480 | 249 | if (c->master) { | ||
3481 | 250 | return DECLINED; | ||
3482 | 251 | } | ||
3483 | 252 | @@ -712,7 +712,7 @@ static void check_push(request_rec *r, c | ||
3484 | 253 | |||
3485 | 254 | static int h2_h2_post_read_req(request_rec *r) | ||
3486 | 255 | { | ||
3487 | 256 | - /* slave connection? */ | ||
3488 | 257 | + /* secondary connection? */ | ||
3489 | 258 | if (r->connection->master) { | ||
3490 | 259 | struct h2_task *task = h2_ctx_get_task(r->connection); | ||
3491 | 260 | /* This hook will get called twice on internal redirects. Take care | ||
3492 | 261 | @@ -731,7 +731,7 @@ static int h2_h2_post_read_req(request_r | ||
3493 | 262 | ap_add_output_filter("H2_RESPONSE", task, r, r->connection); | ||
3494 | 263 | |||
3495 | 264 | for (f = r->input_filters; f; f = f->next) { | ||
3496 | 265 | - if (!strcmp("H2_SLAVE_IN", f->frec->name)) { | ||
3497 | 266 | + if (!strcmp("H2_SECONDARY_IN", f->frec->name)) { | ||
3498 | 267 | f->r = r; | ||
3499 | 268 | break; | ||
3500 | 269 | } | ||
3501 | 270 | @@ -745,7 +745,7 @@ static int h2_h2_post_read_req(request_r | ||
3502 | 271 | |||
3503 | 272 | static int h2_h2_late_fixups(request_rec *r) | ||
3504 | 273 | { | ||
3505 | 274 | - /* slave connection? */ | ||
3506 | 275 | + /* secondary connection? */ | ||
3507 | 276 | if (r->connection->master) { | ||
3508 | 277 | struct h2_task *task = h2_ctx_get_task(r->connection); | ||
3509 | 278 | if (task) { | ||
3510 | 279 | @@ -753,7 +753,7 @@ static int h2_h2_late_fixups(request_rec | ||
3511 | 280 | task->output.copy_files = h2_config_rgeti(r, H2_CONF_COPY_FILES); | ||
3512 | 281 | if (task->output.copy_files) { | ||
3513 | 282 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c, | ||
3514 | 283 | - "h2_slave_out(%s): copy_files on", task->id); | ||
3515 | 284 | + "h2_secondary_out(%s): copy_files on", task->id); | ||
3516 | 285 | h2_beam_on_file_beam(task->output.beam, h2_beam_no_files, NULL); | ||
3517 | 286 | } | ||
3518 | 287 | check_push(r, "late_fixup"); | ||
3519 | 288 | --- a/modules/http2/h2_mplx.c | ||
3520 | 289 | +++ b/modules/http2/h2_mplx.c | ||
3521 | 290 | @@ -56,10 +56,18 @@ typedef struct { | ||
3522 | 291 | apr_size_t count; | ||
3523 | 292 | } stream_iter_ctx; | ||
3524 | 293 | |||
3525 | 294 | -static apr_status_t mplx_be_happy(h2_mplx *m); | ||
3526 | 295 | -static apr_status_t mplx_be_annoyed(h2_mplx *m); | ||
3527 | 296 | +/** | ||
3528 | 297 | + * Naming convention for static functions: | ||
3529 | 298 | + * - m_*: function only called from the master connection | ||
3530 | 299 | + * - s_*: function only called from a secondary connection | ||
3531 | 300 | + * - t_*: function only called from a h2_task holder | ||
3532 | 301 | + * - mst_*: function called from everyone | ||
3533 | 302 | + */ | ||
3534 | 303 | |||
3535 | 304 | -apr_status_t h2_mplx_child_init(apr_pool_t *pool, server_rec *s) | ||
3536 | 305 | +static apr_status_t s_mplx_be_happy(h2_mplx *m, h2_task *task); | ||
3537 | 306 | +static apr_status_t m_be_annoyed(h2_mplx *m); | ||
3538 | 307 | + | ||
3539 | 308 | +apr_status_t h2_mplx_m_child_init(apr_pool_t *pool, server_rec *s) | ||
3540 | 309 | { | ||
3541 | 310 | return APR_SUCCESS; | ||
3542 | 311 | } | ||
3543 | 312 | @@ -81,26 +89,25 @@ apr_status_t h2_mplx_child_init(apr_pool | ||
3544 | 313 | #define H2_MPLX_LEAVE_MAYBE(m, dolock) \ | ||
3545 | 314 | if (dolock) apr_thread_mutex_unlock(m->lock) | ||
3546 | 315 | |||
3547 | 316 | -static void check_data_for(h2_mplx *m, h2_stream *stream, int mplx_is_locked); | ||
3548 | 317 | +static void mst_check_data_for(h2_mplx *m, h2_stream *stream, int mplx_is_locked); | ||
3549 | 318 | |||
3550 | 319 | -static void stream_output_consumed(void *ctx, | ||
3551 | 320 | - h2_bucket_beam *beam, apr_off_t length) | ||
3552 | 321 | +static void mst_stream_output_consumed(void *ctx, h2_bucket_beam *beam, apr_off_t length) | ||
3553 | 322 | { | ||
3554 | 323 | } | ||
3555 | 324 | |||
3556 | 325 | -static void stream_input_ev(void *ctx, h2_bucket_beam *beam) | ||
3557 | 326 | +static void mst_stream_input_ev(void *ctx, h2_bucket_beam *beam) | ||
3558 | 327 | { | ||
3559 | 328 | h2_stream *stream = ctx; | ||
3560 | 329 | h2_mplx *m = stream->session->mplx; | ||
3561 | 330 | apr_atomic_set32(&m->event_pending, 1); | ||
3562 | 331 | } | ||
3563 | 332 | |||
3564 | 333 | -static void stream_input_consumed(void *ctx, h2_bucket_beam *beam, apr_off_t length) | ||
3565 | 334 | +static void m_stream_input_consumed(void *ctx, h2_bucket_beam *beam, apr_off_t length) | ||
3566 | 335 | { | ||
3567 | 336 | h2_stream_in_consumed(ctx, length); | ||
3568 | 337 | } | ||
3569 | 338 | |||
3570 | 339 | -static void stream_joined(h2_mplx *m, h2_stream *stream) | ||
3571 | 340 | +static void ms_stream_joined(h2_mplx *m, h2_stream *stream) | ||
3572 | 341 | { | ||
3573 | 342 | ap_assert(!h2_task_has_started(stream->task) || stream->task->worker_done); | ||
3574 | 343 | |||
3575 | 344 | @@ -109,7 +116,7 @@ static void stream_joined(h2_mplx *m, h2 | ||
3576 | 345 | h2_ihash_add(m->spurge, stream); | ||
3577 | 346 | } | ||
3578 | 347 | |||
3579 | 348 | -static void stream_cleanup(h2_mplx *m, h2_stream *stream) | ||
3580 | 349 | +static void m_stream_cleanup(h2_mplx *m, h2_stream *stream) | ||
3581 | 350 | { | ||
3582 | 351 | ap_assert(stream->state == H2_SS_CLEANUP); | ||
3583 | 352 | |||
3584 | 353 | @@ -128,7 +135,7 @@ static void stream_cleanup(h2_mplx *m, h | ||
3585 | 354 | h2_iq_remove(m->q, stream->id); | ||
3586 | 355 | |||
3587 | 356 | if (!h2_task_has_started(stream->task) || stream->task->done_done) { | ||
3588 | 357 | - stream_joined(m, stream); | ||
3589 | 358 | + ms_stream_joined(m, stream); | ||
3590 | 359 | } | ||
3591 | 360 | else { | ||
3592 | 361 | h2_ififo_remove(m->readyq, stream->id); | ||
3593 | 362 | @@ -150,8 +157,8 @@ static void stream_cleanup(h2_mplx *m, h | ||
3594 | 363 | * their HTTP/1 cousins, the separate allocator seems to work better | ||
3595 | 364 | * than protecting a shared h2_session one with an own lock. | ||
3596 | 365 | */ | ||
3597 | 366 | -h2_mplx *h2_mplx_create(conn_rec *c, server_rec *s, apr_pool_t *parent, | ||
3598 | 367 | - h2_workers *workers) | ||
3599 | 368 | +h2_mplx *h2_mplx_m_create(conn_rec *c, server_rec *s, apr_pool_t *parent, | ||
3600 | 369 | + h2_workers *workers) | ||
3601 | 370 | { | ||
3602 | 371 | apr_status_t status = APR_SUCCESS; | ||
3603 | 372 | apr_allocator_t *allocator; | ||
3604 | 373 | @@ -165,7 +172,7 @@ h2_mplx *h2_mplx_create(conn_rec *c, ser | ||
3605 | 374 | m->s = s; | ||
3606 | 375 | |||
3607 | 376 | /* We create a pool with its own allocator to be used for | ||
3608 | 377 | - * processing slave connections. This is the only way to have the | ||
3609 | 378 | + * processing secondary connections. This is the only way to have the | ||
3610 | 379 | * processing independant of its parent pool in the sense that it | ||
3611 | 380 | * can work in another thread. Also, the new allocator needs its own | ||
3612 | 381 | * mutex to synchronize sub-pools. | ||
3613 | 382 | @@ -217,12 +224,12 @@ h2_mplx *h2_mplx_create(conn_rec *c, ser | ||
3614 | 383 | m->last_mood_change = apr_time_now(); | ||
3615 | 384 | m->mood_update_interval = apr_time_from_msec(100); | ||
3616 | 385 | |||
3617 | 386 | - m->spare_slaves = apr_array_make(m->pool, 10, sizeof(conn_rec*)); | ||
3618 | 387 | + m->spare_secondary = apr_array_make(m->pool, 10, sizeof(conn_rec*)); | ||
3619 | 388 | } | ||
3620 | 389 | return m; | ||
3621 | 390 | } | ||
3622 | 391 | |||
3623 | 392 | -int h2_mplx_shutdown(h2_mplx *m) | ||
3624 | 393 | +int h2_mplx_m_shutdown(h2_mplx *m) | ||
3625 | 394 | { | ||
3626 | 395 | int max_stream_started = 0; | ||
3627 | 396 | |||
3628 | 397 | @@ -236,7 +243,7 @@ int h2_mplx_shutdown(h2_mplx *m) | ||
3629 | 398 | return max_stream_started; | ||
3630 | 399 | } | ||
3631 | 400 | |||
3632 | 401 | -static int input_consumed_signal(h2_mplx *m, h2_stream *stream) | ||
3633 | 402 | +static int m_input_consumed_signal(h2_mplx *m, h2_stream *stream) | ||
3634 | 403 | { | ||
3635 | 404 | if (stream->input) { | ||
3636 | 405 | return h2_beam_report_consumption(stream->input); | ||
3637 | 406 | @@ -244,12 +251,12 @@ static int input_consumed_signal(h2_mplx | ||
3638 | 407 | return 0; | ||
3639 | 408 | } | ||
3640 | 409 | |||
3641 | 410 | -static int report_consumption_iter(void *ctx, void *val) | ||
3642 | 411 | +static int m_report_consumption_iter(void *ctx, void *val) | ||
3643 | 412 | { | ||
3644 | 413 | h2_stream *stream = val; | ||
3645 | 414 | h2_mplx *m = ctx; | ||
3646 | 415 | |||
3647 | 416 | - input_consumed_signal(m, stream); | ||
3648 | 417 | + m_input_consumed_signal(m, stream); | ||
3649 | 418 | if (stream->state == H2_SS_CLOSED_L | ||
3650 | 419 | && (!stream->task || stream->task->worker_done)) { | ||
3651 | 420 | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, m->c, | ||
3652 | 421 | @@ -260,7 +267,7 @@ static int report_consumption_iter(void | ||
3653 | 422 | return 1; | ||
3654 | 423 | } | ||
3655 | 424 | |||
3656 | 425 | -static int output_consumed_signal(h2_mplx *m, h2_task *task) | ||
3657 | 426 | +static int s_output_consumed_signal(h2_mplx *m, h2_task *task) | ||
3658 | 427 | { | ||
3659 | 428 | if (task->output.beam) { | ||
3660 | 429 | return h2_beam_report_consumption(task->output.beam); | ||
3661 | 430 | @@ -268,7 +275,7 @@ static int output_consumed_signal(h2_mpl | ||
3662 | 431 | return 0; | ||
3663 | 432 | } | ||
3664 | 433 | |||
3665 | 434 | -static int stream_destroy_iter(void *ctx, void *val) | ||
3666 | 435 | +static int m_stream_destroy_iter(void *ctx, void *val) | ||
3667 | 436 | { | ||
3668 | 437 | h2_mplx *m = ctx; | ||
3669 | 438 | h2_stream *stream = val; | ||
3670 | 439 | @@ -278,7 +285,7 @@ static int stream_destroy_iter(void *ctx | ||
3671 | 440 | |||
3672 | 441 | if (stream->input) { | ||
3673 | 442 | /* Process outstanding events before destruction */ | ||
3674 | 443 | - input_consumed_signal(m, stream); | ||
3675 | 444 | + m_input_consumed_signal(m, stream); | ||
3676 | 445 | h2_beam_log(stream->input, m->c, APLOG_TRACE2, "stream_destroy"); | ||
3677 | 446 | h2_beam_destroy(stream->input); | ||
3678 | 447 | stream->input = NULL; | ||
3679 | 448 | @@ -286,12 +293,12 @@ static int stream_destroy_iter(void *ctx | ||
3680 | 449 | |||
3681 | 450 | if (stream->task) { | ||
3682 | 451 | h2_task *task = stream->task; | ||
3683 | 452 | - conn_rec *slave; | ||
3684 | 453 | - int reuse_slave = 0; | ||
3685 | 454 | + conn_rec *secondary; | ||
3686 | 455 | + int reuse_secondary = 0; | ||
3687 | 456 | |||
3688 | 457 | stream->task = NULL; | ||
3689 | 458 | - slave = task->c; | ||
3690 | 459 | - if (slave) { | ||
3691 | 460 | + secondary = task->c; | ||
3692 | 461 | + if (secondary) { | ||
3693 | 462 | /* On non-serialized requests, the IO logging has not accounted for any | ||
3694 | 463 | * meta data send over the network: response headers and h2 frame headers. we | ||
3695 | 464 | * counted this on the stream and need to add this now. | ||
3696 | 465 | @@ -300,26 +307,25 @@ static int stream_destroy_iter(void *ctx | ||
3697 | 466 | if (task->request && !task->request->serialize && h2_task_logio_add_bytes_out) { | ||
3698 | 467 | apr_off_t unaccounted = stream->out_frame_octets - stream->out_data_octets; | ||
3699 | 468 | if (unaccounted > 0) { | ||
3700 | 469 | - h2_task_logio_add_bytes_out(slave, unaccounted); | ||
3701 | 470 | + h2_task_logio_add_bytes_out(secondary, unaccounted); | ||
3702 | 471 | } | ||
3703 | 472 | } | ||
3704 | 473 | |||
3705 | 474 | - if (m->s->keep_alive_max == 0 || slave->keepalives < m->s->keep_alive_max) { | ||
3706 | 475 | - reuse_slave = ((m->spare_slaves->nelts < (m->limit_active * 3 / 2)) | ||
3707 | 476 | - && !task->rst_error); | ||
3708 | 477 | + if (m->s->keep_alive_max == 0 || secondary->keepalives < m->s->keep_alive_max) { | ||
3709 | 478 | + reuse_secondary = ((m->spare_secondary->nelts < (m->limit_active * 3 / 2)) | ||
3710 | 479 | + && !task->rst_error); | ||
3711 | 480 | } | ||
3712 | 481 | |||
3713 | 482 | - task->c = NULL; | ||
3714 | 483 | - if (reuse_slave) { | ||
3715 | 484 | + if (reuse_secondary) { | ||
3716 | 485 | h2_beam_log(task->output.beam, m->c, APLOG_DEBUG, | ||
3717 | 486 | - APLOGNO(03385) "h2_task_destroy, reuse slave"); | ||
3718 | 487 | + APLOGNO(03385) "h2_task_destroy, reuse secondary"); | ||
3719 | 488 | h2_task_destroy(task); | ||
3720 | 489 | - APR_ARRAY_PUSH(m->spare_slaves, conn_rec*) = slave; | ||
3721 | 490 | + APR_ARRAY_PUSH(m->spare_secondary, conn_rec*) = secondary; | ||
3722 | 491 | } | ||
3723 | 492 | else { | ||
3724 | 493 | h2_beam_log(task->output.beam, m->c, APLOG_TRACE1, | ||
3725 | 494 | - "h2_task_destroy, destroy slave"); | ||
3726 | 495 | - h2_slave_destroy(slave); | ||
3727 | 496 | + "h2_task_destroy, destroy secondary"); | ||
3728 | 497 | + h2_secondary_destroy(secondary); | ||
3729 | 498 | } | ||
3730 | 499 | } | ||
3731 | 500 | } | ||
3732 | 501 | @@ -327,11 +333,11 @@ static int stream_destroy_iter(void *ctx | ||
3733 | 502 | return 0; | ||
3734 | 503 | } | ||
3735 | 504 | |||
3736 | 505 | -static void purge_streams(h2_mplx *m, int lock) | ||
3737 | 506 | +static void m_purge_streams(h2_mplx *m, int lock) | ||
3738 | 507 | { | ||
3739 | 508 | if (!h2_ihash_empty(m->spurge)) { | ||
3740 | 509 | H2_MPLX_ENTER_MAYBE(m, lock); | ||
3741 | 510 | - while (!h2_ihash_iter(m->spurge, stream_destroy_iter, m)) { | ||
3742 | 511 | + while (!h2_ihash_iter(m->spurge, m_stream_destroy_iter, m)) { | ||
3743 | 512 | /* repeat until empty */ | ||
3744 | 513 | } | ||
3745 | 514 | H2_MPLX_LEAVE_MAYBE(m, lock); | ||
3746 | 515 | @@ -343,13 +349,13 @@ typedef struct { | ||
3747 | 516 | void *ctx; | ||
3748 | 517 | } stream_iter_ctx_t; | ||
3749 | 518 | |||
3750 | 519 | -static int stream_iter_wrap(void *ctx, void *stream) | ||
3751 | 520 | +static int m_stream_iter_wrap(void *ctx, void *stream) | ||
3752 | 521 | { | ||
3753 | 522 | stream_iter_ctx_t *x = ctx; | ||
3754 | 523 | return x->cb(stream, x->ctx); | ||
3755 | 524 | } | ||
3756 | 525 | |||
3757 | 526 | -apr_status_t h2_mplx_stream_do(h2_mplx *m, h2_mplx_stream_cb *cb, void *ctx) | ||
3758 | 527 | +apr_status_t h2_mplx_m_stream_do(h2_mplx *m, h2_mplx_stream_cb *cb, void *ctx) | ||
3759 | 528 | { | ||
3760 | 529 | stream_iter_ctx_t x; | ||
3761 | 530 | |||
3762 | 531 | @@ -357,13 +363,13 @@ apr_status_t h2_mplx_stream_do(h2_mplx * | ||
3763 | 532 | |||
3764 | 533 | x.cb = cb; | ||
3765 | 534 | x.ctx = ctx; | ||
3766 | 535 | - h2_ihash_iter(m->streams, stream_iter_wrap, &x); | ||
3767 | 536 | + h2_ihash_iter(m->streams, m_stream_iter_wrap, &x); | ||
3768 | 537 | |||
3769 | 538 | H2_MPLX_LEAVE(m); | ||
3770 | 539 | return APR_SUCCESS; | ||
3771 | 540 | } | ||
3772 | 541 | |||
3773 | 542 | -static int report_stream_iter(void *ctx, void *val) { | ||
3774 | 543 | +static int m_report_stream_iter(void *ctx, void *val) { | ||
3775 | 544 | h2_mplx *m = ctx; | ||
3776 | 545 | h2_stream *stream = val; | ||
3777 | 546 | h2_task *task = stream->task; | ||
3778 | 547 | @@ -388,7 +394,7 @@ static int report_stream_iter(void *ctx, | ||
3779 | 548 | return 1; | ||
3780 | 549 | } | ||
3781 | 550 | |||
3782 | 551 | -static int unexpected_stream_iter(void *ctx, void *val) { | ||
3783 | 552 | +static int m_unexpected_stream_iter(void *ctx, void *val) { | ||
3784 | 553 | h2_mplx *m = ctx; | ||
3785 | 554 | h2_stream *stream = val; | ||
3786 | 555 | ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, m->c, /* NO APLOGNO */ | ||
3787 | 556 | @@ -397,7 +403,7 @@ static int unexpected_stream_iter(void * | ||
3788 | 557 | return 1; | ||
3789 | 558 | } | ||
3790 | 559 | |||
3791 | 560 | -static int stream_cancel_iter(void *ctx, void *val) { | ||
3792 | 561 | +static int m_stream_cancel_iter(void *ctx, void *val) { | ||
3793 | 562 | h2_mplx *m = ctx; | ||
3794 | 563 | h2_stream *stream = val; | ||
3795 | 564 | |||
3796 | 565 | @@ -411,11 +417,11 @@ static int stream_cancel_iter(void *ctx, | ||
3797 | 566 | h2_stream_rst(stream, H2_ERR_NO_ERROR); | ||
3798 | 567 | /* All connection data has been sent, simulate cleanup */ | ||
3799 | 568 | h2_stream_dispatch(stream, H2_SEV_EOS_SENT); | ||
3800 | 569 | - stream_cleanup(m, stream); | ||
3801 | 570 | + m_stream_cleanup(m, stream); | ||
3802 | 571 | return 0; | ||
3803 | 572 | } | ||
3804 | 573 | |||
3805 | 574 | -void h2_mplx_release_and_join(h2_mplx *m, apr_thread_cond_t *wait) | ||
3806 | 575 | +void h2_mplx_m_release_and_join(h2_mplx *m, apr_thread_cond_t *wait) | ||
3807 | 576 | { | ||
3808 | 577 | apr_status_t status; | ||
3809 | 578 | int i, wait_secs = 60, old_aborted; | ||
3810 | 579 | @@ -429,7 +435,7 @@ void h2_mplx_release_and_join(h2_mplx *m | ||
3811 | 580 | |||
3812 | 581 | H2_MPLX_ENTER_ALWAYS(m); | ||
3813 | 582 | |||
3814 | 583 | - /* While really terminating any slave connections, treat the master | ||
3815 | 584 | + /* While really terminating any secondary connections, treat the master | ||
3816 | 585 | * connection as aborted. It's not as if we could send any more data | ||
3817 | 586 | * at this point. */ | ||
3818 | 587 | old_aborted = m->c->aborted; | ||
3819 | 588 | @@ -441,7 +447,7 @@ void h2_mplx_release_and_join(h2_mplx *m | ||
3820 | 589 | "h2_mplx(%ld): release, %d/%d/%d streams (total/hold/purge), %d active tasks", | ||
3821 | 590 | m->id, (int)h2_ihash_count(m->streams), | ||
3822 | 591 | (int)h2_ihash_count(m->shold), (int)h2_ihash_count(m->spurge), m->tasks_active); | ||
3823 | 592 | - while (!h2_ihash_iter(m->streams, stream_cancel_iter, m)) { | ||
3824 | 593 | + while (!h2_ihash_iter(m->streams, m_stream_cancel_iter, m)) { | ||
3825 | 594 | /* until empty */ | ||
3826 | 595 | } | ||
3827 | 596 | |||
3828 | 597 | @@ -463,7 +469,7 @@ void h2_mplx_release_and_join(h2_mplx *m | ||
3829 | 598 | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, m->c, APLOGNO(03198) | ||
3830 | 599 | "h2_mplx(%ld): waited %d sec for %d tasks", | ||
3831 | 600 | m->id, i*wait_secs, (int)h2_ihash_count(m->shold)); | ||
3832 | 601 | - h2_ihash_iter(m->shold, report_stream_iter, m); | ||
3833 | 602 | + h2_ihash_iter(m->shold, m_report_stream_iter, m); | ||
3834 | 603 | } | ||
3835 | 604 | } | ||
3836 | 605 | m->join_wait = NULL; | ||
3837 | 606 | @@ -474,7 +480,7 @@ void h2_mplx_release_and_join(h2_mplx *m | ||
3838 | 607 | ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, m->c, APLOGNO(03516) | ||
3839 | 608 | "h2_mplx(%ld): unexpected %d streams in hold", | ||
3840 | 609 | m->id, (int)h2_ihash_count(m->shold)); | ||
3841 | 610 | - h2_ihash_iter(m->shold, unexpected_stream_iter, m); | ||
3842 | 611 | + h2_ihash_iter(m->shold, m_unexpected_stream_iter, m); | ||
3843 | 612 | } | ||
3844 | 613 | |||
3845 | 614 | m->c->aborted = old_aborted; | ||
3846 | 615 | @@ -483,39 +489,39 @@ void h2_mplx_release_and_join(h2_mplx *m | ||
3847 | 616 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, "h2_mplx(%ld): released", m->id); | ||
3848 | 617 | } | ||
3849 | 618 | |||
3850 | 619 | -apr_status_t h2_mplx_stream_cleanup(h2_mplx *m, h2_stream *stream) | ||
3851 | 620 | +apr_status_t h2_mplx_m_stream_cleanup(h2_mplx *m, h2_stream *stream) | ||
3852 | 621 | { | ||
3853 | 622 | H2_MPLX_ENTER(m); | ||
3854 | 623 | |||
3855 | 624 | ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c, | ||
3856 | 625 | H2_STRM_MSG(stream, "cleanup")); | ||
3857 | 626 | - stream_cleanup(m, stream); | ||
3858 | 627 | + m_stream_cleanup(m, stream); | ||
3859 | 628 | |||
3860 | 629 | H2_MPLX_LEAVE(m); | ||
3861 | 630 | return APR_SUCCESS; | ||
3862 | 631 | } | ||
3863 | 632 | |||
3864 | 633 | -h2_stream *h2_mplx_stream_get(h2_mplx *m, int id) | ||
3865 | 634 | +h2_stream *h2_mplx_t_stream_get(h2_mplx *m, h2_task *task) | ||
3866 | 635 | { | ||
3867 | 636 | h2_stream *s = NULL; | ||
3868 | 637 | |||
3869 | 638 | H2_MPLX_ENTER_ALWAYS(m); | ||
3870 | 639 | |||
3871 | 640 | - s = h2_ihash_get(m->streams, id); | ||
3872 | 641 | + s = h2_ihash_get(m->streams, task->stream_id); | ||
3873 | 642 | |||
3874 | 643 | H2_MPLX_LEAVE(m); | ||
3875 | 644 | return s; | ||
3876 | 645 | } | ||
3877 | 646 | |||
3878 | 647 | -static void output_produced(void *ctx, h2_bucket_beam *beam, apr_off_t bytes) | ||
3879 | 648 | +static void mst_output_produced(void *ctx, h2_bucket_beam *beam, apr_off_t bytes) | ||
3880 | 649 | { | ||
3881 | 650 | h2_stream *stream = ctx; | ||
3882 | 651 | h2_mplx *m = stream->session->mplx; | ||
3883 | 652 | |||
3884 | 653 | - check_data_for(m, stream, 0); | ||
3885 | 654 | + mst_check_data_for(m, stream, 0); | ||
3886 | 655 | } | ||
3887 | 656 | |||
3888 | 657 | -static apr_status_t out_open(h2_mplx *m, int stream_id, h2_bucket_beam *beam) | ||
3889 | 658 | +static apr_status_t t_out_open(h2_mplx *m, int stream_id, h2_bucket_beam *beam) | ||
3890 | 659 | { | ||
3891 | 660 | h2_stream *stream = h2_ihash_get(m->streams, stream_id); | ||
3892 | 661 | |||
3893 | 662 | @@ -527,26 +533,26 @@ static apr_status_t out_open(h2_mplx *m, | ||
3894 | 663 | stream->output = beam; | ||
3895 | 664 | |||
3896 | 665 | if (APLOGctrace2(m->c)) { | ||
3897 | 666 | - h2_beam_log(beam, m->c, APLOG_TRACE2, "out_open"); | ||
3898 | 667 | + h2_beam_log(beam, stream->task->c, APLOG_TRACE2, "out_open"); | ||
3899 | 668 | } | ||
3900 | 669 | else { | ||
3901 | 670 | - ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, | ||
3902 | 671 | + ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, stream->task->c, | ||
3903 | 672 | "h2_mplx(%s): out open", stream->task->id); | ||
3904 | 673 | } | ||
3905 | 674 | |||
3906 | 675 | - h2_beam_on_consumed(stream->output, NULL, stream_output_consumed, stream); | ||
3907 | 676 | - h2_beam_on_produced(stream->output, output_produced, stream); | ||
3908 | 677 | + h2_beam_on_consumed(stream->output, NULL, mst_stream_output_consumed, stream); | ||
3909 | 678 | + h2_beam_on_produced(stream->output, mst_output_produced, stream); | ||
3910 | 679 | if (stream->task->output.copy_files) { | ||
3911 | 680 | h2_beam_on_file_beam(stream->output, h2_beam_no_files, NULL); | ||
3912 | 681 | } | ||
3913 | 682 | |||
3914 | 683 | /* we might see some file buckets in the output, see | ||
3915 | 684 | * if we have enough handles reserved. */ | ||
3916 | 685 | - check_data_for(m, stream, 1); | ||
3917 | 686 | + mst_check_data_for(m, stream, 1); | ||
3918 | 687 | return APR_SUCCESS; | ||
3919 | 688 | } | ||
3920 | 689 | |||
3921 | 690 | -apr_status_t h2_mplx_out_open(h2_mplx *m, int stream_id, h2_bucket_beam *beam) | ||
3922 | 691 | +apr_status_t h2_mplx_t_out_open(h2_mplx *m, int stream_id, h2_bucket_beam *beam) | ||
3923 | 692 | { | ||
3924 | 693 | apr_status_t status; | ||
3925 | 694 | |||
3926 | 695 | @@ -556,14 +562,14 @@ apr_status_t h2_mplx_out_open(h2_mplx *m | ||
3927 | 696 | status = APR_ECONNABORTED; | ||
3928 | 697 | } | ||
3929 | 698 | else { | ||
3930 | 699 | - status = out_open(m, stream_id, beam); | ||
3931 | 700 | + status = t_out_open(m, stream_id, beam); | ||
3932 | 701 | } | ||
3933 | 702 | |||
3934 | 703 | H2_MPLX_LEAVE(m); | ||
3935 | 704 | return status; | ||
3936 | 705 | } | ||
3937 | 706 | |||
3938 | 707 | -static apr_status_t out_close(h2_mplx *m, h2_task *task) | ||
3939 | 708 | +static apr_status_t s_out_close(h2_mplx *m, h2_task *task) | ||
3940 | 709 | { | ||
3941 | 710 | apr_status_t status = APR_SUCCESS; | ||
3942 | 711 | h2_stream *stream; | ||
3943 | 712 | @@ -580,17 +586,17 @@ static apr_status_t out_close(h2_mplx *m | ||
3944 | 713 | return APR_ECONNABORTED; | ||
3945 | 714 | } | ||
3946 | 715 | |||
3947 | 716 | - ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, m->c, | ||
3948 | 717 | + ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, task->c, | ||
3949 | 718 | "h2_mplx(%s): close", task->id); | ||
3950 | 719 | status = h2_beam_close(task->output.beam); | ||
3951 | 720 | - h2_beam_log(task->output.beam, m->c, APLOG_TRACE2, "out_close"); | ||
3952 | 721 | - output_consumed_signal(m, task); | ||
3953 | 722 | - check_data_for(m, stream, 1); | ||
3954 | 723 | + h2_beam_log(task->output.beam, task->c, APLOG_TRACE2, "out_close"); | ||
3955 | 724 | + s_output_consumed_signal(m, task); | ||
3956 | 725 | + mst_check_data_for(m, stream, 1); | ||
3957 | 726 | return status; | ||
3958 | 727 | } | ||
3959 | 728 | |||
3960 | 729 | -apr_status_t h2_mplx_out_trywait(h2_mplx *m, apr_interval_time_t timeout, | ||
3961 | 730 | - apr_thread_cond_t *iowait) | ||
3962 | 731 | +apr_status_t h2_mplx_m_out_trywait(h2_mplx *m, apr_interval_time_t timeout, | ||
3963 | 732 | + apr_thread_cond_t *iowait) | ||
3964 | 733 | { | ||
3965 | 734 | apr_status_t status; | ||
3966 | 735 | |||
3967 | 736 | @@ -599,12 +605,12 @@ apr_status_t h2_mplx_out_trywait(h2_mplx | ||
3968 | 737 | if (m->aborted) { | ||
3969 | 738 | status = APR_ECONNABORTED; | ||
3970 | 739 | } | ||
3971 | 740 | - else if (h2_mplx_has_master_events(m)) { | ||
3972 | 741 | + else if (h2_mplx_m_has_master_events(m)) { | ||
3973 | 742 | status = APR_SUCCESS; | ||
3974 | 743 | } | ||
3975 | 744 | else { | ||
3976 | 745 | - purge_streams(m, 0); | ||
3977 | 746 | - h2_ihash_iter(m->streams, report_consumption_iter, m); | ||
3978 | 747 | + m_purge_streams(m, 0); | ||
3979 | 748 | + h2_ihash_iter(m->streams, m_report_consumption_iter, m); | ||
3980 | 749 | m->added_output = iowait; | ||
3981 | 750 | status = apr_thread_cond_timedwait(m->added_output, m->lock, timeout); | ||
3982 | 751 | if (APLOGctrace2(m->c)) { | ||
3983 | 752 | @@ -619,7 +625,7 @@ apr_status_t h2_mplx_out_trywait(h2_mplx | ||
3984 | 753 | return status; | ||
3985 | 754 | } | ||
3986 | 755 | |||
3987 | 756 | -static void check_data_for(h2_mplx *m, h2_stream *stream, int mplx_is_locked) | ||
3988 | 757 | +static void mst_check_data_for(h2_mplx *m, h2_stream *stream, int mplx_is_locked) | ||
3989 | 758 | { | ||
3990 | 759 | /* If m->lock is already held, we must release during h2_ififo_push() | ||
3991 | 760 | * which can wait on its not_full condition, causing a deadlock because | ||
3992 | 761 | @@ -639,7 +645,7 @@ static void check_data_for(h2_mplx *m, h | ||
3993 | 762 | } | ||
3994 | 763 | } | ||
3995 | 764 | |||
3996 | 765 | -apr_status_t h2_mplx_reprioritize(h2_mplx *m, h2_stream_pri_cmp *cmp, void *ctx) | ||
3997 | 766 | +apr_status_t h2_mplx_m_reprioritize(h2_mplx *m, h2_stream_pri_cmp *cmp, void *ctx) | ||
3998 | 767 | { | ||
3999 | 768 | apr_status_t status; | ||
4000 | 769 | |||
4001 | 770 | @@ -659,22 +665,22 @@ apr_status_t h2_mplx_reprioritize(h2_mpl | ||
4002 | 771 | return status; | ||
4003 | 772 | } | ||
4004 | 773 | |||
4005 | 774 | -static void register_if_needed(h2_mplx *m) | ||
4006 | 775 | +static void ms_register_if_needed(h2_mplx *m, int from_master) | ||
4007 | 776 | { | ||
4008 | 777 | if (!m->aborted && !m->is_registered && !h2_iq_empty(m->q)) { | ||
4009 | 778 | apr_status_t status = h2_workers_register(m->workers, m); | ||
4010 | 779 | if (status == APR_SUCCESS) { | ||
4011 | 780 | m->is_registered = 1; | ||
4012 | 781 | } | ||
4013 | 782 | - else { | ||
4014 | 783 | + else if (from_master) { | ||
4015 | 784 | ap_log_cerror(APLOG_MARK, APLOG_ERR, status, m->c, APLOGNO(10021) | ||
4016 | 785 | "h2_mplx(%ld): register at workers", m->id); | ||
4017 | 786 | } | ||
4018 | 787 | } | ||
4019 | 788 | } | ||
4020 | 789 | |||
4021 | 790 | -apr_status_t h2_mplx_process(h2_mplx *m, struct h2_stream *stream, | ||
4022 | 791 | - h2_stream_pri_cmp *cmp, void *ctx) | ||
4023 | 792 | +apr_status_t h2_mplx_m_process(h2_mplx *m, struct h2_stream *stream, | ||
4024 | 793 | + h2_stream_pri_cmp *cmp, void *ctx) | ||
4025 | 794 | { | ||
4026 | 795 | apr_status_t status; | ||
4027 | 796 | |||
4028 | 797 | @@ -688,13 +694,13 @@ apr_status_t h2_mplx_process(h2_mplx *m, | ||
4029 | 798 | h2_ihash_add(m->streams, stream); | ||
4030 | 799 | if (h2_stream_is_ready(stream)) { | ||
4031 | 800 | /* already have a response */ | ||
4032 | 801 | - check_data_for(m, stream, 1); | ||
4033 | 802 | + mst_check_data_for(m, stream, 1); | ||
4034 | 803 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, | ||
4035 | 804 | H2_STRM_MSG(stream, "process, add to readyq")); | ||
4036 | 805 | } | ||
4037 | 806 | else { | ||
4038 | 807 | h2_iq_add(m->q, stream->id, cmp, ctx); | ||
4039 | 808 | - register_if_needed(m); | ||
4040 | 809 | + ms_register_if_needed(m, 1); | ||
4041 | 810 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, | ||
4042 | 811 | H2_STRM_MSG(stream, "process, added to q")); | ||
4043 | 812 | } | ||
4044 | 813 | @@ -704,7 +710,7 @@ apr_status_t h2_mplx_process(h2_mplx *m, | ||
4045 | 814 | return status; | ||
4046 | 815 | } | ||
4047 | 816 | |||
4048 | 817 | -static h2_task *next_stream_task(h2_mplx *m) | ||
4049 | 818 | +static h2_task *s_next_stream_task(h2_mplx *m) | ||
4050 | 819 | { | ||
4051 | 820 | h2_stream *stream; | ||
4052 | 821 | int sid; | ||
4053 | 822 | @@ -713,15 +719,15 @@ static h2_task *next_stream_task(h2_mplx | ||
4054 | 823 | |||
4055 | 824 | stream = h2_ihash_get(m->streams, sid); | ||
4056 | 825 | if (stream) { | ||
4057 | 826 | - conn_rec *slave, **pslave; | ||
4058 | 827 | + conn_rec *secondary, **psecondary; | ||
4059 | 828 | |||
4060 | 829 | - pslave = (conn_rec **)apr_array_pop(m->spare_slaves); | ||
4061 | 830 | - if (pslave) { | ||
4062 | 831 | - slave = *pslave; | ||
4063 | 832 | - slave->aborted = 0; | ||
4064 | 833 | + psecondary = (conn_rec **)apr_array_pop(m->spare_secondary); | ||
4065 | 834 | + if (psecondary) { | ||
4066 | 835 | + secondary = *psecondary; | ||
4067 | 836 | + secondary->aborted = 0; | ||
4068 | 837 | } | ||
4069 | 838 | else { | ||
4070 | 839 | - slave = h2_slave_create(m->c, stream->id, m->pool); | ||
4071 | 840 | + secondary = h2_secondary_create(m->c, stream->id, m->pool); | ||
4072 | 841 | } | ||
4073 | 842 | |||
4074 | 843 | if (!stream->task) { | ||
4075 | 844 | @@ -729,16 +735,16 @@ static h2_task *next_stream_task(h2_mplx | ||
4076 | 845 | m->max_stream_started = sid; | ||
4077 | 846 | } | ||
4078 | 847 | if (stream->input) { | ||
4079 | 848 | - h2_beam_on_consumed(stream->input, stream_input_ev, | ||
4080 | 849 | - stream_input_consumed, stream); | ||
4081 | 850 | + h2_beam_on_consumed(stream->input, mst_stream_input_ev, | ||
4082 | 851 | + m_stream_input_consumed, stream); | ||
4083 | 852 | } | ||
4084 | 853 | |||
4085 | 854 | - stream->task = h2_task_create(slave, stream->id, | ||
4086 | 855 | + stream->task = h2_task_create(secondary, stream->id, | ||
4087 | 856 | stream->request, m, stream->input, | ||
4088 | 857 | stream->session->s->timeout, | ||
4089 | 858 | m->stream_max_mem); | ||
4090 | 859 | if (!stream->task) { | ||
4091 | 860 | - ap_log_cerror(APLOG_MARK, APLOG_ERR, APR_ENOMEM, slave, | ||
4092 | 861 | + ap_log_cerror(APLOG_MARK, APLOG_ERR, APR_ENOMEM, secondary, | ||
4093 | 862 | H2_STRM_LOG(APLOGNO(02941), stream, | ||
4094 | 863 | "create task")); | ||
4095 | 864 | return NULL; | ||
4096 | 865 | @@ -753,7 +759,7 @@ static h2_task *next_stream_task(h2_mplx | ||
4097 | 866 | return NULL; | ||
4098 | 867 | } | ||
4099 | 868 | |||
4100 | 869 | -apr_status_t h2_mplx_pop_task(h2_mplx *m, h2_task **ptask) | ||
4101 | 870 | +apr_status_t h2_mplx_s_pop_task(h2_mplx *m, h2_task **ptask) | ||
4102 | 871 | { | ||
4103 | 872 | apr_status_t rv = APR_EOF; | ||
4104 | 873 | |||
4105 | 874 | @@ -769,7 +775,7 @@ apr_status_t h2_mplx_pop_task(h2_mplx *m | ||
4106 | 875 | rv = APR_EOF; | ||
4107 | 876 | } | ||
4108 | 877 | else { | ||
4109 | 878 | - *ptask = next_stream_task(m); | ||
4110 | 879 | + *ptask = s_next_stream_task(m); | ||
4111 | 880 | rv = (*ptask != NULL && !h2_iq_empty(m->q))? APR_EAGAIN : APR_SUCCESS; | ||
4112 | 881 | } | ||
4113 | 882 | if (APR_EAGAIN != rv) { | ||
4114 | 883 | @@ -779,22 +785,22 @@ apr_status_t h2_mplx_pop_task(h2_mplx *m | ||
4115 | 884 | return rv; | ||
4116 | 885 | } | ||
4117 | 886 | |||
4118 | 887 | -static void task_done(h2_mplx *m, h2_task *task) | ||
4119 | 888 | +static void s_task_done(h2_mplx *m, h2_task *task) | ||
4120 | 889 | { | ||
4121 | 890 | h2_stream *stream; | ||
4122 | 891 | |||
4123 | 892 | - ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, | ||
4124 | 893 | + ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c, | ||
4125 | 894 | "h2_mplx(%ld): task(%s) done", m->id, task->id); | ||
4126 | 895 | - out_close(m, task); | ||
4127 | 896 | + s_out_close(m, task); | ||
4128 | 897 | |||
4129 | 898 | task->worker_done = 1; | ||
4130 | 899 | task->done_at = apr_time_now(); | ||
4131 | 900 | - ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c, | ||
4132 | 901 | + ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, task->c, | ||
4133 | 902 | "h2_mplx(%s): request done, %f ms elapsed", task->id, | ||
4134 | 903 | (task->done_at - task->started_at) / 1000.0); | ||
4135 | 904 | |||
4136 | 905 | if (task->c && !task->c->aborted && task->started_at > m->last_mood_change) { | ||
4137 | 906 | - mplx_be_happy(m); | ||
4138 | 907 | + s_mplx_be_happy(m, task); | ||
4139 | 908 | } | ||
4140 | 909 | |||
4141 | 910 | ap_assert(task->done_done == 0); | ||
4142 | 911 | @@ -806,60 +812,60 @@ static void task_done(h2_mplx *m, h2_tas | ||
4143 | 912 | /* reset and schedule again */ | ||
4144 | 913 | h2_task_redo(task); | ||
4145 | 914 | h2_iq_add(m->q, stream->id, NULL, NULL); | ||
4146 | 915 | - ap_log_cerror(APLOG_MARK, APLOG_INFO, 0, m->c, | ||
4147 | 916 | + ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, task->c, | ||
4148 | 917 | H2_STRM_MSG(stream, "redo, added to q")); | ||
4149 | 918 | } | ||
4150 | 919 | else { | ||
4151 | 920 | /* stream not cleaned up, stay around */ | ||
4152 | 921 | task->done_done = 1; | ||
4153 | 922 | - ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c, | ||
4154 | 923 | + ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, task->c, | ||
4155 | 924 | H2_STRM_MSG(stream, "task_done, stream open")); | ||
4156 | 925 | if (stream->input) { | ||
4157 | 926 | h2_beam_leave(stream->input); | ||
4158 | 927 | } | ||
4159 | 928 | |||
4160 | 929 | /* more data will not arrive, resume the stream */ | ||
4161 | 930 | - check_data_for(m, stream, 1); | ||
4162 | 931 | + mst_check_data_for(m, stream, 1); | ||
4163 | 932 | } | ||
4164 | 933 | } | ||
4165 | 934 | else if ((stream = h2_ihash_get(m->shold, task->stream_id)) != NULL) { | ||
4166 | 935 | /* stream is done, was just waiting for this. */ | ||
4167 | 936 | task->done_done = 1; | ||
4168 | 937 | - ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c, | ||
4169 | 938 | + ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, task->c, | ||
4170 | 939 | H2_STRM_MSG(stream, "task_done, in hold")); | ||
4171 | 940 | if (stream->input) { | ||
4172 | 941 | h2_beam_leave(stream->input); | ||
4173 | 942 | } | ||
4174 | 943 | - stream_joined(m, stream); | ||
4175 | 944 | + ms_stream_joined(m, stream); | ||
4176 | 945 | } | ||
4177 | 946 | else if ((stream = h2_ihash_get(m->spurge, task->stream_id)) != NULL) { | ||
4178 | 947 | - ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, m->c, | ||
4179 | 948 | + ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, task->c, | ||
4180 | 949 | H2_STRM_LOG(APLOGNO(03517), stream, "already in spurge")); | ||
4181 | 950 | ap_assert("stream should not be in spurge" == NULL); | ||
4182 | 951 | } | ||
4183 | 952 | else { | ||
4184 | 953 | - ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, m->c, APLOGNO(03518) | ||
4185 | 954 | + ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, task->c, APLOGNO(03518) | ||
4186 | 955 | "h2_mplx(%s): task_done, stream not found", | ||
4187 | 956 | task->id); | ||
4188 | 957 | ap_assert("stream should still be available" == NULL); | ||
4189 | 958 | } | ||
4190 | 959 | } | ||
4191 | 960 | |||
4192 | 961 | -void h2_mplx_task_done(h2_mplx *m, h2_task *task, h2_task **ptask) | ||
4193 | 962 | +void h2_mplx_s_task_done(h2_mplx *m, h2_task *task, h2_task **ptask) | ||
4194 | 963 | { | ||
4195 | 964 | H2_MPLX_ENTER_ALWAYS(m); | ||
4196 | 965 | |||
4197 | 966 | --m->tasks_active; | ||
4198 | 967 | - task_done(m, task); | ||
4199 | 968 | + s_task_done(m, task); | ||
4200 | 969 | |||
4201 | 970 | if (m->join_wait) { | ||
4202 | 971 | apr_thread_cond_signal(m->join_wait); | ||
4203 | 972 | } | ||
4204 | 973 | if (ptask) { | ||
4205 | 974 | /* caller wants another task */ | ||
4206 | 975 | - *ptask = next_stream_task(m); | ||
4207 | 976 | + *ptask = s_next_stream_task(m); | ||
4208 | 977 | } | ||
4209 | 978 | - register_if_needed(m); | ||
4210 | 979 | + ms_register_if_needed(m, 0); | ||
4211 | 980 | |||
4212 | 981 | H2_MPLX_LEAVE(m); | ||
4213 | 982 | } | ||
4214 | 983 | @@ -868,7 +874,7 @@ void h2_mplx_task_done(h2_mplx *m, h2_ta | ||
4215 | 984 | * h2_mplx DoS protection | ||
4216 | 985 | ******************************************************************************/ | ||
4217 | 986 | |||
4218 | 987 | -static int timed_out_busy_iter(void *data, void *val) | ||
4219 | 988 | +static int m_timed_out_busy_iter(void *data, void *val) | ||
4220 | 989 | { | ||
4221 | 990 | stream_iter_ctx *ctx = data; | ||
4222 | 991 | h2_stream *stream = val; | ||
4223 | 992 | @@ -881,17 +887,17 @@ static int timed_out_busy_iter(void *dat | ||
4224 | 993 | return 1; | ||
4225 | 994 | } | ||
4226 | 995 | |||
4227 | 996 | -static h2_stream *get_timed_out_busy_stream(h2_mplx *m) | ||
4228 | 997 | +static h2_stream *m_get_timed_out_busy_stream(h2_mplx *m) | ||
4229 | 998 | { | ||
4230 | 999 | stream_iter_ctx ctx; | ||
4231 | 1000 | ctx.m = m; | ||
4232 | 1001 | ctx.stream = NULL; | ||
4233 | 1002 | ctx.now = apr_time_now(); | ||
4234 | 1003 | - h2_ihash_iter(m->streams, timed_out_busy_iter, &ctx); | ||
4235 | 1004 | + h2_ihash_iter(m->streams, m_timed_out_busy_iter, &ctx); | ||
4236 | 1005 | return ctx.stream; | ||
4237 | 1006 | } | ||
4238 | 1007 | |||
4239 | 1008 | -static int latest_repeatable_unsubmitted_iter(void *data, void *val) | ||
4240 | 1009 | +static int m_latest_repeatable_unsubmitted_iter(void *data, void *val) | ||
4241 | 1010 | { | ||
4242 | 1011 | stream_iter_ctx *ctx = data; | ||
4243 | 1012 | h2_stream *stream = val; | ||
4244 | 1013 | @@ -917,7 +923,7 @@ leave: | ||
4245 | 1014 | return 1; | ||
4246 | 1015 | } | ||
4247 | 1016 | |||
4248 | 1017 | -static apr_status_t assess_task_to_throttle(h2_task **ptask, h2_mplx *m) | ||
4249 | 1018 | +static apr_status_t m_assess_task_to_throttle(h2_task **ptask, h2_mplx *m) | ||
4250 | 1019 | { | ||
4251 | 1020 | stream_iter_ctx ctx; | ||
4252 | 1021 | |||
4253 | 1022 | @@ -927,7 +933,7 @@ static apr_status_t assess_task_to_throt | ||
4254 | 1023 | ctx.m = m; | ||
4255 | 1024 | ctx.stream = NULL; | ||
4256 | 1025 | ctx.count = 0; | ||
4257 | 1026 | - h2_ihash_iter(m->streams, latest_repeatable_unsubmitted_iter, &ctx); | ||
4258 | 1027 | + h2_ihash_iter(m->streams, m_latest_repeatable_unsubmitted_iter, &ctx); | ||
4259 | 1028 | if (m->tasks_active - ctx.count > m->limit_active) { | ||
4260 | 1029 | /* we are above the limit of running tasks, accounting for the ones | ||
4261 | 1030 | * already throttled. */ | ||
4262 | 1031 | @@ -936,7 +942,7 @@ static apr_status_t assess_task_to_throt | ||
4263 | 1032 | return APR_EAGAIN; | ||
4264 | 1033 | } | ||
4265 | 1034 | /* above limit, be seeing no candidate for easy throttling */ | ||
4266 | 1035 | - if (get_timed_out_busy_stream(m)) { | ||
4267 | 1036 | + if (m_get_timed_out_busy_stream(m)) { | ||
4268 | 1037 | /* Too many busy workers, unable to cancel enough streams | ||
4269 | 1038 | * and with a busy, timed out stream, we tell the client | ||
4270 | 1039 | * to go away... */ | ||
4271 | 1040 | @@ -946,7 +952,7 @@ static apr_status_t assess_task_to_throt | ||
4272 | 1041 | return APR_SUCCESS; | ||
4273 | 1042 | } | ||
4274 | 1043 | |||
4275 | 1044 | -static apr_status_t unschedule_slow_tasks(h2_mplx *m) | ||
4276 | 1045 | +static apr_status_t m_unschedule_slow_tasks(h2_mplx *m) | ||
4277 | 1046 | { | ||
4278 | 1047 | h2_task *task; | ||
4279 | 1048 | apr_status_t rv; | ||
4280 | 1049 | @@ -954,7 +960,7 @@ static apr_status_t unschedule_slow_task | ||
4281 | 1050 | /* Try to get rid of streams that occupy workers. Look for safe requests | ||
4282 | 1051 | * that are repeatable. If none found, fail the connection. | ||
4283 | 1052 | */ | ||
4284 | 1053 | - while (APR_EAGAIN == (rv = assess_task_to_throttle(&task, m))) { | ||
4285 | 1054 | + while (APR_EAGAIN == (rv = m_assess_task_to_throttle(&task, m))) { | ||
4286 | 1055 | ap_log_cerror(APLOG_MARK, APLOG_TRACE2, 0, m->c, | ||
4287 | 1056 | "h2_mplx(%s): unschedule, resetting task for redo later", | ||
4288 | 1057 | task->id); | ||
4289 | 1058 | @@ -965,7 +971,7 @@ static apr_status_t unschedule_slow_task | ||
4290 | 1059 | return rv; | ||
4291 | 1060 | } | ||
4292 | 1061 | |||
4293 | 1062 | -static apr_status_t mplx_be_happy(h2_mplx *m) | ||
4294 | 1063 | +static apr_status_t s_mplx_be_happy(h2_mplx *m, h2_task *task) | ||
4295 | 1064 | { | ||
4296 | 1065 | apr_time_t now; | ||
4297 | 1066 | |||
4298 | 1067 | @@ -977,14 +983,14 @@ static apr_status_t mplx_be_happy(h2_mpl | ||
4299 | 1068 | m->limit_active = H2MIN(m->limit_active * 2, m->max_active); | ||
4300 | 1069 | m->last_mood_change = now; | ||
4301 | 1070 | m->irritations_since = 0; | ||
4302 | 1071 | - ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, | ||
4303 | 1072 | + ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, task->c, | ||
4304 | 1073 | "h2_mplx(%ld): mood update, increasing worker limit to %d", | ||
4305 | 1074 | m->id, m->limit_active); | ||
4306 | 1075 | } | ||
4307 | 1076 | return APR_SUCCESS; | ||
4308 | 1077 | } | ||
4309 | 1078 | |||
4310 | 1079 | -static apr_status_t mplx_be_annoyed(h2_mplx *m) | ||
4311 | 1080 | +static apr_status_t m_be_annoyed(h2_mplx *m) | ||
4312 | 1081 | { | ||
4313 | 1082 | apr_status_t status = APR_SUCCESS; | ||
4314 | 1083 | apr_time_t now; | ||
4315 | 1084 | @@ -1015,12 +1021,12 @@ static apr_status_t mplx_be_annoyed(h2_m | ||
4316 | 1085 | } | ||
4317 | 1086 | |||
4318 | 1087 | if (m->tasks_active > m->limit_active) { | ||
4319 | 1088 | - status = unschedule_slow_tasks(m); | ||
4320 | 1089 | + status = m_unschedule_slow_tasks(m); | ||
4321 | 1090 | } | ||
4322 | 1091 | return status; | ||
4323 | 1092 | } | ||
4324 | 1093 | |||
4325 | 1094 | -apr_status_t h2_mplx_idle(h2_mplx *m) | ||
4326 | 1095 | +apr_status_t h2_mplx_m_idle(h2_mplx *m) | ||
4327 | 1096 | { | ||
4328 | 1097 | apr_status_t status = APR_SUCCESS; | ||
4329 | 1098 | apr_size_t scount; | ||
4330 | 1099 | @@ -1042,7 +1048,7 @@ apr_status_t h2_mplx_idle(h2_mplx *m) | ||
4331 | 1100 | * of busy workers we allow for this connection until it | ||
4332 | 1101 | * well behaves. | ||
4333 | 1102 | */ | ||
4334 | 1103 | - status = mplx_be_annoyed(m); | ||
4335 | 1104 | + status = m_be_annoyed(m); | ||
4336 | 1105 | } | ||
4337 | 1106 | else if (!h2_iq_empty(m->q)) { | ||
4338 | 1107 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, m->c, | ||
4339 | 1108 | @@ -1072,14 +1078,14 @@ apr_status_t h2_mplx_idle(h2_mplx *m) | ||
4340 | 1109 | h2_beam_is_closed(stream->output), | ||
4341 | 1110 | (long)h2_beam_get_buffered(stream->output)); | ||
4342 | 1111 | h2_ihash_add(m->streams, stream); | ||
4343 | 1112 | - check_data_for(m, stream, 1); | ||
4344 | 1113 | + mst_check_data_for(m, stream, 1); | ||
4345 | 1114 | stream->out_checked = 1; | ||
4346 | 1115 | status = APR_EAGAIN; | ||
4347 | 1116 | } | ||
4348 | 1117 | } | ||
4349 | 1118 | } | ||
4350 | 1119 | } | ||
4351 | 1120 | - register_if_needed(m); | ||
4352 | 1121 | + ms_register_if_needed(m, 1); | ||
4353 | 1122 | |||
4354 | 1123 | H2_MPLX_LEAVE(m); | ||
4355 | 1124 | return status; | ||
4356 | 1125 | @@ -1089,14 +1095,13 @@ apr_status_t h2_mplx_idle(h2_mplx *m) | ||
4357 | 1126 | * mplx master events dispatching | ||
4358 | 1127 | ******************************************************************************/ | ||
4359 | 1128 | |||
4360 | 1129 | -int h2_mplx_has_master_events(h2_mplx *m) | ||
4361 | 1130 | +int h2_mplx_m_has_master_events(h2_mplx *m) | ||
4362 | 1131 | { | ||
4363 | 1132 | return apr_atomic_read32(&m->event_pending) > 0; | ||
4364 | 1133 | } | ||
4365 | 1134 | |||
4366 | 1135 | -apr_status_t h2_mplx_dispatch_master_events(h2_mplx *m, | ||
4367 | 1136 | - stream_ev_callback *on_resume, | ||
4368 | 1137 | - void *on_ctx) | ||
4369 | 1138 | +apr_status_t h2_mplx_m_dispatch_master_events(h2_mplx *m, stream_ev_callback *on_resume, | ||
4370 | 1139 | + void *on_ctx) | ||
4371 | 1140 | { | ||
4372 | 1141 | h2_stream *stream; | ||
4373 | 1142 | int n, id; | ||
4374 | 1143 | @@ -1106,8 +1111,8 @@ apr_status_t h2_mplx_dispatch_master_eve | ||
4375 | 1144 | apr_atomic_set32(&m->event_pending, 0); | ||
4376 | 1145 | |||
4377 | 1146 | /* update input windows for streams */ | ||
4378 | 1147 | - h2_ihash_iter(m->streams, report_consumption_iter, m); | ||
4379 | 1148 | - purge_streams(m, 1); | ||
4380 | 1149 | + h2_ihash_iter(m->streams, m_report_consumption_iter, m); | ||
4381 | 1150 | + m_purge_streams(m, 1); | ||
4382 | 1151 | |||
4383 | 1152 | n = h2_ififo_count(m->readyq); | ||
4384 | 1153 | while (n > 0 | ||
4385 | 1154 | @@ -1122,13 +1127,13 @@ apr_status_t h2_mplx_dispatch_master_eve | ||
4386 | 1155 | return APR_SUCCESS; | ||
4387 | 1156 | } | ||
4388 | 1157 | |||
4389 | 1158 | -apr_status_t h2_mplx_keep_active(h2_mplx *m, h2_stream *stream) | ||
4390 | 1159 | +apr_status_t h2_mplx_m_keep_active(h2_mplx *m, h2_stream *stream) | ||
4391 | 1160 | { | ||
4392 | 1161 | - check_data_for(m, stream, 0); | ||
4393 | 1162 | + mst_check_data_for(m, stream, 0); | ||
4394 | 1163 | return APR_SUCCESS; | ||
4395 | 1164 | } | ||
4396 | 1165 | |||
4397 | 1166 | -int h2_mplx_awaits_data(h2_mplx *m) | ||
4398 | 1167 | +int h2_mplx_m_awaits_data(h2_mplx *m) | ||
4399 | 1168 | { | ||
4400 | 1169 | int waiting = 1; | ||
4401 | 1170 | |||
4402 | 1171 | @@ -1145,7 +1150,7 @@ int h2_mplx_awaits_data(h2_mplx *m) | ||
4403 | 1172 | return waiting; | ||
4404 | 1173 | } | ||
4405 | 1174 | |||
4406 | 1175 | -apr_status_t h2_mplx_client_rst(h2_mplx *m, int stream_id) | ||
4407 | 1176 | +apr_status_t h2_mplx_m_client_rst(h2_mplx *m, int stream_id) | ||
4408 | 1177 | { | ||
4409 | 1178 | h2_stream *stream; | ||
4410 | 1179 | apr_status_t status = APR_SUCCESS; | ||
4411 | 1180 | @@ -1153,7 +1158,7 @@ apr_status_t h2_mplx_client_rst(h2_mplx | ||
4412 | 1181 | H2_MPLX_ENTER_ALWAYS(m); | ||
4413 | 1182 | stream = h2_ihash_get(m->streams, stream_id); | ||
4414 | 1183 | if (stream && stream->task) { | ||
4415 | 1184 | - status = mplx_be_annoyed(m); | ||
4416 | 1185 | + status = m_be_annoyed(m); | ||
4417 | 1186 | } | ||
4418 | 1187 | H2_MPLX_LEAVE(m); | ||
4419 | 1188 | return status; | ||
4420 | 1189 | --- a/modules/http2/h2_mplx.h | ||
4421 | 1190 | +++ b/modules/http2/h2_mplx.h | ||
4422 | 1191 | @@ -31,8 +31,10 @@ | ||
4423 | 1192 | * queued in the multiplexer. If a task thread tries to write more | ||
4424 | 1193 | * data, it is blocked until space becomes available. | ||
4425 | 1194 | * | ||
4426 | 1195 | - * Writing input is never blocked. In order to use flow control on the input, | ||
4427 | 1196 | - * the mplx can be polled for input data consumption. | ||
4428 | 1197 | + * Naming Convention: | ||
4429 | 1198 | + * "h2_mplx_m_" are methods only to be called by the main connection | ||
4430 | 1199 | + * "h2_mplx_s_" are method only to be called by a secondary connection | ||
4431 | 1200 | + * "h2_mplx_t_" are method only to be called by a task handler (can be master or secondary) | ||
4432 | 1201 | */ | ||
4433 | 1202 | |||
4434 | 1203 | struct apr_pool_t; | ||
4435 | 1204 | @@ -88,25 +90,23 @@ struct h2_mplx { | ||
4436 | 1205 | apr_size_t stream_max_mem; | ||
4437 | 1206 | |||
4438 | 1207 | apr_pool_t *spare_io_pool; | ||
4439 | 1208 | - apr_array_header_t *spare_slaves; /* spare slave connections */ | ||
4440 | 1209 | + apr_array_header_t *spare_secondary; /* spare secondary connections */ | ||
4441 | 1210 | |||
4442 | 1211 | struct h2_workers *workers; | ||
4443 | 1212 | }; | ||
4444 | 1213 | |||
4445 | 1214 | - | ||
4446 | 1215 | - | ||
4447 | 1216 | /******************************************************************************* | ||
4448 | 1217 | - * Object lifecycle and information. | ||
4449 | 1218 | + * From the main connection processing: h2_mplx_m_* | ||
4450 | 1219 | ******************************************************************************/ | ||
4451 | 1220 | |||
4452 | 1221 | -apr_status_t h2_mplx_child_init(apr_pool_t *pool, server_rec *s); | ||
4453 | 1222 | +apr_status_t h2_mplx_m_child_init(apr_pool_t *pool, server_rec *s); | ||
4454 | 1223 | |||
4455 | 1224 | /** | ||
4456 | 1225 | * Create the multiplexer for the given HTTP2 session. | ||
4457 | 1226 | * Implicitly has reference count 1. | ||
4458 | 1227 | */ | ||
4459 | 1228 | -h2_mplx *h2_mplx_create(conn_rec *c, server_rec *s, apr_pool_t *master, | ||
4460 | 1229 | - struct h2_workers *workers); | ||
4461 | 1230 | +h2_mplx *h2_mplx_m_create(conn_rec *c, server_rec *s, apr_pool_t *master, | ||
4462 | 1231 | + struct h2_workers *workers); | ||
4463 | 1232 | |||
4464 | 1233 | /** | ||
4465 | 1234 | * Decreases the reference counter of this mplx and waits for it | ||
4466 | 1235 | @@ -116,26 +116,14 @@ h2_mplx *h2_mplx_create(conn_rec *c, ser | ||
4467 | 1236 | * @param m the mplx to be released and destroyed | ||
4468 | 1237 | * @param wait condition var to wait on for ref counter == 0 | ||
4469 | 1238 | */ | ||
4470 | 1239 | -void h2_mplx_release_and_join(h2_mplx *m, struct apr_thread_cond_t *wait); | ||
4471 | 1240 | - | ||
4472 | 1241 | -apr_status_t h2_mplx_pop_task(h2_mplx *m, struct h2_task **ptask); | ||
4473 | 1242 | - | ||
4474 | 1243 | -void h2_mplx_task_done(h2_mplx *m, struct h2_task *task, struct h2_task **ptask); | ||
4475 | 1244 | +void h2_mplx_m_release_and_join(h2_mplx *m, struct apr_thread_cond_t *wait); | ||
4476 | 1245 | |||
4477 | 1246 | /** | ||
4478 | 1247 | * Shut down the multiplexer gracefully. Will no longer schedule new streams | ||
4479 | 1248 | * but let the ongoing ones finish normally. | ||
4480 | 1249 | * @return the highest stream id being/been processed | ||
4481 | 1250 | */ | ||
4482 | 1251 | -int h2_mplx_shutdown(h2_mplx *m); | ||
4483 | 1252 | - | ||
4484 | 1253 | -int h2_mplx_is_busy(h2_mplx *m); | ||
4485 | 1254 | - | ||
4486 | 1255 | -/******************************************************************************* | ||
4487 | 1256 | - * IO lifetime of streams. | ||
4488 | 1257 | - ******************************************************************************/ | ||
4489 | 1258 | - | ||
4490 | 1259 | -struct h2_stream *h2_mplx_stream_get(h2_mplx *m, int id); | ||
4491 | 1260 | +int h2_mplx_m_shutdown(h2_mplx *m); | ||
4492 | 1261 | |||
4493 | 1262 | /** | ||
4494 | 1263 | * Notifies mplx that a stream has been completely handled on the main | ||
4495 | 1264 | @@ -144,20 +132,16 @@ struct h2_stream *h2_mplx_stream_get(h2_ | ||
4496 | 1265 | * @param m the mplx itself | ||
4497 | 1266 | * @param stream the stream ready for cleanup | ||
4498 | 1267 | */ | ||
4499 | 1268 | -apr_status_t h2_mplx_stream_cleanup(h2_mplx *m, struct h2_stream *stream); | ||
4500 | 1269 | +apr_status_t h2_mplx_m_stream_cleanup(h2_mplx *m, struct h2_stream *stream); | ||
4501 | 1270 | |||
4502 | 1271 | /** | ||
4503 | 1272 | * Waits on output data from any stream in this session to become available. | ||
4504 | 1273 | * Returns APR_TIMEUP if no data arrived in the given time. | ||
4505 | 1274 | */ | ||
4506 | 1275 | -apr_status_t h2_mplx_out_trywait(h2_mplx *m, apr_interval_time_t timeout, | ||
4507 | 1276 | - struct apr_thread_cond_t *iowait); | ||
4508 | 1277 | - | ||
4509 | 1278 | -apr_status_t h2_mplx_keep_active(h2_mplx *m, struct h2_stream *stream); | ||
4510 | 1279 | +apr_status_t h2_mplx_m_out_trywait(h2_mplx *m, apr_interval_time_t timeout, | ||
4511 | 1280 | + struct apr_thread_cond_t *iowait); | ||
4512 | 1281 | |||
4513 | 1282 | -/******************************************************************************* | ||
4514 | 1283 | - * Stream processing. | ||
4515 | 1284 | - ******************************************************************************/ | ||
4516 | 1285 | +apr_status_t h2_mplx_m_keep_active(h2_mplx *m, struct h2_stream *stream); | ||
4517 | 1286 | |||
4518 | 1287 | /** | ||
4519 | 1288 | * Process a stream request. | ||
4520 | 1289 | @@ -168,8 +152,8 @@ apr_status_t h2_mplx_keep_active(h2_mplx | ||
4521 | 1290 | * @param cmp the stream priority compare function | ||
4522 | 1291 | * @param ctx context data for the compare function | ||
4523 | 1292 | */ | ||
4524 | 1293 | -apr_status_t h2_mplx_process(h2_mplx *m, struct h2_stream *stream, | ||
4525 | 1294 | - h2_stream_pri_cmp *cmp, void *ctx); | ||
4526 | 1295 | +apr_status_t h2_mplx_m_process(h2_mplx *m, struct h2_stream *stream, | ||
4527 | 1296 | + h2_stream_pri_cmp *cmp, void *ctx); | ||
4528 | 1297 | |||
4529 | 1298 | /** | ||
4530 | 1299 | * Stream priorities have changed, reschedule pending requests. | ||
4531 | 1300 | @@ -178,7 +162,7 @@ apr_status_t h2_mplx_process(h2_mplx *m, | ||
4532 | 1301 | * @param cmp the stream priority compare function | ||
4533 | 1302 | * @param ctx context data for the compare function | ||
4534 | 1303 | */ | ||
4535 | 1304 | -apr_status_t h2_mplx_reprioritize(h2_mplx *m, h2_stream_pri_cmp *cmp, void *ctx); | ||
4536 | 1305 | +apr_status_t h2_mplx_m_reprioritize(h2_mplx *m, h2_stream_pri_cmp *cmp, void *ctx); | ||
4537 | 1306 | |||
4538 | 1307 | typedef apr_status_t stream_ev_callback(void *ctx, struct h2_stream *stream); | ||
4539 | 1308 | |||
4540 | 1309 | @@ -186,7 +170,7 @@ typedef apr_status_t stream_ev_callback( | ||
4541 | 1310 | * Check if the multiplexer has events for the master connection pending. | ||
4542 | 1311 | * @return != 0 iff there are events pending | ||
4543 | 1312 | */ | ||
4544 | 1313 | -int h2_mplx_has_master_events(h2_mplx *m); | ||
4545 | 1314 | +int h2_mplx_m_has_master_events(h2_mplx *m); | ||
4546 | 1315 | |||
4547 | 1316 | /** | ||
4548 | 1317 | * Dispatch events for the master connection, such as | ||
4549 | 1318 | @@ -194,108 +178,46 @@ int h2_mplx_has_master_events(h2_mplx *m | ||
4550 | 1319 | * @param on_resume new output data has arrived for a suspended stream | ||
4551 | 1320 | * @param ctx user supplied argument to invocation. | ||
4552 | 1321 | */ | ||
4553 | 1322 | -apr_status_t h2_mplx_dispatch_master_events(h2_mplx *m, | ||
4554 | 1323 | - stream_ev_callback *on_resume, | ||
4555 | 1324 | - void *ctx); | ||
4556 | 1325 | +apr_status_t h2_mplx_m_dispatch_master_events(h2_mplx *m, stream_ev_callback *on_resume, | ||
4557 | 1326 | + void *ctx); | ||
4558 | 1327 | |||
4559 | 1328 | -int h2_mplx_awaits_data(h2_mplx *m); | ||
4560 | 1329 | +int h2_mplx_m_awaits_data(h2_mplx *m); | ||
4561 | 1330 | |||
4562 | 1331 | typedef int h2_mplx_stream_cb(struct h2_stream *s, void *ctx); | ||
4563 | 1332 | |||
4564 | 1333 | -apr_status_t h2_mplx_stream_do(h2_mplx *m, h2_mplx_stream_cb *cb, void *ctx); | ||
4565 | 1334 | +apr_status_t h2_mplx_m_stream_do(h2_mplx *m, h2_mplx_stream_cb *cb, void *ctx); | ||
4566 | 1335 | |||
4567 | 1336 | -apr_status_t h2_mplx_client_rst(h2_mplx *m, int stream_id); | ||
4568 | 1337 | - | ||
4569 | 1338 | -/******************************************************************************* | ||
4570 | 1339 | - * Output handling of streams. | ||
4571 | 1340 | - ******************************************************************************/ | ||
4572 | 1341 | +apr_status_t h2_mplx_m_client_rst(h2_mplx *m, int stream_id); | ||
4573 | 1342 | |||
4574 | 1343 | /** | ||
4575 | 1344 | - * Opens the output for the given stream with the specified response. | ||
4576 | 1345 | + * Master connection has entered idle mode. | ||
4577 | 1346 | + * @param m the mplx instance of the master connection | ||
4578 | 1347 | + * @return != SUCCESS iff connection should be terminated | ||
4579 | 1348 | */ | ||
4580 | 1349 | -apr_status_t h2_mplx_out_open(h2_mplx *mplx, int stream_id, | ||
4581 | 1350 | - struct h2_bucket_beam *beam); | ||
4582 | 1351 | +apr_status_t h2_mplx_m_idle(h2_mplx *m); | ||
4583 | 1352 | |||
4584 | 1353 | /******************************************************************************* | ||
4585 | 1354 | - * h2_mplx list Manipulation. | ||
4586 | 1355 | + * From a secondary connection processing: h2_mplx_s_* | ||
4587 | 1356 | ******************************************************************************/ | ||
4588 | 1357 | +apr_status_t h2_mplx_s_pop_task(h2_mplx *m, struct h2_task **ptask); | ||
4589 | 1358 | +void h2_mplx_s_task_done(h2_mplx *m, struct h2_task *task, struct h2_task **ptask); | ||
4590 | 1359 | |||
4591 | 1360 | -/** | ||
4592 | 1361 | - * The magic pointer value that indicates the head of a h2_mplx list | ||
4593 | 1362 | - * @param b The mplx list | ||
4594 | 1363 | - * @return The magic pointer value | ||
4595 | 1364 | - */ | ||
4596 | 1365 | -#define H2_MPLX_LIST_SENTINEL(b) APR_RING_SENTINEL((b), h2_mplx, link) | ||
4597 | 1366 | - | ||
4598 | 1367 | -/** | ||
4599 | 1368 | - * Determine if the mplx list is empty | ||
4600 | 1369 | - * @param b The list to check | ||
4601 | 1370 | - * @return true or false | ||
4602 | 1371 | - */ | ||
4603 | 1372 | -#define H2_MPLX_LIST_EMPTY(b) APR_RING_EMPTY((b), h2_mplx, link) | ||
4604 | 1373 | - | ||
4605 | 1374 | -/** | ||
4606 | 1375 | - * Return the first mplx in a list | ||
4607 | 1376 | - * @param b The list to query | ||
4608 | 1377 | - * @return The first mplx in the list | ||
4609 | 1378 | - */ | ||
4610 | 1379 | -#define H2_MPLX_LIST_FIRST(b) APR_RING_FIRST(b) | ||
4611 | 1380 | - | ||
4612 | 1381 | -/** | ||
4613 | 1382 | - * Return the last mplx in a list | ||
4614 | 1383 | - * @param b The list to query | ||
4615 | 1384 | - * @return The last mplx int he list | ||
4616 | 1385 | - */ | ||
4617 | 1386 | -#define H2_MPLX_LIST_LAST(b) APR_RING_LAST(b) | ||
4618 | 1387 | - | ||
4619 | 1388 | -/** | ||
4620 | 1389 | - * Insert a single mplx at the front of a list | ||
4621 | 1390 | - * @param b The list to add to | ||
4622 | 1391 | - * @param e The mplx to insert | ||
4623 | 1392 | - */ | ||
4624 | 1393 | -#define H2_MPLX_LIST_INSERT_HEAD(b, e) do { \ | ||
4625 | 1394 | -h2_mplx *ap__b = (e); \ | ||
4626 | 1395 | -APR_RING_INSERT_HEAD((b), ap__b, h2_mplx, link); \ | ||
4627 | 1396 | -} while (0) | ||
4628 | 1397 | - | ||
4629 | 1398 | -/** | ||
4630 | 1399 | - * Insert a single mplx at the end of a list | ||
4631 | 1400 | - * @param b The list to add to | ||
4632 | 1401 | - * @param e The mplx to insert | ||
4633 | 1402 | - */ | ||
4634 | 1403 | -#define H2_MPLX_LIST_INSERT_TAIL(b, e) do { \ | ||
4635 | 1404 | -h2_mplx *ap__b = (e); \ | ||
4636 | 1405 | -APR_RING_INSERT_TAIL((b), ap__b, h2_mplx, link); \ | ||
4637 | 1406 | -} while (0) | ||
4638 | 1407 | +/******************************************************************************* | ||
4639 | 1408 | + * From a h2_task owner: h2_mplx_s_* | ||
4640 | 1409 | + * (a task is transfered from master to secondary connection and back in | ||
4641 | 1410 | + * its normal lifetime). | ||
4642 | 1411 | + ******************************************************************************/ | ||
4643 | 1412 | |||
4644 | 1413 | /** | ||
4645 | 1414 | - * Get the next mplx in the list | ||
4646 | 1415 | - * @param e The current mplx | ||
4647 | 1416 | - * @return The next mplx | ||
4648 | 1417 | - */ | ||
4649 | 1418 | -#define H2_MPLX_NEXT(e) APR_RING_NEXT((e), link) | ||
4650 | 1419 | -/** | ||
4651 | 1420 | - * Get the previous mplx in the list | ||
4652 | 1421 | - * @param e The current mplx | ||
4653 | 1422 | - * @return The previous mplx | ||
4654 | 1423 | + * Opens the output for the given stream with the specified response. | ||
4655 | 1424 | */ | ||
4656 | 1425 | -#define H2_MPLX_PREV(e) APR_RING_PREV((e), link) | ||
4657 | 1426 | +apr_status_t h2_mplx_t_out_open(h2_mplx *mplx, int stream_id, | ||
4658 | 1427 | + struct h2_bucket_beam *beam); | ||
4659 | 1428 | |||
4660 | 1429 | /** | ||
4661 | 1430 | - * Remove a mplx from its list | ||
4662 | 1431 | - * @param e The mplx to remove | ||
4663 | 1432 | + * Get the stream that belongs to the given task. | ||
4664 | 1433 | */ | ||
4665 | 1434 | -#define H2_MPLX_REMOVE(e) APR_RING_REMOVE((e), link) | ||
4666 | 1435 | - | ||
4667 | 1436 | -/******************************************************************************* | ||
4668 | 1437 | - * h2_mplx DoS protection | ||
4669 | 1438 | - ******************************************************************************/ | ||
4670 | 1439 | +struct h2_stream *h2_mplx_t_stream_get(h2_mplx *m, struct h2_task *task); | ||
4671 | 1440 | |||
4672 | 1441 | -/** | ||
4673 | 1442 | - * Master connection has entered idle mode. | ||
4674 | 1443 | - * @param m the mplx instance of the master connection | ||
4675 | 1444 | - * @return != SUCCESS iff connection should be terminated | ||
4676 | 1445 | - */ | ||
4677 | 1446 | -apr_status_t h2_mplx_idle(h2_mplx *m); | ||
4678 | 1447 | |||
4679 | 1448 | #endif /* defined(__mod_h2__h2_mplx__) */ | ||
4680 | 1449 | --- a/modules/http2/h2_request.c | ||
4681 | 1450 | +++ b/modules/http2/h2_request.c | ||
4682 | 1451 | @@ -288,6 +288,9 @@ request_rec *h2_request_create_rec(const | ||
4683 | 1452 | if (r->method_number == M_GET && r->method[0] == 'H') { | ||
4684 | 1453 | r->header_only = 1; | ||
4685 | 1454 | } | ||
4686 | 1455 | + r->the_request = apr_psprintf(r->pool, "%s %s HTTP/2.0", | ||
4687 | 1456 | + req->method, req->path ? req->path : ""); | ||
4688 | 1457 | + r->headers_in = apr_table_clone(r->pool, req->headers); | ||
4689 | 1458 | |||
4690 | 1459 | rpath = (req->path ? req->path : ""); | ||
4691 | 1460 | ap_parse_uri(r, rpath); | ||
4692 | 1461 | @@ -304,7 +307,9 @@ request_rec *h2_request_create_rec(const | ||
4693 | 1462 | */ | ||
4694 | 1463 | r->hostname = NULL; | ||
4695 | 1464 | ap_update_vhost_from_headers(r); | ||
4696 | 1465 | - | ||
4697 | 1466 | + r->protocol = "HTTP/2.0"; | ||
4698 | 1467 | + r->proto_num = HTTP_VERSION(2, 0); | ||
4699 | 1468 | + | ||
4700 | 1469 | /* we may have switched to another server */ | ||
4701 | 1470 | r->per_dir_config = r->server->lookup_defaults; | ||
4702 | 1471 | |||
4703 | 1472 | --- a/modules/http2/h2_session.c | ||
4704 | 1473 | +++ b/modules/http2/h2_session.c | ||
4705 | 1474 | @@ -106,7 +106,7 @@ static int rst_unprocessed_stream(h2_str | ||
4706 | 1475 | |||
4707 | 1476 | static void cleanup_unprocessed_streams(h2_session *session) | ||
4708 | 1477 | { | ||
4709 | 1478 | - h2_mplx_stream_do(session->mplx, rst_unprocessed_stream, session); | ||
4710 | 1479 | + h2_mplx_m_stream_do(session->mplx, rst_unprocessed_stream, session); | ||
4711 | 1480 | } | ||
4712 | 1481 | |||
4713 | 1482 | static h2_stream *h2_session_open_stream(h2_session *session, int stream_id, | ||
4714 | 1483 | @@ -397,7 +397,7 @@ static int on_frame_recv_cb(nghttp2_sess | ||
4715 | 1484 | else { | ||
4716 | 1485 | /* A stream reset on a request it sent us. Could happen in a browser | ||
4717 | 1486 | * when the user navigates away or cancels loading - maybe. */ | ||
4718 | 1487 | - h2_mplx_client_rst(session->mplx, frame->hd.stream_id); | ||
4719 | 1488 | + h2_mplx_m_client_rst(session->mplx, frame->hd.stream_id); | ||
4720 | 1489 | ++session->streams_reset; | ||
4721 | 1490 | } | ||
4722 | 1491 | break; | ||
4723 | 1492 | @@ -467,7 +467,7 @@ static int on_frame_recv_cb(nghttp2_sess | ||
4724 | 1493 | } | ||
4725 | 1494 | |||
4726 | 1495 | static int h2_session_continue_data(h2_session *session) { | ||
4727 | 1496 | - if (h2_mplx_has_master_events(session->mplx)) { | ||
4728 | 1497 | + if (h2_mplx_m_has_master_events(session->mplx)) { | ||
4729 | 1498 | return 0; | ||
4730 | 1499 | } | ||
4731 | 1500 | if (h2_conn_io_needs_flush(&session->io)) { | ||
4732 | 1501 | @@ -729,7 +729,7 @@ static apr_status_t h2_session_shutdown( | ||
4733 | 1502 | * Remove all streams greater than this number without submitting | ||
4734 | 1503 | * a RST_STREAM frame, since that should be clear from the GOAWAY | ||
4735 | 1504 | * we send. */ | ||
4736 | 1505 | - session->local.accepted_max = h2_mplx_shutdown(session->mplx); | ||
4737 | 1506 | + session->local.accepted_max = h2_mplx_m_shutdown(session->mplx); | ||
4738 | 1507 | session->local.error = error; | ||
4739 | 1508 | } | ||
4740 | 1509 | else { | ||
4741 | 1510 | @@ -779,7 +779,7 @@ static apr_status_t session_cleanup(h2_s | ||
4742 | 1511 | } | ||
4743 | 1512 | |||
4744 | 1513 | transit(session, trigger, H2_SESSION_ST_CLEANUP); | ||
4745 | 1514 | - h2_mplx_release_and_join(session->mplx, session->iowait); | ||
4746 | 1515 | + h2_mplx_m_release_and_join(session->mplx, session->iowait); | ||
4747 | 1516 | session->mplx = NULL; | ||
4748 | 1517 | |||
4749 | 1518 | ap_assert(session->ngh2); | ||
4750 | 1519 | @@ -800,7 +800,7 @@ static apr_status_t session_pool_cleanup | ||
4751 | 1520 | /* if the session is still there, now is the last chance | ||
4752 | 1521 | * to perform cleanup. Normally, cleanup should have happened | ||
4753 | 1522 | * earlier in the connection pre_close. Main reason is that | ||
4754 | 1523 | - * any ongoing requests on slave connections might still access | ||
4755 | 1524 | + * any ongoing requests on secondary connections might still access | ||
4756 | 1525 | * data which has, at this time, already been freed. An example | ||
4757 | 1526 | * is mod_ssl that uses request hooks. */ | ||
4758 | 1527 | ap_log_cerror(APLOG_MARK, APLOG_WARNING, 0, c, | ||
4759 | 1528 | @@ -893,7 +893,7 @@ apr_status_t h2_session_create(h2_sessio | ||
4760 | 1529 | session->monitor->on_state_event = on_stream_state_event; | ||
4761 | 1530 | session->monitor->on_event = on_stream_event; | ||
4762 | 1531 | |||
4763 | 1532 | - session->mplx = h2_mplx_create(c, s, session->pool, workers); | ||
4764 | 1533 | + session->mplx = h2_mplx_m_create(c, s, session->pool, workers); | ||
4765 | 1534 | |||
4766 | 1535 | /* connection input filter that feeds the session */ | ||
4767 | 1536 | session->cin = h2_filter_cin_create(session); | ||
4768 | 1537 | @@ -1552,7 +1552,7 @@ static void h2_session_in_flush(h2_sessi | ||
4769 | 1538 | if (stream) { | ||
4770 | 1539 | ap_assert(!stream->scheduled); | ||
4771 | 1540 | if (h2_stream_prep_processing(stream) == APR_SUCCESS) { | ||
4772 | 1541 | - h2_mplx_process(session->mplx, stream, stream_pri_cmp, session); | ||
4773 | 1542 | + h2_mplx_m_process(session->mplx, stream, stream_pri_cmp, session); | ||
4774 | 1543 | } | ||
4775 | 1544 | else { | ||
4776 | 1545 | h2_stream_rst(stream, H2_ERR_INTERNAL_ERROR); | ||
4777 | 1546 | @@ -1824,7 +1824,7 @@ static void h2_session_ev_no_io(h2_sessi | ||
4778 | 1547 | session->open_streams); | ||
4779 | 1548 | h2_conn_io_flush(&session->io); | ||
4780 | 1549 | if (session->open_streams > 0) { | ||
4781 | 1550 | - if (h2_mplx_awaits_data(session->mplx)) { | ||
4782 | 1551 | + if (h2_mplx_m_awaits_data(session->mplx)) { | ||
4783 | 1552 | /* waiting for at least one stream to produce data */ | ||
4784 | 1553 | transit(session, "no io", H2_SESSION_ST_WAIT); | ||
4785 | 1554 | } | ||
4786 | 1555 | @@ -1983,7 +1983,7 @@ static void on_stream_state_enter(void * | ||
4787 | 1556 | break; | ||
4788 | 1557 | case H2_SS_CLEANUP: | ||
4789 | 1558 | nghttp2_session_set_stream_user_data(session->ngh2, stream->id, NULL); | ||
4790 | 1559 | - h2_mplx_stream_cleanup(session->mplx, stream); | ||
4791 | 1560 | + h2_mplx_m_stream_cleanup(session->mplx, stream); | ||
4792 | 1561 | break; | ||
4793 | 1562 | default: | ||
4794 | 1563 | break; | ||
4795 | 1564 | @@ -2073,7 +2073,7 @@ static void dispatch_event(h2_session *s | ||
4796 | 1565 | static apr_status_t dispatch_master(h2_session *session) { | ||
4797 | 1566 | apr_status_t status; | ||
4798 | 1567 | |||
4799 | 1568 | - status = h2_mplx_dispatch_master_events(session->mplx, | ||
4800 | 1569 | + status = h2_mplx_m_dispatch_master_events(session->mplx, | ||
4801 | 1570 | on_stream_resume, session); | ||
4802 | 1571 | if (status == APR_EAGAIN) { | ||
4803 | 1572 | ap_log_cerror(APLOG_MARK, APLOG_TRACE3, status, session->c, | ||
4804 | 1573 | @@ -2175,7 +2175,7 @@ apr_status_t h2_session_process(h2_sessi | ||
4805 | 1574 | session->have_read = 1; | ||
4806 | 1575 | } | ||
4807 | 1576 | else if (APR_STATUS_IS_EAGAIN(status) || APR_STATUS_IS_TIMEUP(status)) { | ||
4808 | 1577 | - status = h2_mplx_idle(session->mplx); | ||
4809 | 1578 | + status = h2_mplx_m_idle(session->mplx); | ||
4810 | 1579 | if (status == APR_EAGAIN) { | ||
4811 | 1580 | break; | ||
4812 | 1581 | } | ||
4813 | 1582 | @@ -2205,7 +2205,7 @@ apr_status_t h2_session_process(h2_sessi | ||
4814 | 1583 | /* We wait in smaller increments, using a 1 second timeout. | ||
4815 | 1584 | * That gives us the chance to check for MPMQ_STOPPING often. | ||
4816 | 1585 | */ | ||
4817 | 1586 | - status = h2_mplx_idle(session->mplx); | ||
4818 | 1587 | + status = h2_mplx_m_idle(session->mplx); | ||
4819 | 1588 | if (status == APR_EAGAIN) { | ||
4820 | 1589 | break; | ||
4821 | 1590 | } | ||
4822 | 1591 | @@ -2319,7 +2319,7 @@ apr_status_t h2_session_process(h2_sessi | ||
4823 | 1592 | "h2_session: wait for data, %ld micros", | ||
4824 | 1593 | (long)session->wait_us); | ||
4825 | 1594 | } | ||
4826 | 1595 | - status = h2_mplx_out_trywait(session->mplx, session->wait_us, | ||
4827 | 1596 | + status = h2_mplx_m_out_trywait(session->mplx, session->wait_us, | ||
4828 | 1597 | session->iowait); | ||
4829 | 1598 | if (status == APR_SUCCESS) { | ||
4830 | 1599 | session->wait_us = 0; | ||
4831 | 1600 | @@ -2356,7 +2356,7 @@ apr_status_t h2_session_process(h2_sessi | ||
4832 | 1601 | dispatch_event(session, H2_SESSION_EV_NGH2_DONE, 0, NULL); | ||
4833 | 1602 | } | ||
4834 | 1603 | if (session->reprioritize) { | ||
4835 | 1604 | - h2_mplx_reprioritize(session->mplx, stream_pri_cmp, session); | ||
4836 | 1605 | + h2_mplx_m_reprioritize(session->mplx, stream_pri_cmp, session); | ||
4837 | 1606 | session->reprioritize = 0; | ||
4838 | 1607 | } | ||
4839 | 1608 | } | ||
4840 | 1609 | --- a/modules/http2/h2_session.h | ||
4841 | 1610 | +++ b/modules/http2/h2_session.h | ||
4842 | 1611 | @@ -132,7 +132,7 @@ typedef struct h2_session { | ||
4843 | 1612 | const char *last_status_msg; /* the one already reported */ | ||
4844 | 1613 | |||
4845 | 1614 | struct h2_iqueue *in_pending; /* all streams with input pending */ | ||
4846 | 1615 | - struct h2_iqueue *in_process; /* all streams ready for processing on slave */ | ||
4847 | 1616 | + struct h2_iqueue *in_process; /* all streams ready for processing on a secondary */ | ||
4848 | 1617 | |||
4849 | 1618 | } h2_session; | ||
4850 | 1619 | |||
4851 | 1620 | --- a/modules/http2/h2_stream.c | ||
4852 | 1621 | +++ b/modules/http2/h2_stream.c | ||
4853 | 1622 | @@ -903,7 +903,7 @@ apr_status_t h2_stream_out_prepare(h2_st | ||
4854 | 1623 | |||
4855 | 1624 | if (status == APR_EAGAIN) { | ||
4856 | 1625 | /* TODO: ugly, someone needs to retrieve the response first */ | ||
4857 | 1626 | - h2_mplx_keep_active(stream->session->mplx, stream); | ||
4858 | 1627 | + h2_mplx_m_keep_active(stream->session->mplx, stream); | ||
4859 | 1628 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c, | ||
4860 | 1629 | H2_STRM_MSG(stream, "prep, response eagain")); | ||
4861 | 1630 | return status; | ||
4862 | 1631 | --- a/modules/http2/h2_task.c | ||
4863 | 1632 | +++ b/modules/http2/h2_task.c | ||
4864 | 1633 | @@ -86,7 +86,7 @@ static apr_status_t open_output(h2_task | ||
4865 | 1634 | task->request->authority, | ||
4866 | 1635 | task->request->path); | ||
4867 | 1636 | task->output.opened = 1; | ||
4868 | 1637 | - return h2_mplx_out_open(task->mplx, task->stream_id, task->output.beam); | ||
4869 | 1638 | + return h2_mplx_t_out_open(task->mplx, task->stream_id, task->output.beam); | ||
4870 | 1639 | } | ||
4871 | 1640 | |||
4872 | 1641 | static apr_status_t send_out(h2_task *task, apr_bucket_brigade* bb, int block) | ||
4873 | 1642 | @@ -126,8 +126,8 @@ static apr_status_t send_out(h2_task *ta | ||
4874 | 1643 | * request_rec out filter chain) into the h2_mplx for further sending | ||
4875 | 1644 | * on the master connection. | ||
4876 | 1645 | */ | ||
4877 | 1646 | -static apr_status_t slave_out(h2_task *task, ap_filter_t* f, | ||
4878 | 1647 | - apr_bucket_brigade* bb) | ||
4879 | 1648 | +static apr_status_t secondary_out(h2_task *task, ap_filter_t* f, | ||
4880 | 1649 | + apr_bucket_brigade* bb) | ||
4881 | 1650 | { | ||
4882 | 1651 | apr_bucket *b; | ||
4883 | 1652 | apr_status_t rv = APR_SUCCESS; | ||
4884 | 1653 | @@ -175,7 +175,7 @@ send: | ||
4885 | 1654 | if (APR_SUCCESS == rv) { | ||
4886 | 1655 | /* could not write all, buffer the rest */ | ||
4887 | 1656 | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, task->c, APLOGNO(03405) | ||
4888 | 1657 | - "h2_slave_out(%s): saving brigade", task->id); | ||
4889 | 1658 | + "h2_secondary_out(%s): saving brigade", task->id); | ||
4890 | 1659 | ap_assert(NULL); | ||
4891 | 1660 | rv = ap_save_brigade(f, &task->output.bb, &bb, task->pool); | ||
4892 | 1661 | flush = 1; | ||
4893 | 1662 | @@ -189,7 +189,7 @@ send: | ||
4894 | 1663 | } | ||
4895 | 1664 | out: | ||
4896 | 1665 | ap_log_cerror(APLOG_MARK, APLOG_TRACE2, rv, task->c, | ||
4897 | 1666 | - "h2_slave_out(%s): slave_out leave", task->id); | ||
4898 | 1667 | + "h2_secondary_out(%s): secondary_out leave", task->id); | ||
4899 | 1668 | return rv; | ||
4900 | 1669 | } | ||
4901 | 1670 | |||
4902 | 1671 | @@ -202,14 +202,14 @@ static apr_status_t output_finish(h2_tas | ||
4903 | 1672 | } | ||
4904 | 1673 | |||
4905 | 1674 | /******************************************************************************* | ||
4906 | 1675 | - * task slave connection filters | ||
4907 | 1676 | + * task secondary connection filters | ||
4908 | 1677 | ******************************************************************************/ | ||
4909 | 1678 | |||
4910 | 1679 | -static apr_status_t h2_filter_slave_in(ap_filter_t* f, | ||
4911 | 1680 | - apr_bucket_brigade* bb, | ||
4912 | 1681 | - ap_input_mode_t mode, | ||
4913 | 1682 | - apr_read_type_e block, | ||
4914 | 1683 | - apr_off_t readbytes) | ||
4915 | 1684 | +static apr_status_t h2_filter_secondary_in(ap_filter_t* f, | ||
4916 | 1685 | + apr_bucket_brigade* bb, | ||
4917 | 1686 | + ap_input_mode_t mode, | ||
4918 | 1687 | + apr_read_type_e block, | ||
4919 | 1688 | + apr_off_t readbytes) | ||
4920 | 1689 | { | ||
4921 | 1690 | h2_task *task; | ||
4922 | 1691 | apr_status_t status = APR_SUCCESS; | ||
4923 | 1692 | @@ -224,7 +224,7 @@ static apr_status_t h2_filter_slave_in(a | ||
4924 | 1693 | |||
4925 | 1694 | if (trace1) { | ||
4926 | 1695 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, f->c, | ||
4927 | 1696 | - "h2_slave_in(%s): read, mode=%d, block=%d, readbytes=%ld", | ||
4928 | 1697 | + "h2_secondary_in(%s): read, mode=%d, block=%d, readbytes=%ld", | ||
4929 | 1698 | task->id, mode, block, (long)readbytes); | ||
4930 | 1699 | } | ||
4931 | 1700 | |||
4932 | 1701 | @@ -254,7 +254,7 @@ static apr_status_t h2_filter_slave_in(a | ||
4933 | 1702 | /* Get more input data for our request. */ | ||
4934 | 1703 | if (trace1) { | ||
4935 | 1704 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, f->c, | ||
4936 | 1705 | - "h2_slave_in(%s): get more data from mplx, block=%d, " | ||
4937 | 1706 | + "h2_secondary_in(%s): get more data from mplx, block=%d, " | ||
4938 | 1707 | "readbytes=%ld", task->id, block, (long)readbytes); | ||
4939 | 1708 | } | ||
4940 | 1709 | if (task->input.beam) { | ||
4941 | 1710 | @@ -267,7 +267,7 @@ static apr_status_t h2_filter_slave_in(a | ||
4942 | 1711 | |||
4943 | 1712 | if (trace1) { | ||
4944 | 1713 | ap_log_cerror(APLOG_MARK, APLOG_TRACE2, status, f->c, | ||
4945 | 1714 | - "h2_slave_in(%s): read returned", task->id); | ||
4946 | 1715 | + "h2_secondary_in(%s): read returned", task->id); | ||
4947 | 1716 | } | ||
4948 | 1717 | if (APR_STATUS_IS_EAGAIN(status) | ||
4949 | 1718 | && (mode == AP_MODE_GETLINE || block == APR_BLOCK_READ)) { | ||
4950 | 1719 | @@ -306,7 +306,7 @@ static apr_status_t h2_filter_slave_in(a | ||
4951 | 1720 | if (APR_BRIGADE_EMPTY(task->input.bb)) { | ||
4952 | 1721 | if (trace1) { | ||
4953 | 1722 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, f->c, | ||
4954 | 1723 | - "h2_slave_in(%s): no data", task->id); | ||
4955 | 1724 | + "h2_secondary_in(%s): no data", task->id); | ||
4956 | 1725 | } | ||
4957 | 1726 | return (block == APR_NONBLOCK_READ)? APR_EAGAIN : APR_EOF; | ||
4958 | 1727 | } | ||
4959 | 1728 | @@ -334,7 +334,7 @@ static apr_status_t h2_filter_slave_in(a | ||
4960 | 1729 | buffer[len] = 0; | ||
4961 | 1730 | if (trace1) { | ||
4962 | 1731 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, f->c, | ||
4963 | 1732 | - "h2_slave_in(%s): getline: %s", | ||
4964 | 1733 | + "h2_secondary_in(%s): getline: %s", | ||
4965 | 1734 | task->id, buffer); | ||
4966 | 1735 | } | ||
4967 | 1736 | } | ||
4968 | 1737 | @@ -344,7 +344,7 @@ static apr_status_t h2_filter_slave_in(a | ||
4969 | 1738 | * to support it. Seems to work. */ | ||
4970 | 1739 | ap_log_cerror(APLOG_MARK, APLOG_ERR, APR_ENOTIMPL, f->c, | ||
4971 | 1740 | APLOGNO(03472) | ||
4972 | 1741 | - "h2_slave_in(%s), unsupported READ mode %d", | ||
4973 | 1742 | + "h2_secondary_in(%s), unsupported READ mode %d", | ||
4974 | 1743 | task->id, mode); | ||
4975 | 1744 | status = APR_ENOTIMPL; | ||
4976 | 1745 | } | ||
4977 | 1746 | @@ -352,19 +352,19 @@ static apr_status_t h2_filter_slave_in(a | ||
4978 | 1747 | if (trace1) { | ||
4979 | 1748 | apr_brigade_length(bb, 0, &bblen); | ||
4980 | 1749 | ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, f->c, | ||
4981 | 1750 | - "h2_slave_in(%s): %ld data bytes", task->id, (long)bblen); | ||
4982 | 1751 | + "h2_secondary_in(%s): %ld data bytes", task->id, (long)bblen); | ||
4983 | 1752 | } | ||
4984 | 1753 | return status; | ||
4985 | 1754 | } | ||
4986 | 1755 | |||
4987 | 1756 | -static apr_status_t h2_filter_slave_output(ap_filter_t* filter, | ||
4988 | 1757 | - apr_bucket_brigade* brigade) | ||
4989 | 1758 | +static apr_status_t h2_filter_secondary_output(ap_filter_t* filter, | ||
4990 | 1759 | + apr_bucket_brigade* brigade) | ||
4991 | 1760 | { | ||
4992 | 1761 | h2_task *task = h2_ctx_get_task(filter->c); | ||
4993 | 1762 | apr_status_t status; | ||
4994 | 1763 | |||
4995 | 1764 | ap_assert(task); | ||
4996 | 1765 | - status = slave_out(task, filter, brigade); | ||
4997 | 1766 | + status = secondary_out(task, filter, brigade); | ||
4998 | 1767 | if (status != APR_SUCCESS) { | ||
4999 | 1768 | h2_task_rst(task, H2_ERR_INTERNAL_ERROR); | ||
5000 | 1769 | } |
Again wrong target branch, but ok from git.
This revert is different than the one for H/I releases.
But that is intentional and ok as the change to Bionic was different when it was applied.
We are - as intended - back on the level of 2.4.29-1ubuntu4.18
$ git diff 0697199b656c588 c0a7fdc80055795 b9a837300c -- debian/ | diffstat
changelog | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
LGTM
thanks!