Backed out changeset 67acd8531789 (bug 1665486) for causing hazard bustages in FunctionBroker.h

CLOSED TREE
This commit is contained in:
Mihai Alexandru Michis 2020-09-24 17:59:25 +03:00
Родитель 51ef39e1d8
Коммит fc508522d9
2 изменённых файлов: 8 добавлений и 18 удалений

Просмотреть файл

@ -275,7 +275,7 @@ static void GrantFileAccess(base::ProcessId aClientId, LPOPENFILENAME& aLpofn,
template <>
template <>
BROKER_DISABLE_CFGUARD BOOL GetSaveFileNameWFB::RunFunction(
BOOL GetSaveFileNameWFB::RunFunction(
GetSaveFileNameWFB::FunctionType* aOrigFunction, base::ProcessId aClientId,
LPOPENFILENAMEW& aLpofn) const {
BOOL result = aOrigFunction(aLpofn);
@ -299,7 +299,7 @@ typedef FileDlgFunctionBroker<ID_GetOpenFileNameW, decltype(GetOpenFileNameW)>
template <>
template <>
BROKER_DISABLE_CFGUARD BOOL GetOpenFileNameWFB::RunFunction(
BOOL GetOpenFileNameWFB::RunFunction(
GetOpenFileNameWFB::FunctionType* aOrigFunction, base::ProcessId aClientId,
LPOPENFILENAMEW& aLpofn) const {
BOOL result = aOrigFunction(aLpofn);
@ -1332,9 +1332,10 @@ struct CMWReqInfo::ShouldMarshal<2> {
template <>
template <>
BROKER_DISABLE_CFGUARD HANDLE CreateMutexWFB::RunFunction(
CreateMutexWFB::FunctionType* aOrigFunction, base::ProcessId aClientId,
LPSECURITY_ATTRIBUTES& aAttribs, BOOL& aOwner, LPCWSTR& aName) const {
HANDLE CreateMutexWFB::RunFunction(CreateMutexWFB::FunctionType* aOrigFunction,
base::ProcessId aClientId,
LPSECURITY_ATTRIBUTES& aAttribs,
BOOL& aOwner, LPCWSTR& aName) const {
// Use CreateMutexW to get the camera mutex and DuplicateHandle to open it
// for use in the child process.
// Recall that aAttribs, aOwner and aName are all unmarshaled so they are

Просмотреть файл

@ -153,16 +153,6 @@
*
*/
#if defined(XP_WIN) && defined(__clang__) && __has_declspec_attribute(guard)
// Workaround for https://bugs.llvm.org/show_bug.cgi?id=47617
// Some of the brokered function thunks don't get properly marked as call
// targets, so we have to disable CFG when returning to the original function.
// Unlike `INTERCEPTOR_DISABLE_CFGUARD`, this happens in 64-bit builds too.
# define BROKER_DISABLE_CFGUARD __declspec(guard(nocf))
#else
# define BROKER_DISABLE_CFGUARD /* nothing */
#endif
namespace mozilla {
namespace plugins {
@ -1246,8 +1236,7 @@ class FunctionBroker<functionId, ResultType HOOK_CALL(ParamTypes...),
};
template <typename... VarParams>
BROKER_DISABLE_CFGUARD ResultType RunFunction(FunctionType* aFunction,
base::ProcessId aClientId,
ResultType RunFunction(FunctionType* aFunction, base::ProcessId aClientId,
VarParams&... aParams) const {
return aFunction(aParams...);
};