Commit 956f8294 authored by Jesse McKenna's avatar Jesse McKenna Committed by Commit Bot

Revert "Use consistent DLL to detect Application Verifier"

This reverts commit fd8fe93c.

Reason for revert: this change is causing chrome.exe to crash on startup. I received a report that chrome.exe looked for the string constant in memory and encountered some kind of error which caused it to crash. I will roll back for now to investigate.

Original change's description:
> Use consistent DLL to detect Application Verifier
> 
> To detect whether Application Verifier is running,
> sandbox/win/src/target_interceptions.cc checks if vrfcore.dll is loaded,
> while sandbox/win/src/handle_closer_agent.cc checks for verifier.dll.
> 
> This change makes both use verifier.dll, to be consistent and remove any
> confusion around whether these two are checking for the same thing (they
> are).
> 
>       Open Application Verifier
>       File > Add Application > chrome.exe (any chrome.exe binary works)
>       Under 'Tests', uncheck everything but Basics > Handles, then Save
>       Run chrome.exe with this change; it works normally
>         (on versions without lines 176-177, no pages will load)
>       Return to Application Verifier
>       Right-click chrome.exe > Delete Application, then Save
>         (so Chrome runs normally again)
> 
> Test: Manual
> Change-Id: If97a1115373c394f0cbbf1d31d3ca7b60549bbee
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1776781
> Commit-Queue: Jesse McKenna <jessemckenna@google.com>
> Reviewed-by: Greg Thompson <grt@chromium.org>
> Reviewed-by: Will Harris <wfh@chromium.org>
> Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#700323}

TBR=brucedawson@chromium.org,wfh@chromium.org,grt@chromium.org,jessemckenna@google.com

Change-Id: I79f41f6e93813befaf4e49604f7dcc1f8c1ddb48
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1828234Reviewed-by: default avatarDavid Bienvenu <davidbienvenu@chromium.org>
Commit-Queue: Jesse McKenna <jessemckenna@google.com>
Cr-Commit-Position: refs/heads/master@{#700493}
parent 7c3c1ebd
......@@ -195,8 +195,6 @@ NativeLibrary PinUser32Internal(NativeLibraryLoadError* error) {
} // namespace
const char kApplicationVerifierDllName[] = "verifier.dll";
// Uses the Windows 10 WRL API's to query the current system state. The API's
// we are using in the function below are supported in Win32 apps as per msdn.
// It looks like the API implementation is buggy at least on Surface 4 causing
......
......@@ -43,8 +43,6 @@ struct NativeLibraryLoadError;
namespace win {
BASE_EXPORT extern const char kApplicationVerifierDllName[];
inline uint32_t HandleToUint32(HANDLE h) {
// Cast through uintptr_t and then unsigned int to make the truncation to
// 32 bits explicit. Handles are size of-pointer but are always 32-bit values.
......
......@@ -8,7 +8,6 @@
#include <stddef.h>
#include "base/logging.h"
#include "base/win/win_util.h"
#include "sandbox/win/src/nt_internals.h"
#include "sandbox/win/src/win_utils.h"
......@@ -174,7 +173,7 @@ bool HandleCloserAgent::CloseHandles() {
// Skip closing these handles when Application Verifier is in use in order to
// avoid invalid-handle exceptions.
if (GetModuleHandleA(base::win::kApplicationVerifierDllName))
if (GetModuleHandleW(L"vrfcore.dll"))
return true;
// Set up buffers for the type info and the name.
......
......@@ -4,8 +4,6 @@
#include "sandbox/win/src/target_interceptions.h"
#include "base/strings/char_traits.h"
#include "base/win/win_util.h"
#include "sandbox/win/src/interception_agent.h"
#include "sandbox/win/src/sandbox_factory.h"
#include "sandbox/win/src/sandbox_nt_util.h"
......@@ -14,6 +12,7 @@ namespace sandbox {
SANDBOX_INTERCEPT NtExports g_nt;
const char VERIFIER_DLL_NAME[] = "verifier.dll";
const char KERNEL32_DLL_NAME[] = "kernel32.dll";
enum SectionLoadState {
......@@ -61,11 +60,8 @@ TargetNtMapViewOfSection(NtMapViewOfSectionFunction orig_MapViewOfSection,
// indicates Application Verifier is enabled and we should wait until
// the next module is loaded.
if (ansi_module_name &&
(g_nt._strnicmp(ansi_module_name,
base::win::kApplicationVerifierDllName,
base::CharTraits<char>::length(
base::win::kApplicationVerifierDllName) +
1) == 0))
(g_nt._strnicmp(ansi_module_name, VERIFIER_DLL_NAME,
sizeof(VERIFIER_DLL_NAME)) == 0))
break;
if (ansi_module_name &&
......
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