зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1538072 - Crash if a null principal or a non-file uri tries to load a file:// uri (ContentParent.cpp case) r=nika
Differential Revision: https://phabricator.services.mozilla.com/D34171 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
0934b12c0a
Коммит
cb9ccdf33d
|
@ -492,6 +492,9 @@ pref("browser.tabs.remote.separatePrivilegedContentProcess", true);
|
|||
// for certain mozilla webpages (which are listed in the pref
|
||||
// browser.tabs.remote.separatedMozillaDomains).
|
||||
pref("browser.tabs.remote.separatePrivilegedMozillaWebContentProcess", false);
|
||||
// This pref will cause assertions when a remoteType triggers a process switch
|
||||
// to a new remoteType it should not be able to trigger.
|
||||
pref("browser.tabs.remote.enforceRemoteTypeRestrictions", true);
|
||||
#endif
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
|
|
|
@ -924,7 +924,7 @@ nsresult ContentChild::ProvideWindowCommon(
|
|||
Unused << SendCreateWindowInDifferentProcess(
|
||||
aTabOpener, aChromeFlags, aCalledFromJS, aPositionSpecified,
|
||||
aSizeSpecified, uriToLoad, features, fullZoom, name,
|
||||
Principal(triggeringPrincipal), csp, referrerInfo);
|
||||
triggeringPrincipal, csp, referrerInfo);
|
||||
|
||||
// We return NS_ERROR_ABORT, so that the caller knows that we've abandoned
|
||||
// the window open as far as it is concerned.
|
||||
|
|
|
@ -4974,7 +4974,7 @@ mozilla::ipc::IPCResult ContentParent::RecvCreateWindowInDifferentProcess(
|
|||
const bool& aCalledFromJS, const bool& aPositionSpecified,
|
||||
const bool& aSizeSpecified, const Maybe<URIParams>& aURIToLoad,
|
||||
const nsCString& aFeatures, const float& aFullZoom, const nsString& aName,
|
||||
const IPC::Principal& aTriggeringPrincipal, nsIContentSecurityPolicy* aCsp,
|
||||
nsIPrincipal* aTriggeringPrincipal, nsIContentSecurityPolicy* aCsp,
|
||||
nsIReferrerInfo* aReferrerInfo) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!nsContentUtils::IsSpecialName(aName));
|
||||
|
||||
|
@ -4983,6 +4983,36 @@ mozilla::ipc::IPCResult ContentParent::RecvCreateWindowInDifferentProcess(
|
|||
nsCOMPtr<nsIURI> uriToLoad = DeserializeURI(aURIToLoad);
|
||||
int32_t openLocation = nsIBrowserDOMWindow::OPEN_NEWWINDOW;
|
||||
|
||||
// If we have enough data, check the schemes of the loader and loadee
|
||||
// to make sure they make sense.
|
||||
if (uriToLoad && uriToLoad->SchemeIs("file") &&
|
||||
!GetRemoteType().EqualsLiteral(FILE_REMOTE_TYPE) &&
|
||||
Preferences::GetBool("browser.tabs.remote.enforceRemoteTypeRestrictions",
|
||||
false)) {
|
||||
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
|
||||
# ifdef DEBUG
|
||||
nsAutoCString uriToLoadStr;
|
||||
uriToLoad->GetAsciiSpec(uriToLoadStr);
|
||||
|
||||
nsCOMPtr<nsIURI> triggeringUri;
|
||||
aTriggeringPrincipal->GetURI(getter_AddRefs(triggeringUri));
|
||||
nsAutoCString triggeringUriStr;
|
||||
if (triggeringUri) {
|
||||
triggeringUri->GetAsciiSpec(triggeringUriStr);
|
||||
}
|
||||
|
||||
NS_WARNING(nsPrintfCString(
|
||||
"RecvCreateWindowInDifferentProcess blocked loading file "
|
||||
"scheme from non-file remotetype: %s tried to load %s",
|
||||
triggeringUriStr.get(), uriToLoadStr.get())
|
||||
.get());
|
||||
# endif
|
||||
MOZ_CRASH(
|
||||
"RecvCreateWindowInDifferentProcess blocked loading improper scheme");
|
||||
#endif
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
nsresult rv;
|
||||
mozilla::ipc::IPCResult ipcResult = CommonCreateWindow(
|
||||
aThisTab, /* aSetOpener = */ false, aChromeFlags, aCalledFromJS,
|
||||
|
|
|
@ -531,8 +531,8 @@ class ContentParent final : public PContentParent,
|
|||
const bool& aCalledFromJS, const bool& aPositionSpecified,
|
||||
const bool& aSizeSpecified, const Maybe<URIParams>& aURIToLoad,
|
||||
const nsCString& aFeatures, const float& aFullZoom, const nsString& aName,
|
||||
const IPC::Principal& aTriggeringPrincipal,
|
||||
nsIContentSecurityPolicy* aCsp, nsIReferrerInfo* aReferrerInfo);
|
||||
nsIPrincipal* aTriggeringPrincipal, nsIContentSecurityPolicy* aCsp,
|
||||
nsIReferrerInfo* aReferrerInfo);
|
||||
|
||||
static void BroadcastBlobURLRegistration(
|
||||
const nsACString& aURI, BlobImpl* aBlobImpl, nsIPrincipal* aPrincipal,
|
||||
|
|
|
@ -1297,7 +1297,7 @@ parent:
|
|||
nsCString aFeatures,
|
||||
float aFullZoom,
|
||||
nsString aName,
|
||||
Principal aTriggeringPrincipal,
|
||||
nsIPrincipal aTriggeringPrincipal,
|
||||
nsIContentSecurityPolicy aCsp,
|
||||
nsIReferrerInfo aReferrerInfo);
|
||||
|
||||
|
|
|
@ -843,6 +843,7 @@ pref("extensions.systemAddon.update.url", "https://aus5.mozilla.org/update/3/Sys
|
|||
pref("browser.tabs.remote.separateFileUriProcess", false);
|
||||
pref("browser.tabs.remote.allowLinkedWebInFileUriProcess", true);
|
||||
pref("browser.tabs.remote.separatePrivilegedContentProcess", false);
|
||||
pref("browser.tabs.remote.enforceRemoteTypeRestrictions", false);
|
||||
|
||||
// Allow Web Authentication
|
||||
pref("security.webauth.webauthn_enable_android_fido2", true);
|
||||
|
|
|
@ -3177,6 +3177,10 @@ pref("browser.tabs.remote.separateFileUriProcess", true);
|
|||
// content process, causes compatibility issues.
|
||||
pref("browser.tabs.remote.allowLinkedWebInFileUriProcess", true);
|
||||
|
||||
// This pref will cause assertions when a remoteType triggers a process switch
|
||||
// to a new remoteType it should not be able to trigger.
|
||||
pref("browser.tabs.remote.enforceRemoteTypeRestrictions", false);
|
||||
|
||||
// Pref to control whether we use a separate privileged content process
|
||||
// for about: pages. This pref name did not age well: we will have multiple
|
||||
// types of privileged content processes, each with different privileges.
|
||||
|
|
Загрузка…
Ссылка в новой задаче