зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1129040 - Query the chrome process blocklist service prior to instantiating plugins in the content process. r=billm
This commit is contained in:
Родитель
167ae6301c
Коммит
d9a7675005
|
@ -3258,8 +3258,9 @@ nsObjectLoadingContent::ShouldPlay(FallbackType &aReason, bool aIgnoreCurrentTyp
|
|||
}
|
||||
|
||||
// Before we check permissions, get the blocklist state of this plugin to set
|
||||
// the fallback reason correctly.
|
||||
uint32_t blocklistState = nsIBlocklistService::STATE_NOT_BLOCKED;
|
||||
// the fallback reason correctly. In the content process this will involve
|
||||
// an ipc call to chrome.
|
||||
uint32_t blocklistState = nsIBlocklistService::STATE_BLOCKED;
|
||||
pluginHost->GetBlocklistStateForType(mContentType,
|
||||
nsPluginHost::eExcludeNone,
|
||||
&blocklistState);
|
||||
|
|
|
@ -1276,6 +1276,13 @@ nsPluginHost::GetPluginForContentProcess(uint32_t aPluginId, nsNPAPIPlugin** aPl
|
|||
|
||||
nsPluginTag* pluginTag = PluginWithId(aPluginId);
|
||||
if (pluginTag) {
|
||||
// When setting up a bridge, double check with chrome to see if this plugin
|
||||
// is blocked hard. Note this does not protect against vulnerable plugins
|
||||
// that the user has explicitly allowed. :(
|
||||
if (pluginTag->IsBlocklisted()) {
|
||||
return NS_ERROR_PLUGIN_BLOCKLISTED;
|
||||
}
|
||||
|
||||
nsresult rv = EnsurePluginLoaded(pluginTag);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче