]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
Replace PCRE with PCRE2 where it is available
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 24 Feb 2022 22:18:42 +0000 (22:18 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 24 Feb 2022 22:18:42 +0000 (22:18 +0000)
commitc602ba14811ede722017c4e59e4e30d9990227b4
treede9f69411c5c310263696505e917f6a3dbad3207
parent7cc0faf218274477db2084fdf8a1c65e83af8af5
Replace PCRE with PCRE2 where it is available

PCRE 8.45 from May '21 is at end-of-life and will not receive security
vulnerability attention. pcre2-10.x replaces this and has been updated
(as of this time) as recently as Oct '21.

This patch removes the needless assignment of re_erroffset in the conf pool
by the worker threads; such mistakes break the shared copy-on-write pages of
memory that should have remained common between all httpd worker processes.

Two de-optimizations are inherent in this patch, the former ovector-on-stack
opportunity is lost. This is by design of pcre2, more serious exploits were
available with stack array underrun/overrun manipulation. Heap for all pcre
array processing is the recommendation of the implementor, enforced by API.

Safer that we either create a new general context using pool allocation
in heap (requires thread-pool args we don't have in our api), or recycle
a per-req, per-pool, TLS match_data buffer on heap of some arbitrary 10 elts
or so, for these most common cases. Since this can't be done portably in C89
we may revisit this optimization in post-2.4 releases.

This logic refuses to consider --without-pcre, which is nonsequitor.

Submitted by: [wrowe, Petr Pisar <ppisar redhat.com>, rjung]
Backports: 1773454 1773741 1773742 1773839 1773870 1773882 1814662 1881478

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1898399 13f79535-47bb-0310-9956-ffa450edef68
CHANGES
CMakeLists.txt
STATUS
configure.in
server/util_pcre.c