From fabab9cf641de9dd93e3659ca5cae39b82c82a49 Mon Sep 17 00:00:00 2001 From: Emre Girgin Date: Wed, 14 Oct 2020 22:47:41 +0000 Subject: [PATCH 1/2] Fix CVE-2020-26159 --- SPECS/oniguruma/CVE-2020-26159.patch | 22 ++++++++++++++++++++++ SPECS/oniguruma/oniguruma.spec | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 SPECS/oniguruma/CVE-2020-26159.patch diff --git a/SPECS/oniguruma/CVE-2020-26159.patch b/SPECS/oniguruma/CVE-2020-26159.patch new file mode 100644 index 00000000000..71a8adadb6b --- /dev/null +++ b/SPECS/oniguruma/CVE-2020-26159.patch @@ -0,0 +1,22 @@ +From cbe9f8bd9cfc6c3c87a60fbae58fa1a85db59df0 Mon Sep 17 00:00:00 2001 +From: "K.Kosako" +Date: Mon, 21 Sep 2020 12:58:29 +0900 +Subject: [PATCH] #207: Out-of-bounds write + +--- + src/regcomp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/regcomp.c b/src/regcomp.c +index f6494b6d..a0a68561 100644 +--- a/src/regcomp.c ++++ b/src/regcomp.c +@@ -6257,7 +6257,7 @@ concat_opt_exact_str(OptStr* to, UChar* s, UChar* end, OnigEncoding enc) + + for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) { + len = enclen(enc, p); +- if (i + len > OPT_EXACT_MAXLEN) break; ++ if (i + len >= OPT_EXACT_MAXLEN) break; + for (j = 0; j < len && p < end; j++) + to->s[i++] = *p++; + } diff --git a/SPECS/oniguruma/oniguruma.spec b/SPECS/oniguruma/oniguruma.spec index 33e4981f8cb..3b764094c1c 100644 --- a/SPECS/oniguruma/oniguruma.spec +++ b/SPECS/oniguruma/oniguruma.spec @@ -8,6 +8,8 @@ Vendor: Microsoft Corporation Distribution: Mariner URL: https://github.com/kkos/oniguruma/ Source0: https://github.com/kkos/oniguruma/releases/download/v%{version}/onig-%{version}.tar.gz +# https://github.com/kkos/oniguruma/commit/cbe9f8bd9cfc6c3c87a60fbae58fa1a85db59df0.patch +Patch0: CVE-2020-26159.patch %description Oniguruma is a regular expressions library. @@ -24,7 +26,8 @@ Requires: oniguruma = %{version}-%{release} Development files for libonig %prep -%setup -q -n onig-%{version} +%autosetup -n onig-%{version} + %build %configure \ From 78ac233a583472dbaf15397f92af4aea15729213 Mon Sep 17 00:00:00 2001 From: Emre Girgin Date: Thu, 15 Oct 2020 14:14:48 +0000 Subject: [PATCH 2/2] Increment release, fix autosetup. --- SPECS/oniguruma/oniguruma.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SPECS/oniguruma/oniguruma.spec b/SPECS/oniguruma/oniguruma.spec index 3b764094c1c..d395818bd64 100644 --- a/SPECS/oniguruma/oniguruma.spec +++ b/SPECS/oniguruma/oniguruma.spec @@ -1,6 +1,6 @@ Name: oniguruma Version: 6.9.5 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Summary: Regular expressions library Group: System Environment/Libraries @@ -26,7 +26,7 @@ Requires: oniguruma = %{version}-%{release} Development files for libonig %prep -%autosetup -n onig-%{version} +%autosetup -n onig-%{version} -p1 %build @@ -65,6 +65,8 @@ make check %{_libdir}/pkgconfig/%{name}.pc %changelog +* Thu Oct 15 2020 Emre Girgin 6.9.5-2 +- Fix CVE-2020-26159. * Tue May 19 2020 Andrew Phelps 6.9.5-1 - Upgrade to 6.9.5. * Wed Apr 22 2020 Emre Girgin 6.9.0-4