From 3874f492184393f4cab042fdf422fa7915874bbf Mon Sep 17 00:00:00 2001 From: lvfei Date: Wed, 29 May 2024 11:10:58 +0800 Subject: [PATCH] Fix CVE-2022-34481 --- CVE-2022-34481.patch | 26 ++++++++++++++++++++++++++ firefox.spec | 9 +++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 CVE-2022-34481.patch diff --git a/CVE-2022-34481.patch b/CVE-2022-34481.patch new file mode 100644 index 0000000..0fe515f --- /dev/null +++ b/CVE-2022-34481.patch @@ -0,0 +1,26 @@ +From a928758612e67c4496bd9acf48bf66259c809782 Mon Sep 17 00:00:00 2001 +From: Nika Layzell +Date: Tue, 07 Jun 2022 17:06:41 +0000 (24 months ago) +Subject: [PATCH] CVE-2022-34481 + +--- + xpcom/ds/nsTArray.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/xpcom/ds/nsTArray.h b/xpcom/ds/nsTArray.h +index e368968359..61d7586233 100644 +--- a/xpcom/ds/nsTArray.h ++++ b/xpcom/ds/nsTArray.h +@@ -2351,6 +2351,9 @@ auto nsTArray_Impl::ReplaceElementsAtInternal(index_type aStart, + if (MOZ_UNLIKELY(aStart > Length())) { + InvalidArrayIndex_CRASH(aStart, Length()); + } ++ if (MOZ_UNLIKELY(aCount > Length() - aStart)) { ++ InvalidArrayIndex_CRASH(aStart + aCount, Length()); ++ } + + // Adjust memory allocation up-front to catch errors. + if (!ActualAlloc::Successful(this->template EnsureCapacity( +-- +2.27.0 + diff --git a/firefox.spec b/firefox.spec index d1e557b..16a2023 100644 --- a/firefox.spec +++ b/firefox.spec @@ -88,7 +88,7 @@ Summary: Mozilla Firefox Web browser Name: firefox Version: 79.0 -Release: 21 +Release: 22 URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}/source/firefox-%{version}.source.tar.xz @@ -200,6 +200,7 @@ Patch656: CVE-2023-44488.patch Patch657: CVE-2020-26950.patch Patch658: CVE-2020-26971.patch Patch659: CVE-2021-29946.patch +Patch660: CVE-2022-34481.patch %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} pkgconfig(nss) >= %{nss_version} @@ -394,6 +395,7 @@ tar -xf %{SOURCE3} %patch657 -p1 %patch658 -p1 %patch659 -p1 +%patch660 -p1 %{__rm} -f .mozconfig %{__cp} %{SOURCE10} .mozconfig @@ -842,8 +844,11 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %endif %changelog +* Mon May 27 2024 lvfei - 79.0-22 +- Fix CVE-2022-34481 + * Mon May 13 2024 lvfei - 79.0-21 -- Fix CVE-2021-29946.patch +- Fix CVE-2021-29946 * Tue May 07 2024 lvfei - 79.0-20 - Fix CVE-2020-26971 -- Gitee