From 5a7f33de565593aa9981d1c1f46ab72839209c92 Mon Sep 17 00:00:00 2001 From: "Christian Holler (:decoder)" Date: Fri, 19 Apr 2024 15:28:19 +0000 Subject: [PATCH] Bug 1883107 - Limit MessageTask blocking in fuzzing. r=nika Differential Revision: https://phabricator.services.mozilla.com/D207715 --- ipc/glue/MessageChannel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ipc/glue/MessageChannel.cpp b/ipc/glue/MessageChannel.cpp index 16eb897175d1..544ce59b8ec2 100644 --- a/ipc/glue/MessageChannel.cpp +++ b/ipc/glue/MessageChannel.cpp @@ -1604,9 +1604,13 @@ nsresult MessageChannel::MessageTask::Run() { return NS_OK; } + Channel()->AssertWorkerThread(); + mMonitor->AssertSameMonitor(*Channel()->mMonitor); + #ifdef FUZZING_SNAPSHOT if (!mIsFuzzMsg) { - if (fuzzing::Nyx::instance().started()) { + if (fuzzing::Nyx::instance().started() && XRE_IsParentProcess() && + Channel()->IsCrossProcess()) { // Once we started fuzzing, prevent non-fuzzing tasks from being // run and potentially blocking worker threads. // @@ -1622,8 +1626,6 @@ nsresult MessageChannel::MessageTask::Run() { } #endif - Channel()->AssertWorkerThread(); - mMonitor->AssertSameMonitor(*Channel()->mMonitor); proxy = Channel()->Listener()->GetLifecycleProxy(); Channel()->RunMessage(proxy, *this);