From 4f04f02aa82976ae4ba691df468f33ab3ffd0b5a Mon Sep 17 00:00:00 2001 From: wk333 <13474090681@163.com> Date: Tue, 2 Jan 2024 11:23:49 +0800 Subject: [PATCH] Fix CVE-2023-7104 --- CVE-2023-7104.patch | 38 ++++++++++++++++++++++++++++++++++++++ firefox.spec | 7 ++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 CVE-2023-7104.patch diff --git a/CVE-2023-7104.patch b/CVE-2023-7104.patch new file mode 100644 index 0000000..d26e0b7 --- /dev/null +++ b/CVE-2023-7104.patch @@ -0,0 +1,38 @@ +Origin: https://sqlite.org/src/info/0e4e7a05c4204b47 + +Index: third_party/sqlite3/src/sqlite3.c +================================================================== +--- a/third_party/sqlite3/src/sqlite3.c ++++ b/third_party/sqlite3/src/sqlite3.c +@@ -3234,19 +3234,23 @@ + pIn->iNext += nByte; + } + } + } + if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){ +- sqlite3_int64 v = sessionGetI64(aVal); +- if( eType==SQLITE_INTEGER ){ +- sqlite3VdbeMemSetInt64(apOut[i], v); ++ if( (pIn->nData-pIn->iNext)<8 ){ ++ rc = SQLITE_CORRUPT_BKPT; + }else{ +- double d; +- memcpy(&d, &v, 8); +- sqlite3VdbeMemSetDouble(apOut[i], d); ++ sqlite3_int64 v = sessionGetI64(aVal); ++ if( eType==SQLITE_INTEGER ){ ++ sqlite3VdbeMemSetInt64(apOut[i], v); ++ }else{ ++ double d; ++ memcpy(&d, &v, 8); ++ sqlite3VdbeMemSetDouble(apOut[i], d); ++ } ++ pIn->iNext += 8; + } +- pIn->iNext += 8; + } + } + } + + return rc; + diff --git a/firefox.spec b/firefox.spec index 2fb5d3c..02fd63f 100644 --- a/firefox.spec +++ b/firefox.spec @@ -45,7 +45,7 @@ Summary: Mozilla Firefox Web browser Name: firefox Version: 115.5.0 -Release: 2 +Release: 3 URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz @@ -81,6 +81,7 @@ Patch02: firefox-gcc-build.patch # -- Upstreamed patches -- Patch51: mozilla-bmo1170092.patch +Patch52: CVE-2023-7104.patch # -- Submitted upstream, not merged -- Patch101: mozilla-bmo1636168-fscreen.patch @@ -390,6 +391,7 @@ rm -vf ./*/layout/inspector/tests/chrome/test_fontVariationsAPI.css # -- Upstreamed patches -- %patch -P51 -p1 -b .mozilla-bmo1170092 +%patch -P52 -p1 # -- Submitted upstream, not merged -- %patch -P101 -p1 -b .mozilla-bmo1636168-fscreen @@ -945,6 +947,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %endif %changelog +* Tue Jan 02 2024 wangkai <13474090681@163.com> - 115.5.0-3 +- Fix CVE-2023-7104 + * Sat Nov 25 2023 Jingwiw - 115.5.0-2 - Optimize for riscv64 - Use system libraries for VP8, VP9, and WebP -- Gitee