Commit 521940b7 authored by Patrick Monette's avatar Patrick Monette Committed by Commit Bot

Don't warn about loaded shell extensions and IMEs

This is because shell extensions don't specifically target Chrome, they
just get automatically loaded by the OS. These will get blocked in phase
2 of third-party software blocking.

For IMEs, they are allowed because there is no viable alternative for
their implementation.

Bug: 829490
Change-Id: I501aad6e77734336161448f0e8e91ac78ec6d40d
Reviewed-on: https://chromium-review.googlesource.com/996586
Commit-Queue: Patrick Monette <pmonette@chromium.org>
Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548517}
parent 8b44ca49
......@@ -251,10 +251,14 @@ void ProblematicProgramsUpdater::OnNewModuleFound(
const ModuleInfoData& module_data) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// Only consider loaded modules.
// TODO(pmonette): Also consider blocked modules when that becomes possible.
if ((module_data.module_types & ModuleInfoData::kTypeLoadedModule) == 0)
// Only consider loaded modules that are not shell extensions or IMEs.
static constexpr uint32_t kModuleTypesBitmask =
ModuleInfoData::kTypeLoadedModule | ModuleInfoData::kTypeShellExtension |
ModuleInfoData::kTypeIme;
if ((module_data.module_types & kModuleTypesBitmask) !=
ModuleInfoData::kTypeLoadedModule) {
return;
}
// Explicitly whitelist modules whose signing cert's Subject field matches the
// one in the current executable. No attempt is made to check the validity of
......
......@@ -306,3 +306,31 @@ TEST_F(ProblematicProgramsUpdaterTest, WhitelistMatchingCertificateSubject) {
auto program_names = ProblematicProgramsUpdater::GetCachedPrograms();
ASSERT_EQ(0u, program_names.size());
}
// Registered modules are defined as either a shell extension or an IME.
TEST_F(ProblematicProgramsUpdaterTest, IgnoreRegisteredModules) {
AddProblematicProgram(dll1_, L"Shell Extension", Option::ADD_REGISTRY_ENTRY);
AddProblematicProgram(dll2_, L"Input Method Editor",
Option::ADD_REGISTRY_ENTRY);
auto problematic_programs_updater =
std::make_unique<ProblematicProgramsUpdater>(
exe_certificate_info(), module_list_filter(), installed_programs());
// Set the respective bit for registered modules.
auto module_data1 = CreateLoadedModuleInfoData();
module_data1.module_types |= ModuleInfoData::kTypeShellExtension;
auto module_data2 = CreateLoadedModuleInfoData();
module_data2.module_types |= ModuleInfoData::kTypeIme;
// Simulate the modules loading into the process.
problematic_programs_updater->OnNewModuleFound(ModuleInfoKey(dll1_, 0, 0, 0),
module_data1);
problematic_programs_updater->OnNewModuleFound(ModuleInfoKey(dll2_, 0, 0, 0),
module_data2);
problematic_programs_updater->OnModuleDatabaseIdle();
EXPECT_FALSE(ProblematicProgramsUpdater::HasCachedPrograms());
auto program_names = ProblematicProgramsUpdater::GetCachedPrograms();
ASSERT_EQ(0u, program_names.size());
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment