Bug 1533918 - Disallow CrossProcessMutex when sandboxing is enabled. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D50941

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gian-Carlo Pascutto 2019-10-30 17:59:15 +00:00
parent 7efef281eb
commit 00aa39e853

View File

@ -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();