diff --git a/security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp b/security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
--- a/security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
+++ b/security/sandbox/win/src/sandboxbroker/sandboxBroker.cpp
@@ -380,17 +380,17 @@ static void AddDeveloperRepoDirToConfig(
                                     L"\\??\\MountPointManager");
   if (result != sandbox::SBOX_ALL_OK) {
     NS_ERROR("Failed to add rule for MountPointManager.");
     LOG_E("Failed (ResultCode %d) to add read access to MountPointManager",
           result);
   }
 }
 
-#if defined(MOZ_PROFILE_GENERATE)
+#if defined(MOZ_PROFILE_GENERATE) || defined(MOZ_CS_PROFILE_GENERATE)
 // It should only be allowed on instrumented builds, never on production
 // builds.
 static void AddLLVMProfilePathDirectoryToPolicy(
     sandbox::TargetConfig* aConfig) {
   std::wstring parentPath;
   if (GetLlvmProfileDir(parentPath)) {
     (void)aConfig->AllowFileAccess(sandbox::FileSemantics::kAllowAny,
                                    parentPath.c_str());
@@ -496,17 +496,17 @@ Result<Ok, mozilla::ipc::LaunchError> Sa
             result);
     }
   }
 #endif
 
   // Enable the child process to write log files when setup
   AddMozLogRulesToConfig(config, aEnvironment);
 
-#if defined(MOZ_PROFILE_GENERATE)
+#if defined(MOZ_PROFILE_GENERATE) || defined(MOZ_CS_PROFILE_GENERATE)
   AddLLVMProfilePathDirectoryToPolicy(config);
 #endif
 
   if (!mozilla::IsPackagedBuild()) {
     AddDeveloperRepoDirToConfig(config);
   }
 
   // Create the sandboxed process
