diff options
author | wiz <wiz@pkgsrc.org> | 2020-06-18 12:56:40 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2020-06-18 12:56:40 +0000 |
commit | 8574cd1dc88c2df0a8cdf8c2cfede5e46b91c668 (patch) | |
tree | b41df7da3c4c5d2182837680c5679d2374ed6220 /security | |
parent | 47ac1b91c7be7731d84cde17d735b3c27764e60f (diff) | |
download | pkgsrc-8574cd1dc88c2df0a8cdf8c2cfede5e46b91c668.tar.gz |
tor-browser: merge multiprocess changes from firefox68
Bump PKGREVISION.
Diffstat (limited to 'security')
6 files changed, 36 insertions, 217 deletions
diff --git a/security/tor-browser/Makefile b/security/tor-browser/Makefile index 501e84130df..8c4cf6486a0 100644 --- a/security/tor-browser/Makefile +++ b/security/tor-browser/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.67 2020/06/17 18:02:53 nia Exp $ +# $NetBSD: Makefile,v 1.68 2020/06/18 12:56:40 wiz Exp $ DISTNAME= src-firefox-tor-browser-68.9.0esr-9.5-1-build2 PKGNAME= tor-browser-9.5 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= security www MASTER_SITES= https://dist.torproject.org/torbrowser/${PKGVERSION_NOREV}/ EXTRACT_SUFX= .tar.xz diff --git a/security/tor-browser/distinfo b/security/tor-browser/distinfo index e0774237fbc..3c5d2b7b6cd 100644 --- a/security/tor-browser/distinfo +++ b/security/tor-browser/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.22 2020/06/17 18:02:53 nia Exp $ +$NetBSD: distinfo,v 1.23 2020/06/18 12:56:40 wiz Exp $ SHA1 (src-firefox-tor-browser-68.9.0esr-9.5-1-build2.tar.xz) = 27b3e18e92341557b9c8b18afd114d458dd2e403 RMD160 (src-firefox-tor-browser-68.9.0esr-9.5-1-build2.tar.xz) = db61ef7788f1b6c4111e7a4c6df56c7bd51e6777 @@ -11,7 +11,7 @@ Size (tor-browser-linux64-9.5_en-US.tar.xz) = 79022648 bytes SHA1 (patch-.mozconfig) = 66fbb2f113091eee1f022cd656231f845b04b0f8 SHA1 (patch-aa) = 9f7200c411cd2217a80ec10a276c8877bc6b845c SHA1 (patch-browser_app_profile_000-tor-browser.js) = 84a0a15605fff0e22f3150bce901a296fc920280 -SHA1 (patch-browser_app_profile_firefox.js) = 076cc2892547bac07fe907533f4e821f13f5738e +SHA1 (patch-browser_app_profile_firefox.js) = cf93582b68b8d4e72c3c25682ab9138e185418c8 SHA1 (patch-build_moz.configure_rust.configure) = b57a9b1451dc426d75774f73d7c05fc98fe6e317 SHA1 (patch-dom_base_nsAttrName.h) = ac7ba441a3b27df2855cf2673eea36b1cb44ad49 SHA1 (patch-dom_media_CubebUtils.cpp) = 3cd2c65ab281d802c56216565970450767a3fb24 @@ -19,11 +19,10 @@ SHA1 (patch-gfx_angle_checkout_src_common_third__party_smhasher_src_PMurHash.cpp SHA1 (patch-gfx_angle_checkout_src_compiler_translator_InfoSink.h) = 2f73c76c48852613e0c55c1680fcc2a9eb3cf4ef SHA1 (patch-gfx_gl_GLContextProviderGLX.cpp) = 2c909a10a341e600392417240ad0c556f495d6ba SHA1 (patch-gfx_skia_skia_src_core_SkCpu.cpp) = 36218819254f3681b9c717d652ea78c9f20d49ad +SHA1 (patch-gfx_thebes_gfxPlatform.cpp) = e4a25e4a96055b1c42ec018b02d1828257a571de SHA1 (patch-ipc_chromium_src_base_message__pump__libevent.cc) = 4a6606da590cfb8d855bde58b9c6f90e98d0870c SHA1 (patch-ipc_chromium_src_base_platform__thread__posix.cc) = 35d20981d33ccdb1d8ffb8039e48798777f11658 SHA1 (patch-ipc_chromium_src_chrome_common_ipc__channel__posix.cc) = d634805bf3b02475081cb2f263e91e3f4c481a29 -SHA1 (patch-ipc_glue_CrossProcessSemaphore.h) = 25e24743060acf10c776c6b3b3660f52a2e9fbe8 -SHA1 (patch-ipc_glue_CrossProcessSemaphore__posix.cpp) = f8d155ee66008b7cc4052b6a889327543b89e0bb SHA1 (patch-ipc_glue_GeckoChildProcessHost.cpp) = 260c29bacd8bf265951b7a412f850bf2b292c836 SHA1 (patch-js_src_threading_posix_Thread.cpp) = 47e612a676e614fd6dd43b8a3140218a3fbdc7fa SHA1 (patch-js_src_util_NativeStack.cpp) = 2c6f844d38343f40ebbc8fd665279256e4ae6d35 diff --git a/security/tor-browser/patches/patch-browser_app_profile_firefox.js b/security/tor-browser/patches/patch-browser_app_profile_firefox.js index 9d2ddee2cb7..b93197e7054 100644 --- a/security/tor-browser/patches/patch-browser_app_profile_firefox.js +++ b/security/tor-browser/patches/patch-browser_app_profile_firefox.js @@ -1,8 +1,8 @@ -$NetBSD: patch-browser_app_profile_firefox.js,v 1.2 2020/03/13 17:59:27 wiz Exp $ +$NetBSD: patch-browser_app_profile_firefox.js,v 1.3 2020/06/18 12:56:40 wiz Exp $ ---- browser/app/profile/firefox.js.orig 2019-07-06 01:48:29.000000000 +0000 +--- browser/app/profile/firefox.js.orig 2020-05-28 00:01:33.000000000 +0000 +++ browser/app/profile/firefox.js -@@ -1865,6 +1865,15 @@ pref("prio.publicKeyB", "26E6674E65425B8 +@@ -1862,6 +1862,12 @@ pref("prio.publicKeyB", "26E6674E65425B8 pref("toolkit.coverage.enabled", false); pref("toolkit.coverage.endpoint.base", "https://coverage.mozilla.org"); @@ -12,9 +12,6 @@ $NetBSD: patch-browser_app_profile_firefox.js,v 1.2 2020/03/13 17:59:27 wiz Exp +// Enable system addons, for example langpacks from www/firefox-l10n +pref("extensions.autoDisableScopes", 11); + -+// Disable multiprocess window support. Workaround for PR 53273. -+pref("browser.tabs.remote.autostart", false); -+ // Discovery prefs pref("browser.discovery.enabled", true); pref("browser.discovery.containers.enabled", true); diff --git a/security/tor-browser/patches/patch-gfx_thebes_gfxPlatform.cpp b/security/tor-browser/patches/patch-gfx_thebes_gfxPlatform.cpp new file mode 100644 index 00000000000..800fa358bde --- /dev/null +++ b/security/tor-browser/patches/patch-gfx_thebes_gfxPlatform.cpp @@ -0,0 +1,28 @@ +$NetBSD: patch-gfx_thebes_gfxPlatform.cpp,v 1.1 2020/06/18 12:56:40 wiz Exp $ + +Don't rely on CrossProcessSemaphore on NetBSD. It has some implementation +issues that cause issues (kern/55386, not available on NetBSD<9) + +This idea is borrowed from macOS which has the same limitation. + +--- gfx/thebes/gfxPlatform.cpp.orig 2020-05-28 00:01:45.000000000 +0000 ++++ gfx/thebes/gfxPlatform.cpp +@@ -2991,6 +2991,10 @@ bool gfxPlatform::UsesOffMainThreadCompo + } + + bool gfxPlatform::UsesTiling() const { ++#ifdef __NetBSD__ ++ // Avoid relying on CrossProcessSemaphore ++ return true; ++#else + bool usesSkia = GetDefaultContentBackend() == BackendType::SKIA; + + // We can't just test whether the PaintThread is initialized here because +@@ -3002,6 +3006,7 @@ bool gfxPlatform::UsesTiling() const { + + return gfxPrefs::LayersTilesEnabled() || + (gfxPrefs::LayersTilesEnabledIfSkiaPOMTP() && usesSkia && usesPOMTP); ++#endif + } + + bool gfxPlatform::ContentUsesTiling() const { diff --git a/security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore.h b/security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore.h deleted file mode 100644 index d6775382214..00000000000 --- a/security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore.h +++ /dev/null @@ -1,18 +0,0 @@ -$NetBSD: patch-ipc_glue_CrossProcessSemaphore.h,v 1.2 2020/03/13 17:59:27 wiz Exp $ - ---- ipc/glue/CrossProcessSemaphore.h.orig 2018-10-18 20:06:06.000000000 +0000 -+++ ipc/glue/CrossProcessSemaphore.h -@@ -93,7 +93,13 @@ private: - HANDLE mSemaphore; - #elif !defined(OS_MACOSX) - RefPtr<mozilla::ipc::SharedMemoryBasic> mSharedBuffer; -+#if defined(__NetBSD__) -+ pthread_mutex_t* mMutex; -+ pthread_cond_t* mNotZero; -+ uint32_t* mValue; -+#else - sem_t* mSemaphore; -+#endif - mozilla::Atomic<int32_t>* mRefCount; - #endif - }; diff --git a/security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp b/security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp deleted file mode 100644 index 1d73002484a..00000000000 --- a/security/tor-browser/patches/patch-ipc_glue_CrossProcessSemaphore__posix.cpp +++ /dev/null @@ -1,187 +0,0 @@ -$NetBSD: patch-ipc_glue_CrossProcessSemaphore__posix.cpp,v 1.3 2020/03/13 17:59:27 wiz Exp $ - ---- ipc/glue/CrossProcessSemaphore_posix.cpp.orig 2019-01-18 00:20:30.000000000 +0000 -+++ ipc/glue/CrossProcessSemaphore_posix.cpp -@@ -9,6 +9,11 @@ - #include "nsDebug.h" - #include "nsISupportsImpl.h" - #include <errno.h> -+#if defined(__NetBSD__) -+#include <iostream> -+#include <unistd.h> -+#include <limits> -+#endif - - static const uint64_t kNsPerMs = 1000000; - static const uint64_t kNsPerSec = 1000000000; -@@ -16,7 +21,13 @@ static const uint64_t kNsPerSec = 100000 - namespace { - - struct SemaphoreData { -+#if defined(__NetBSD__) -+ pthread_mutex_t mMutex; -+ pthread_cond_t mNotZero; -+ uint32_t mValue; -+#else - sem_t mSemaphore; -+#endif - mozilla::Atomic<int32_t> mRefCount; - uint32_t mInitialValue; - }; -@@ -42,13 +53,27 @@ namespace mozilla { - return nullptr; - } - -+#if defined(__NetBSD__) -+ data->mValue = aInitialValue; -+ if (pthread_mutex_init(&data->mMutex, NULL) || -+ pthread_cond_init(&data->mNotZero, NULL) ) { -+ return nullptr; -+ } -+#else - if (sem_init(&data->mSemaphore, 1, aInitialValue)) { - return nullptr; - } -+#endif - - CrossProcessSemaphore* sem = new CrossProcessSemaphore; - sem->mSharedBuffer = sharedBuffer; -+#if defined(__NetBSD__) -+ sem->mMutex = &data->mMutex; -+ sem->mNotZero = &data->mNotZero; -+ sem->mValue = &data->mValue; -+#else - sem->mSemaphore = &data->mSemaphore; -+#endif - sem->mRefCount = &data->mRefCount; - *sem->mRefCount = 1; - -@@ -83,23 +108,44 @@ namespace mozilla { - - int32_t oldCount = data->mRefCount++; - if (oldCount == 0) { -+#if defined(__NetBSD__) -+ if (pthread_mutex_init(&data->mMutex, NULL) || -+ pthread_cond_init(&data->mNotZero, NULL) ) { -+ data->mRefCount--; -+ return nullptr; -+ } -+#else - // The other side has already let go of their CrossProcessSemaphore, so now - // mSemaphore is garbage. We need to re-initialize it. - if (sem_init(&data->mSemaphore, 1, data->mInitialValue)) { - data->mRefCount--; - return nullptr; - } -+#endif - } - - CrossProcessSemaphore* sem = new CrossProcessSemaphore; - sem->mSharedBuffer = sharedBuffer; -+#if defined(__NetBSD__) -+ sem->mMutex = &data->mMutex; -+ sem->mNotZero = &data->mNotZero; -+ sem->mValue = &data->mValue; -+#else - sem->mSemaphore = &data->mSemaphore; -+#endif - sem->mRefCount = &data->mRefCount; - return sem; - } - - CrossProcessSemaphore::CrossProcessSemaphore() -- : mSemaphore(nullptr), mRefCount(nullptr) { -+#if defined(__NetBSD__) -+ : mMutex (nullptr) -+ , mNotZero (nullptr) -+ , mValue (nullptr) -+#else -+ : mSemaphore(nullptr) -+#endif -+ , mRefCount(nullptr) { - MOZ_COUNT_CTOR(CrossProcessSemaphore); - } - -@@ -108,16 +154,57 @@ CrossProcessSemaphore::~CrossProcessSema - - if (oldCount == 0) { - // Nothing can be done if the destroy fails so ignore return code. -+#if defined(__NetBSD__) -+ (void)pthread_cond_destroy(mNotZero); -+ (void)pthread_mutex_destroy(mMutex); -+#else - Unused << sem_destroy(mSemaphore); -+#endif - } - - MOZ_COUNT_DTOR(CrossProcessSemaphore); - } - -+#if defined(__NetBSD__) -+static struct timespec -+makeAbsTime(const Maybe<TimeDuration>& aWaitTime) { -+ struct timespec ts; -+ if (aWaitTime.isSome()) { -+ clock_gettime(CLOCK_REALTIME, &ts); -+ ts.tv_nsec += (kNsPerMs * aWaitTime->ToMilliseconds()); -+ ts.tv_sec += ts.tv_nsec / kNsPerSec; -+ ts.tv_nsec %= kNsPerSec; -+ } -+ else { -+ ts.tv_sec = std::numeric_limits<time_t>::max(); -+ ts.tv_nsec = 0; -+ } -+ return ts; -+} -+#endif -+ - bool CrossProcessSemaphore::Wait(const Maybe<TimeDuration>& aWaitTime) { - MOZ_ASSERT(*mRefCount > 0, - "Attempting to wait on a semaphore with zero ref count"); - int ret; -+#if defined(__NetBSD__) -+ struct timespec ts = makeAbsTime(aWaitTime); -+ -+ ret = pthread_mutex_lock(mMutex); -+ -+ if (ret == 0) { -+ while (ret == 0 && mValue == 0) { -+ ret = pthread_cond_timedwait(mNotZero, mMutex, &ts); -+ while (ret == -1 && errno == EINTR) { -+ ret = pthread_cond_timedwait(mNotZero, mMutex, &ts); -+ } -+ } -+ if (ret == 0) { -+ --(*mValue); -+ } -+ pthread_mutex_unlock(mMutex); -+ } -+#else - if (aWaitTime.isSome()) { - struct timespec ts; - if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { -@@ -134,13 +221,24 @@ bool CrossProcessSemaphore::Wait(const M - while ((ret = sem_wait(mSemaphore)) == -1 && errno == EINTR) { - } - } -+#endif - return ret == 0; - } - - void CrossProcessSemaphore::Signal() { - MOZ_ASSERT(*mRefCount > 0, - "Attempting to signal a semaphore with zero ref count"); -+#if defined(__NetBSD__) -+ int ret; -+ ret = pthread_mutex_lock(mMutex); -+ if (ret == 0) { -+ ++(*mValue); -+ pthread_cond_signal(mNotZero); -+ pthread_mutex_unlock(mMutex); -+ } -+#else - sem_post(mSemaphore); -+#endif - } - - CrossProcessSemaphoreHandle CrossProcessSemaphore::ShareToProcess( |