From 00aa39e85336e2f2dc8799dea7d9f3057d38ef67 Mon Sep 17 00:00:00 2001 From: Gian-Carlo Pascutto Date: Wed, 30 Oct 2019 17:59:15 +0000 Subject: [PATCH] Bug 1533918 - Disallow CrossProcessMutex when sandboxing is enabled. r=botond Differential Revision: https://phabricator.services.mozilla.com/D50941 --HG-- extra : moz-landing-system : lando --- ipc/glue/CrossProcessMutex_posix.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ipc/glue/CrossProcessMutex_posix.cpp b/ipc/glue/CrossProcessMutex_posix.cpp index 3320a0076c69..f7f5c69536b9 100644 --- a/ipc/glue/CrossProcessMutex_posix.cpp +++ b/ipc/glue/CrossProcessMutex_posix.cpp @@ -38,6 +38,11 @@ static void InitMutex(pthread_mutex_t* mMutex) { CrossProcessMutex::CrossProcessMutex(const char*) : mMutex(nullptr), mCount(nullptr) { +#if defined(MOZ_SANDBOX) + // POSIX mutexes in shared memory aren't guaranteed to be safe - and + // they specifically are not on Linux. + MOZ_RELEASE_ASSERT(false); +#endif mSharedBuffer = new ipc::SharedMemoryBasic; if (!mSharedBuffer->Create(sizeof(MutexData))) { MOZ_CRASH();