From 219f4d3ccd90c48619da7b74ebf90b391e0b98b9 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Mon, 7 Oct 2024 21:06:27 +0300 Subject: [PATCH] import pcre2-10.40-6.el9 --- ...-jit-fail-early-in-ffcps_-if-subject.patch | 33 +++++++++++++++++++ SPECS/pcre2.spec | 8 ++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 SOURCES/pcre2-10.42-jit-fail-early-in-ffcps_-if-subject.patch diff --git a/SOURCES/pcre2-10.42-jit-fail-early-in-ffcps_-if-subject.patch b/SOURCES/pcre2-10.42-jit-fail-early-in-ffcps_-if-subject.patch new file mode 100644 index 0000000..1637e1b --- /dev/null +++ b/SOURCES/pcre2-10.42-jit-fail-early-in-ffcps_-if-subject.patch @@ -0,0 +1,33 @@ +From f2411acb3711a44497539d17b245bd366d9c26d7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= +Date: Mon, 12 Dec 2022 08:32:42 -0800 +Subject: [PATCH] jit: fail early in ffcps_* if subject shorter than offs1 + (#175) + +FF_FUN would try loading a vector from an invalid address +triggering a crash. + +Add the same check that is done in the x86/s390x implementations +and that was missing from the original code. + +Fixes: #86 +--- + src/pcre2_jit_neon_inc.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/pcre2_jit_neon_inc.h b/src/pcre2_jit_neon_inc.h +index e74adf12..165602ed 100644 +--- a/src/pcre2_jit_neon_inc.h ++++ b/src/pcre2_jit_neon_inc.h +@@ -183,6 +183,8 @@ restart:; + #endif + + #if defined(FFCPS) ++if (str_ptr >= str_end) ++ return NULL; + sljit_u8 *p1 = str_ptr - diff; + #endif + sljit_s32 align_offset = ((uint64_t)str_ptr & 0xf); +-- +2.45.1 + diff --git a/SPECS/pcre2.spec b/SPECS/pcre2.spec index df3da3c..546157c 100644 --- a/SPECS/pcre2.spec +++ b/SPECS/pcre2.spec @@ -9,7 +9,7 @@ #%%global rcversion RC1 Name: pcre2 Version: 10.40 -Release: %{?rcversion:0.}5%{?rcversion:.%rcversion}%{?dist} +Release: %{?rcversion:0.}6%{?rcversion:.%rcversion}%{?dist} %global myversion %{version}%{?rcversion:-%rcversion} Summary: Perl-compatible regular expression library # the library: BSD with exceptions @@ -58,6 +58,8 @@ Patch1: pcre2-10.40-Fix-JIT-regression-in-PHP.patch # https://github.com/PCRE2Project/pcre2/commit/457c0e69a8f78d32bc7d4b6422cd01e396a4cf5d Patch2: pcre2-10.42-Match-also-restore-originally-unset-entries-in-recur.patch Patch3: pcre2-10.42-Add-more-examples-fixed-by-300.patch +# Upstream patch: https://github.com/PCRE2Project/pcre2/commit/f2411acb3711a44497539d17b245bd366d9c26d7 +Patch4: pcre2-10.42-jit-fail-early-in-ffcps_-if-subject.patch BuildRequires: autoconf BuildRequires: automake @@ -265,6 +267,10 @@ make %{?_smp_mflags} check VERBOSE=yes %{_mandir}/man1/pcre2test.* %changelog +* Wed Jul 31 2024 Lukas Javorsky - 10.40-6 +- Fix SEGFAULT caused by dereferencing subject when length==0 on aarch64 +- Resolves: RHEL-51866 + * Thu Mar 28 2024 MSVSphere Packaging Team - 10.40-5 - Rebuilt for MSVSphere 9.4 beta