diff --git a/.firefox.metadata b/.firefox.metadata index 9cc981b..3735509 100644 --- a/.firefox.metadata +++ b/.firefox.metadata @@ -1,5 +1,5 @@ c822547dbc12e2baebdfdfb38b665e23f0c2513a SOURCES/cbindgen-vendor.tar.xz -986181f538d2a6951f95b4e1a754854b8e0048ff SOURCES/firefox-91.6.0esr.processed-source.tar.xz -ea7fce0f4ee0101b6d9ef8b4d050fe8a16becff9 SOURCES/firefox-langpacks-91.6.0esr-20220202.tar.xz +d208b4a6bafc320267bb65a486365f2cd1f8aa5a SOURCES/firefox-91.7.0esr.processed-source.tar.xz +fe2cdd6db0edb7d3da3c645e4efc003b6afedb6c SOURCES/firefox-langpacks-91.7.0esr-20220307.tar.xz b5fd1332d8e0d37339ae170c7bebcb63a40b22e0 SOURCES/nspr-4.32.0-1.el8_1.src.rpm 8fff814901e03c2518ede2f8992d898f5ba61ed9 SOURCES/nss-3.67.0-7.el8_1.src.rpm diff --git a/.gitignore b/.gitignore index 6475423..ab9c539 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ SOURCES/cbindgen-vendor.tar.xz -SOURCES/firefox-91.6.0esr.processed-source.tar.xz -SOURCES/firefox-langpacks-91.6.0esr-20220202.tar.xz +SOURCES/firefox-91.7.0esr.processed-source.tar.xz +SOURCES/firefox-langpacks-91.7.0esr-20220307.tar.xz SOURCES/nspr-4.32.0-1.el8_1.src.rpm SOURCES/nss-3.67.0-7.el8_1.src.rpm diff --git a/README.debrand b/README.debrand deleted file mode 100644 index 01c46d2..0000000 --- a/README.debrand +++ /dev/null @@ -1,2 +0,0 @@ -Warning: This package was configured for automatic debranding, but the changes -failed to apply. diff --git a/SOURCES/expat-CVE-2022-25235.patch b/SOURCES/expat-CVE-2022-25235.patch new file mode 100644 index 0000000..1e5c664 --- /dev/null +++ b/SOURCES/expat-CVE-2022-25235.patch @@ -0,0 +1,49 @@ +diff -up firefox-91.7.0/parser/expat/lib/xmltok.c.expat-CVE-2022-25235 firefox-91.7.0/parser/expat/lib/xmltok.c +--- firefox-91.7.0/parser/expat/lib/xmltok.c.expat-CVE-2022-25235 2022-03-02 17:57:38.364361168 +0100 ++++ firefox-91.7.0/parser/expat/lib/xmltok.c 2022-03-02 17:58:22.235512399 +0100 +@@ -65,13 +65,6 @@ + + ((((byte)[2]) >> 5) & 1)] \ + & (1u << (((byte)[2]) & 0x1F))) + +-#define UTF8_GET_NAMING(pages, p, n) \ +- ((n) == 2 \ +- ? UTF8_GET_NAMING2(pages, (const unsigned char *)(p)) \ +- : ((n) == 3 \ +- ? UTF8_GET_NAMING3(pages, (const unsigned char *)(p)) \ +- : 0)) +- + /* Detection of invalid UTF-8 sequences is based on Table 3.1B + of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/ + with the additional restriction of not allowing the Unicode +diff -up firefox-91.7.0/parser/expat/lib/xmltok_impl.c.expat-CVE-2022-25235 firefox-91.7.0/parser/expat/lib/xmltok_impl.c +--- firefox-91.7.0/parser/expat/lib/xmltok_impl.c.expat-CVE-2022-25235 2022-03-02 17:57:38.365361172 +0100 ++++ firefox-91.7.0/parser/expat/lib/xmltok_impl.c 2022-03-02 18:04:51.240853247 +0100 +@@ -34,7 +34,7 @@ + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ +- if (!IS_NAME_CHAR(enc, ptr, n)) { \ ++ if (IS_INVALID_CHAR(enc, ptr, n) || ! IS_NAME_CHAR(enc, ptr, n)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; \ + } \ +@@ -62,7 +62,7 @@ + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ +- if (!IS_NMSTRT_CHAR(enc, ptr, n)) { \ ++ if (IS_INVALID_CHAR(enc, ptr, n) || ! IS_NMSTRT_CHAR(enc, ptr, n)) { \ + *nextTokPtr = ptr; \ + return XML_TOK_INVALID; \ + } \ +@@ -1090,6 +1090,10 @@ PREFIX(prologTok)(const ENCODING *enc, c + case BT_LEAD ## n: \ + if (end - ptr < n) \ + return XML_TOK_PARTIAL_CHAR; \ ++ if (IS_INVALID_CHAR(enc, ptr, n)) { \ ++ *nextTokPtr = ptr; \ ++ return XML_TOK_INVALID; \ ++ } \ + if (IS_NMSTRT_CHAR(enc, ptr, n)) { \ + ptr += n; \ + tok = XML_TOK_NAME; \ diff --git a/SOURCES/expat-CVE-2022-25236.patch b/SOURCES/expat-CVE-2022-25236.patch new file mode 100644 index 0000000..2065dc9 --- /dev/null +++ b/SOURCES/expat-CVE-2022-25236.patch @@ -0,0 +1,40 @@ +diff -up firefox-91.7.0/parser/expat/lib/xmlparse.c.expat-CVE-2022-25236 firefox-91.7.0/parser/expat/lib/xmlparse.c +--- firefox-91.7.0/parser/expat/lib/xmlparse.c.expat-CVE-2022-25236 2022-03-02 18:08:40.085642028 +0100 ++++ firefox-91.7.0/parser/expat/lib/xmlparse.c 2022-03-02 18:13:31.838667958 +0100 +@@ -700,8 +700,7 @@ XML_ParserCreate(const XML_Char *encodin + XML_Parser XMLCALL + XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) + { +- XML_Char tmp[2]; +- *tmp = nsSep; ++ XML_Char tmp[2] = {nsSep, 0}; + return XML_ParserCreate_MM(encodingName, NULL, tmp); + } + #endif +@@ -1276,8 +1275,7 @@ XML_ExternalEntityParserCreate(XML_Parse + would be otherwise. + */ + if (ns) { +- XML_Char tmp[2]; +- *tmp = namespaceSeparator; ++ XML_Char tmp[2] = {parser->m_namespaceSeparator, 0}; + parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd); + } + else { +@@ -3667,6 +3665,16 @@ addBinding(XML_Parser parser, PREFIX *pr + if (!mustBeXML && isXMLNS + && (len > xmlnsLen || uri[len] != xmlnsNamespace[len])) + isXMLNS = XML_FALSE; ++ // NOTE: While Expat does not validate namespace URIs against RFC 3986, ++ // we have to at least make sure that the XML processor on top of ++ // Expat (that is splitting tag names by namespace separator into ++ // 2- or 3-tuples (uri-local or uri-local-prefix)) cannot be confused ++ // by an attacker putting additional namespace separator characters ++ // into namespace declarations. That would be ambiguous and not to ++ // be expected. ++ if (parser->m_ns && (uri[len] == parser->m_namespaceSeparator)) { ++ return XML_ERROR_SYNTAX; ++ } + } + isXML = isXML && len == xmlLen; + isXMLNS = isXMLNS && len == xmlnsLen; diff --git a/SOURCES/expat-CVE-2022-25315.patch b/SOURCES/expat-CVE-2022-25315.patch new file mode 100644 index 0000000..171980f --- /dev/null +++ b/SOURCES/expat-CVE-2022-25315.patch @@ -0,0 +1,24 @@ +diff -up firefox-91.7.0/parser/expat/lib/xmlparse.c.expat-CVE-2022-25315 firefox-91.7.0/parser/expat/lib/xmlparse.c +--- firefox-91.7.0/parser/expat/lib/xmlparse.c.expat-CVE-2022-25315 2022-03-02 18:17:50.966583254 +0100 ++++ firefox-91.7.0/parser/expat/lib/xmlparse.c 2022-03-02 18:19:27.636924735 +0100 +@@ -2479,6 +2479,7 @@ storeRawNames(XML_Parser parser) + while (tag) { + int bufSize; + int nameLen = sizeof(XML_Char) * (tag->name.strLen + 1); ++ size_t rawNameLen; + char *rawNameBuf = tag->buf + nameLen; + /* Stop if already stored. Since tagStack is a stack, we can stop + at the first entry that has already been copied; everything +@@ -2490,7 +2491,11 @@ storeRawNames(XML_Parser parser) + /* For re-use purposes we need to ensure that the + size of tag->buf is a multiple of sizeof(XML_Char). + */ +- bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char)); ++ rawNameLen = ROUND_UP(tag->rawNameLength, sizeof(XML_Char)); ++ /* Detect and prevent integer overflow. */ ++ if (rawNameLen > (size_t)INT_MAX - nameLen) ++ return XML_FALSE; ++ bufSize = nameLen + (int)rawNameLen; + if (bufSize > tag->bufEnd - tag->buf) { + char *temp = (char *)REALLOC(tag->buf, bufSize); + if (temp == NULL) diff --git a/SOURCES/firefox-redhat-default-prefs.js b/SOURCES/firefox-redhat-default-prefs.js new file mode 100644 index 0000000..9ead3a2 --- /dev/null +++ b/SOURCES/firefox-redhat-default-prefs.js @@ -0,0 +1,35 @@ +pref("app.update.auto", false); +pref("app.update.enabled", false); +pref("app.update.autoInstallEnabled", false); +pref("general.smoothScroll", true); +pref("intl.locale.matchOS", true); +pref("toolkit.storage.synchronous", 0); +pref("toolkit.networkmanager.disable", false); +pref("offline.autoDetect", true); +pref("browser.backspace_action", 2); +pref("browser.display.use_system_colors", true); +pref("browser.download.folderList", 1); +pref("browser.link.open_external", 3); +pref("browser.shell.checkDefaultBrowser", false); +pref("network.manage-offline-status", true); +pref("extensions.shownSelectionUI", true); +pref("ui.SpellCheckerUnderlineStyle", 1); +pref("startup.homepage_override_url", "http://www.redhat.com"); +pref("startup.homepage_welcome_url", "http://www.redhat.com"); +pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=file:///%PREFIX%/share/doc/HTML/index.html"); +pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"); +pref("media.gmp-gmpopenh264.provider.enabled",false); +pref("media.gmp-gmpopenh264.autoupdate",false); +pref("media.gmp-gmpopenh264.enabled",false); +pref("media.gmp-gmpopenh264.enabled",false); +pref("plugins.notifyMissingFlash", false); +/* See https://bugzilla.redhat.com/show_bug.cgi?id=1226489 */ +pref("browser.display.use_system_colors", false); +pref("layers.use-image-offscreen-surfaces", false); +/* Allow sending credetials to all https:// sites */ +pref("network.negotiate-auth.trusted-uris", "https://"); +pref("security.use_sqldb", false); +/* Use OS settings for UI language */ +pref("intl.locale.requested", ""); +/* See https://bugzilla.redhat.com/show_bug.cgi?id=1672424 */ +pref("storage.nfs_filesystem", true); \ No newline at end of file diff --git a/SOURCES/firefox.sh.in b/SOURCES/firefox.sh.in index ecff558..06c10ed 100644 --- a/SOURCES/firefox.sh.in +++ b/SOURCES/firefox.sh.in @@ -61,8 +61,6 @@ if [ ! -r $MOZ_LIB_DIR/firefox/$MOZ_FIREFOX_FILE ]; then MOZ_LIB_DIR="$SECONDARY_LIB_DIR" fi MOZ_DIST_BIN="$MOZ_LIB_DIR/firefox" -MOZ_LANGPACKS_DIR="$MOZ_DIST_BIN/langpacks" -MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" MOZ_PROGRAM="$MOZ_DIST_BIN/$MOZ_FIREFOX_FILE" MOZ_LAUNCHER="$MOZ_DIST_BIN/run-mozilla.sh" @@ -101,12 +99,6 @@ export MOZ_PLUGIN_PATH export MOZ_APP_LAUNCHER="%PREFIX%/bin/firefox" ## -## Set FONTCONFIG_PATH for Xft/fontconfig -## -FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft" -export FONTCONFIG_PATH - -## ## In order to better support certain scripts (such as Indic and some CJK ## scripts), Fedora builds its Firefox, with permission from the Mozilla ## Corporation, with the Pango system as its text renderer. This change @@ -135,76 +127,6 @@ export G_SLICE=always-malloc ## export MOZ_USE_XINPUT2=1 -# OK, here's where all the real work gets done - - -## -## To disable the use of Firefox localization, set MOZ_DISABLE_LANGPACKS=1 -## in your environment before launching Firefox. -## -# -# MOZ_DISABLE_LANGPACKS=1 -# export MOZ_DISABLE_LANGPACKS -# - -## -## Automatically installed langpacks are tracked by .fedora-langpack-install -## config file. -## -FEDORA_LANGPACK_CONFIG="$MOZ_EXTENSIONS_PROFILE_DIR/.fedora-langpack-install" - -MOZILLA_DOWN=0 -if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then - if [ -x $MOZ_DIST_BIN/$MOZ_FIREFOX_FILE ]; then - # Is firefox running? - pidof firefox > /dev/null 2>&1 - MOZILLA_DOWN=$? - fi -fi - -# Modify language pack configuration only when firefox is not running -# and language packs are not disabled -if [ $MOZILLA_DOWN -ne 0 ]; then - - # Clear already installed langpacks - mkdir -p $MOZ_EXTENSIONS_PROFILE_DIR - if [ -f $FEDORA_LANGPACK_CONFIG ]; then - rm `cat $FEDORA_LANGPACK_CONFIG` > /dev/null 2>&1 - rm $FEDORA_LANGPACK_CONFIG > /dev/null 2>&1 - # remove all empty langpacks dirs while they block installation of langpacks - rmdir $MOZ_EXTENSIONS_PROFILE_DIR/langpack* > /dev/null 2>&1 - fi - - # Get locale from system - CURRENT_LOCALE=$LC_ALL - CURRENT_LOCALE=${CURRENT_LOCALE:-$LC_MESSAGES} - CURRENT_LOCALE=${CURRENT_LOCALE:-$LANG} - - # Try with a local variant first, then without a local variant - SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g"` - MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g"` - - function create_langpack_link() { - local language=$* - local langpack=langpack-${language}@firefox.mozilla.org.xpi - if [ -f $MOZ_LANGPACKS_DIR/$langpack ]; then - rm -rf $MOZ_EXTENSIONS_PROFILE_DIR/$langpack - # If the target file is a symlink (the fallback langpack), - # install the original file instead of the fallback one - if [ -h $MOZ_LANGPACKS_DIR/$langpack ]; then - langpack=`readlink $MOZ_LANGPACKS_DIR/$langpack` - fi - ln -s $MOZ_LANGPACKS_DIR/$langpack \ - $MOZ_EXTENSIONS_PROFILE_DIR/$langpack - echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $FEDORA_LANGPACK_CONFIG - return 0 - fi - return 1 - } - - create_langpack_link $MOZLOCALE || create_langpack_link $SHORTMOZLOCALE || true -fi - # BEAST fix (rhbz#1005611) NSS_SSL_CBC_RANDOM_IV=${NSS_SSL_CBC_RANDOM_IV-1} export NSS_SSL_CBC_RANDOM_IV @@ -244,28 +166,5 @@ done # Don't throw "old profile" dialog box. export MOZ_ALLOW_DOWNGRADE=1 -# Make sure at-spi-bus is running -if ! dbus-send --session \ - --dest=org.freedesktop.DBus \ - --type=method_call \ - --print-reply \ - /org/freedesktop/DBus \ - org.freedesktop.DBus.ListNames \ - | grep org.a11y.Bus > /dev/null; then - if [ -f "$MOZ_LIB_DIR/firefox/bundled/libexec/at-spi-bus-launcher" ]; then - echo "Starting a11y dbus service..." - $MOZ_LIB_DIR/firefox/bundled/libexec/at-spi-bus-launcher & - else - echo "Running without a11y support!" - fi -fi - # Run the browser -debugging=0 -if [ $debugging = 1 ] -then - echo $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@" -fi - - exec $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@" diff --git a/SPECS/firefox.spec b/SPECS/firefox.spec index 7c30e7f..c1a6fe4 100644 --- a/SPECS/firefox.spec +++ b/SPECS/firefox.spec @@ -119,7 +119,7 @@ end} %global mozappdir %{_libdir}/%{name} %global mozappdirdev %{_libdir}/%{name}-devel-%{version} -%global langpackdir %{mozappdir}/langpacks +%global langpackdir %{mozappdir}/browser/extensions %global tarballdir %{name}-%{version} %global pre_version esr @@ -128,8 +128,8 @@ end} Summary: Mozilla Firefox Web browser Name: firefox -Version: 91.6.0 -Release: 1%{?dist} +Version: 91.7.0 +Release: 3%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ %if 0%{?rhel} == 9 @@ -143,7 +143,7 @@ ExcludeArch: %{ix86} %endif %endif %if 0%{?rhel} == 7 -ExcludeArch: s390 ppc +ExcludeArch: aarch64 s390 ppc %endif # We can't use the official tarball as it contains some test files that use @@ -153,7 +153,8 @@ ExcludeArch: s390 ppc # Link to official tarball: https://hg.mozilla.org/releases/mozilla-release/archive/firefox-%%{version}%%{?pre_version}.source.tar.xz Source0: firefox-%{version}%{?pre_version}.processed-source.tar.xz %if %{build_langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20220202.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20220307.tar.xz + %endif Source2: cbindgen-vendor.tar.xz Source3: process-official-tarball @@ -205,14 +206,11 @@ Patch513: mozilla-bmo998749.patch Patch514: mozilla-s390x-skia-gradient.patch Patch515: mozilla-bmo1626236.patch Patch518: D110204-fscreen.diff +Patch519: expat-CVE-2022-25235.patch +Patch520: expat-CVE-2022-25236.patch +Patch521: expat-CVE-2022-25315.patch # Flatpak patches - -# CentOS patches -%if 0%{?centos} -Patch10000: Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch -Patch10001: Bug-1526653---fix_user_vfp_armv7.patch -%endif %if %{?system_nss} %if !0%{?bundle_nss} @@ -458,6 +456,9 @@ echo "use_rustts %{?use_rustts}" #%patch514 -p1 -b .mozilla-s390x-skia-gradient %patch515 -p1 -b .mozilla-bmo1626236 %patch518 -p1 -b .D110204-fscreen.diff +%patch519 -p1 -b .expat-CVE-2022-25235 +%patch520 -p1 -b .expat-CVE-2022-25236 +%patch521 -p1 -b .expat-CVE-2022-25315 %patch1001 -p1 -b .ppc64le-inline @@ -470,13 +471,6 @@ echo "use_rustts %{?use_rustts}" %endif %endif -%if 0%{?centos} -%ifarch %{arm} -%patch 10000 -p1 -b .centos.armhfp -%patch 10001 -p1 -b .centos.armhfp2 -%endif -%endif - %{__rm} -f .mozconfig %{__cp} %{SOURCE10} .mozconfig %if %{official_branding} @@ -666,7 +660,7 @@ function build_bundled_package() { echo $PKG_CONFIG_PATH rpm -ivh %{SOURCE403} - rpmbuild --nodeps --define '_prefix %{bundled_install_path}' -ba %{_specdir}/nss.spec + rpmbuild --nodeps --define '_prefix %{bundled_install_path}' --without=tests -ba %{_specdir}/nss.spec pushd %{_buildrootdir} #cleanup #rm -rf {_buildrootdir}/usr/lib/debug/* @@ -900,9 +894,9 @@ ls %{_buildrootdir} export MACH_USE_SYSTEM_PYTHON=1 %if 0%{?use_llvmts} #scl enable llvm-toolset-%{llvm_version} './mach build -v' - ./mach build -v + ./mach build -v || exit 1 %else - ./mach build -v + ./mach build -v || exit 1 %endif # Look for the reason we get: /usr/lib/rpm/debugedit: canonicalization unexpectedly shrank by one character readelf -wl objdir/dist/bin/libxul.so | grep "/" @@ -1270,6 +1264,19 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* Mon Mar 07 2022 Eike Rathke - 91.7.0-3 +- Update to 91.7.0 build3 + +* Wed Mar 02 2022 Jan Horak - 91.7.0-2 +- Added expat backports of CVE-2022-25235, CVE-2022-25236 and CVE-2022-25315 + +* Tue Mar 01 2022 Eike Rathke - 91.7.0-1 +- Update to 91.7.0 build2 + +* Fri Feb 25 2022 Jan Horak - 91.6.0-2 +- Install langpacks to the browser/extensions to make them available in UI: + rhbz#2030190 + * Wed Feb 02 2022 Eike Rathke - 91.6.0-1 - Update to 91.6.0 build1