Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Mar 2021 09:58:23 +0000 (UTC)
From:      Christoph Moench-Tegeder <cmt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r567916 - in head/www/firefox: . files
Message-ID:  <202103090958.1299wNjo061701@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cmt
Date: Tue Mar  9 09:58:23 2021
New Revision: 567916
URL: https://svnweb.freebsd.org/changeset/ports/567916

Log:
  firefox: import upstream bugfixes
  
  1 https://bugzilla.mozilla.org/show_bug.cgi?id=1694670
    "Linux startup crash in [@ qcms_data_create_rgb_with_gamma]"
    crash on startup when loading certain ICC profiles
  2 https://bugzilla.mozilla.org/show_bug.cgi?id=1694699
    "Investigate tabs API regression in Firefox 86"
    regression causing loss of tabs from tab groups
  
  PR:		253886 ([2])
  Reported by:	Hans Petter Selasky [1], Graham Perrin [2]
  MFH:		2021Q1

Added:
  head/www/firefox/files/patch-bug1694670   (contents, props changed)
  head/www/firefox/files/patch-bug1694699   (contents, props changed)
Modified:
  head/www/firefox/Makefile

Modified: head/www/firefox/Makefile
==============================================================================
--- head/www/firefox/Makefile	Tue Mar  9 09:57:59 2021	(r567915)
+++ head/www/firefox/Makefile	Tue Mar  9 09:58:23 2021	(r567916)
@@ -3,7 +3,7 @@
 
 PORTNAME=	firefox
 DISTVERSION=	86.0
-PORTREVISION=	2
+PORTREVISION=	3
 PORTEPOCH=	2
 CATEGORIES=	www
 MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \

Added: head/www/firefox/files/patch-bug1694670
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/firefox/files/patch-bug1694670	Tue Mar  9 09:58:23 2021	(r567916)
@@ -0,0 +1,22 @@
+diff --git gfx/qcms/src/iccread.rs gfx/qcms/src/iccread.rs
+--- gfx/qcms/src/iccread.rs
++++ gfx/qcms/src/iccread.rs
+@@ -229,7 +229,7 @@
+     read_u16(mem, offset)
+ }
+ pub fn write_u32(mem: &mut [u8], offset: usize, value: u32) {
+-    if offset <= mem.len() - std::mem::size_of_val(&value) {
++    if offset > mem.len() - std::mem::size_of_val(&value) {
+         panic!("OOB");
+     }
+     let mem = mem.as_mut_ptr();
+@@ -238,7 +238,7 @@
+     }
+ }
+ pub fn write_u16(mem: &mut [u8], offset: usize, value: u16) {
+-    if offset <= mem.len() - std::mem::size_of_val(&value) {
++    if offset > mem.len() - std::mem::size_of_val(&value) {
+         panic!("OOB");
+     }
+     let mem = mem.as_mut_ptr();
+

Added: head/www/firefox/files/patch-bug1694699
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/firefox/files/patch-bug1694699	Tue Mar  9 09:58:23 2021	(r567916)
@@ -0,0 +1,115 @@
+diff --git browser/components/extensions/parent/ext-tabs.js browser/components/extensions/parent/ext-tabs.js
+--- browser/components/extensions/parent/ext-tabs.js
++++ browser/components/extensions/parent/ext-tabs.js
+@@ -217,9 +217,13 @@
+       function sanitize(tab, changeInfo) {
+         let result = {};
+         let nonempty = false;
+-        const hasTabs = tab.hasTabPermission;
+         for (let prop in changeInfo) {
+-          if (hasTabs || !restricted.has(prop)) {
++          // In practice, changeInfo contains at most one property from
++          // restricted. Therefore it is not necessary to cache the value
++          // of tab.hasTabPermission outside the loop.
++          // Unnecessarily accessing tab.hasTabPermission can cause bugs, see
++          // https://bugzilla.mozilla.org/show_bug.cgi?id=1694699#c21
++          if (!restricted.has(prop) || tab.hasTabPermission) {
+             nonempty = true;
+             result[prop] = changeInfo[prop];
+           }
+diff --git browser/components/extensions/test/browser/browser_ext_tabs_hide.js browser/components/extensions/test/browser/browser_ext_tabs_hide.js
+--- browser/components/extensions/test/browser/browser_ext_tabs_hide.js
++++ browser/components/extensions/test/browser/browser_ext_tabs_hide.js
+@@ -349,6 +349,7 @@
+       if ("hidden" in changeInfo) {
+         browser.test.assertEq(tabId, testTab.id, "correct tab was hidden");
+         browser.test.assertTrue(changeInfo.hidden, "tab is hidden");
++        browser.test.assertEq(tab.url, testTab.url, "tab has correct URL");
+         browser.test.sendMessage("changeInfo");
+       }
+     });
+diff --git browser/components/extensions/test/browser/browser_ext_tabs_move_discarded.js browser/components/extensions/test/browser/browser_ext_tabs_move_discarded.js
+--- browser/components/extensions/test/browser/browser_ext_tabs_move_discarded.js
++++ browser/components/extensions/test/browser/browser_ext_tabs_move_discarded.js
+@@ -2,7 +2,7 @@
+ /* vim: set sts=2 sw=2 et tw=80: */
+ "use strict";
+ 
+-add_task(async function() {
++add_task(async function move_discarded_to_window() {
+   let extension = ExtensionTestUtils.loadExtension({
+     manifest: { permissions: ["tabs"] },
+     background: async function() {
+@@ -29,3 +29,54 @@
+   await extension.awaitFinish("tabs.move");
+   await extension.unload();
+ });
++
++add_task(async function move_hidden_discarded_to_window() {
++  let extensionWithoutTabsPermission = ExtensionTestUtils.loadExtension({
++    manifest: {
++      permissions: ["http://example.com/"],
++    },
++    background() {
++      browser.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
++        if (changeInfo.hidden) {
++          browser.test.assertEq(
++            tab.url,
++            "http://example.com/?hideme",
++            "tab.url is correctly observed without tabs permission"
++          );
++          browser.test.sendMessage("onUpdated_checked");
++        }
++      });
++    },
++  });
++  await extensionWithoutTabsPermission.startup();
++
++  let extension = ExtensionTestUtils.loadExtension({
++    manifest: { permissions: ["tabs", "tabHide"] },
++    // ExtensionControlledPopup's populateDescription method requires an addon:
++    useAddonManager: "temporary",
++    async background() {
++      let url = "http://example.com/?hideme";
++      let tab = await browser.tabs.create({ url, discarded: true });
++      await browser.tabs.hide(tab.id);
++
++      let { id: windowId } = await browser.windows.create();
++
++      // Move the tab into that window
++      [tab] = await browser.tabs.move(tab.id, { windowId, index: -1 });
++      browser.test.assertTrue(tab.discarded, "Tab should still be discarded");
++      browser.test.assertTrue(tab.hidden, "Tab should still be hidden");
++      browser.test.assertEq(url, tab.url, "Tab URL should still be correct");
++
++      await browser.windows.remove(windowId);
++      browser.test.notifyPass("move_hidden_discarded_to_window");
++    },
++  });
++
++  await extension.startup();
++  await extension.awaitFinish("move_hidden_discarded_to_window");
++  await extension.unload();
++
++  await extensionWithoutTabsPermission.awaitMessage("onUpdated_checked");
++  await extensionWithoutTabsPermission.awaitMessage("onUpdated_checked");
++  await extensionWithoutTabsPermission.unload();
++});
+diff --git mobile/android/components/extensions/ext-tabs.js mobile/android/components/extensions/ext-tabs.js
+--- mobile/android/components/extensions/ext-tabs.js
++++ mobile/android/components/extensions/ext-tabs.js
+@@ -233,9 +233,11 @@
+             function sanitize(tab, changeInfo) {
+               const result = {};
+               let nonempty = false;
+-              const hasTabs = tab.hasTabPermission;
+               for (const prop in changeInfo) {
+-                if (hasTabs || !restricted.includes(prop)) {
++                // In practice, changeInfo contains at most one property from
++                // restricted. Therefore it is not necessary to cache the value
++                // of tab.hasTabPermission outside the loop.
++                if (!restricted.includes(prop) || tab.hasTabPermission) {
+                   nonempty = true;
+                   result[prop] = changeInfo[prop];
+                 }
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103090958.1299wNjo061701>