Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: chrome_elf/blacklist/blacklist.cc

Issue 2163803003: [chrome_elf] Removing blacklist finch for dynamic dll changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome_elf/blacklist/blacklist.h ('k') | chrome_elf/blacklist/test/blacklist_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome_elf/blacklist/blacklist.h" 5 #include "chrome_elf/blacklist/blacklist.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 delete thunk; 340 delete thunk;
341 341
342 // Record if we have initialized the blacklist. 342 // Record if we have initialized the blacklist.
343 g_blacklist_initialized = NT_SUCCESS(ret); 343 g_blacklist_initialized = NT_SUCCESS(ret);
344 344
345 // Mark the thunk storage as executable and prevent any future writes to it. 345 // Mark the thunk storage as executable and prevent any future writes to it.
346 page_executable = page_executable && 346 page_executable = page_executable &&
347 VirtualProtect(&g_thunk_storage, sizeof(g_thunk_storage), 347 VirtualProtect(&g_thunk_storage, sizeof(g_thunk_storage),
348 PAGE_EXECUTE_READ, &old_protect); 348 PAGE_EXECUTE_READ, &old_protect);
349 349
350 AddDllsFromRegistryToBlacklist();
351
352 return NT_SUCCESS(ret) && page_executable; 350 return NT_SUCCESS(ret) && page_executable;
353 } 351 }
354 352
355 void AddDllsFromRegistryToBlacklist() {
356 std::vector<std::wstring> dlls;
357
358 if (!nt::QueryRegValueMULTISZ(nt::HKCU, kRegistryFinchListPath,
359 kRegistryFinchListValueName, &dlls) ||
360 dlls.empty())
361 return;
362
363 // Add each DLL to the BL in memory
364 for (auto name : dlls) {
365 AddDllToBlacklist(name.c_str());
366 }
367
368 return;
369 }
370
371 } // namespace blacklist 353 } // namespace blacklist
OLDNEW
« no previous file with comments | « chrome_elf/blacklist/blacklist.h ('k') | chrome_elf/blacklist/test/blacklist_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698