gecko-dev/mozglue/misc/WindowsProcessMitigations.h
Yannis Juglaret 51e2ded885 Bug 1803334 - Skip execution of MovPushRet and PushRet in TestDllInterceptor if Intel CET is active. r=handyman
Bug 1596930 added support for detouring a pattern of code used by eScan
Internet Security Suite. The patch also added tests to make sure
that we correctly detour this pattern.

The pattern involves a PUSH instruction followed by a RET instruction.
This pattern is forbidden by Intel CET, which enforces at RET time that
we always return to an address that was pushed on the stack by a
prior CALL instruction. Executing the pattern thus crashes if Intel CET
is active.

If CET is active, we must thus skip the execution part of the test, or
the test crashes. We will still check that our detouring code
recognized the pattern and detoured it, but we will not run the detoured
pattern anymore under active Intel CET.

Differential Revision: https://phabricator.services.mozilla.com/D163468
2023-09-12 08:27:19 +00:00

23 lines
734 B
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_WindowsProcessMitigations_h
#define mozilla_WindowsProcessMitigations_h
#include "mozilla/Types.h"
namespace mozilla {
MFBT_API bool IsWin32kLockedDown();
MFBT_API void SetWin32kLockedDownInPolicy();
MFBT_API bool IsDynamicCodeDisabled();
MFBT_API bool IsEafPlusEnabled();
MFBT_API bool IsUserShadowStackEnabled();
} // namespace mozilla
#endif // mozilla_WindowsProcessMitigations_h