Commit 034e4d21 authored by Will Harris's avatar Will Harris Committed by Commit Bot

Remove legacy/disabled CFI sbox unittests.

The patching of user32!GetSystemMetrics no longer works on
latest builds of Windows. The test is also disabled.

There are tests for presence of the CFI flags in checkbins.py
and a test for CFG within chromium binaries in base_unittests
so no need for this additional test.

BUG=584575

Change-Id: I0985d888ff371f826906639d3ca6faece50cb617
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2308409Reviewed-by: default avatarAlex Gough <ajgo@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790100}
parent cce9bab2
...@@ -217,7 +217,6 @@ test("sbox_integration_tests") { ...@@ -217,7 +217,6 @@ test("sbox_integration_tests") {
"tests/common/controller.h", "tests/common/controller.h",
"tests/common/test_utils.cc", "tests/common/test_utils.cc",
"tests/common/test_utils.h", "tests/common/test_utils.h",
"tests/integration_tests/cfi_unittest.cc",
"tests/integration_tests/integration_tests.cc", "tests/integration_tests/integration_tests.cc",
"tests/integration_tests/integration_tests_common.h", "tests/integration_tests/integration_tests_common.h",
"tests/integration_tests/integration_tests_test.cc", "tests/integration_tests/integration_tests_test.cc",
...@@ -231,7 +230,6 @@ test("sbox_integration_tests") { ...@@ -231,7 +230,6 @@ test("sbox_integration_tests") {
] ]
data_deps = [ data_deps = [
":cfi_unittest_exe",
":sbox_integration_test_hijack_dll", ":sbox_integration_test_hijack_dll",
":sbox_integration_test_hijack_shim_dll", ":sbox_integration_test_hijack_shim_dll",
":sbox_integration_test_hooking_dll", ":sbox_integration_test_hooking_dll",
...@@ -241,14 +239,6 @@ test("sbox_integration_tests") { ...@@ -241,14 +239,6 @@ test("sbox_integration_tests") {
libs = [ "dxva2.lib" ] libs = [ "dxva2.lib" ]
} }
executable("cfi_unittest_exe") {
sources = [ "tests/integration_tests/cfi_unittest_exe.cc" ]
deps = [
"//base",
"//build/win:default_exe_manifest",
]
}
shared_library("sbox_integration_test_hijack_dll") { shared_library("sbox_integration_test_hijack_dll") {
sources = [ sources = [
"tests/integration_tests/hijack_dll.cc", "tests/integration_tests/hijack_dll.cc",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <windows.h>
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/process/launch.h"
#include "base/test/test_timeouts.h"
#include "base/win/windows_version.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace sandbox {
// ASLR must be enabled for CFG to be enabled. As ASLR is disabled in debug
// builds, so must be CFG.
#if defined(NDEBUG)
// Make sure Microsoft binaries, that are compiled with CFG enabled, catch
// a hook and throw an exception.
// - If this test fails, the expected CFG exception did NOT happen. This
// indicates a build system change that has disabled Chrome process-wide CFG.
TEST(CFGSupportTests, DISABLED_MsIndirectFailure) {
// CFG is only supported on >= Win8.1 Update 3.
// Not checking for update, since test infra is updated and it would add
// a lot of complexity.
if (base::win::GetVersion() < base::win::Version::WIN8_1)
return;
const wchar_t* exe_filename = L"cfi_unittest_exe.exe";
const wchar_t* sys_dll_test = L"1";
base::CommandLine cmd_line = base::CommandLine::FromString(exe_filename);
cmd_line.AppendArgNative(sys_dll_test);
base::Process proc =
base::LaunchProcess(cmd_line, base::LaunchOptionsForTest());
ASSERT_TRUE(proc.IsValid());
int exit_code = 0;
if (!proc.WaitForExitWithTimeout(TestTimeouts::action_timeout(),
&exit_code)) {
// Timeout while waiting. Try to cleanup.
proc.Terminate(1, false);
ADD_FAILURE();
return;
}
// CFG security check failure.
ASSERT_EQ(STATUS_STACK_BUFFER_OVERRUN, static_cast<DWORD>(exit_code));
}
#endif // defined(NDEBUG)
} // namespace sandbox
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