[tor-bugs] #13893 [Tor Browser]: Torbrowser 4.X.Y crashes on start when using MS EMET 5.x
Tor Bug Tracker & Wiki
blackhole at torproject.org
Mon Dec 28 17:53:08 UTC 2015
#13893: Torbrowser 4.X.Y crashes on start when using MS EMET 5.x
-------------------------------------------------+-------------------------
Reporter: Diapolo | Owner: gk
Type: defect | Status:
Priority: High | needs_review
Component: Tor Browser | Milestone:
Severity: Normal | Version:
Keywords: tbb-usability-stoppoint-app, | Resolution:
TorBrowserTeam201512, GeorgKoppen201512 | Actual Points:
Parent ID: | Points:
Sponsor: SponsorU |
-------------------------------------------------+-------------------------
Changes (by cypherpunks_backup):
* status: assigned => needs_review
Comment:
{{{
--- nsWindowsDllInterceptor.h.orig
+++ nsWindowsDllInterceptor.h
@@ -82,7 +82,7 @@
, mPatchedFnsLen(0)
{}
- ~WindowsDllNopSpacePatcher()
+ MOZ_NEVER_INLINE ~WindowsDllNopSpacePatcher()
{
// Restore the mov edi, edi to the beginning of each function we
patched.
@@ -119,7 +119,7 @@
}
#if defined(_M_IX86)
- bool AddHook(const char* aName, intptr_t aHookDest, void** aOrigFunc)
+ MOZ_NEVER_INLINE bool AddHook(const char* aName, intptr_t aHookDest,
void** aOrigFunc)
{
if (!mModule) {
return false;
@@ -161,7 +161,7 @@
return rv;
}
- bool WriteHook(byteptr_t aFn, intptr_t aHookDest, void** aOrigFunc)
+ MOZ_NEVER_INLINE bool WriteHook(byteptr_t aFn, intptr_t aHookDest,
void** aOrigFunc)
{
// Check that the 5 bytes before aFn are NOP's or INT 3's,
// and that the 2 bytes after aFn are mov(edi, edi).
@@ -234,7 +234,7 @@
{
}
- ~WindowsDllDetourPatcher()
+ MOZ_NEVER_INLINE ~WindowsDllDetourPatcher()
{
int i;
byteptr_t p;
@@ -270,7 +270,7 @@
}
}
- void Init(const char* aModuleName, int aNumHooks = 0)
+ MOZ_NEVER_INLINE void Init(const char* aModuleName, int aNumHooks = 0)
{
if (mModule) {
return;
@@ -301,7 +301,7 @@
bool Initialized() { return !!mModule; }
- void LockHooks()
+ MOZ_NEVER_INLINE void LockHooks()
{
if (!mModule) {
return;
@@ -314,7 +314,7 @@
mModule = 0;
}
- bool AddHook(const char* aName, intptr_t aHookDest, void** aOrigFunc)
+ MOZ_NEVER_INLINE bool AddHook(const char* aName, intptr_t aHookDest,
void** aOrigFunc)
{
if (!mModule) {
return false;
@@ -346,7 +346,7 @@
int mMaxHooks;
int mCurHooks;
- void CreateTrampoline(void* aOrigFunction, intptr_t aDest, void**
aOutTramp)
+ MOZ_NEVER_INLINE void CreateTrampoline(void* aOrigFunction, intptr_t
aDest, void** aOutTramp)
{
*aOutTramp = nullptr;
@@ -727,7 +727,7 @@
}
}
- bool AddHook(const char* aName, intptr_t aHookDest, void** aOrigFunc)
+ MOZ_NEVER_INLINE bool AddHook(const char* aName, intptr_t aHookDest,
void** aOrigFunc)
{
// Use a nop space patch if possible, otherwise fall back to a
detour.
// This should be the preferred method for adding hooks.
@@ -743,7 +743,7 @@
return AddDetour(aName, aHookDest, aOrigFunc);
}
- bool AddDetour(const char* aName, intptr_t aHookDest, void** aOrigFunc)
+ MOZ_NEVER_INLINE bool AddDetour(const char* aName, intptr_t aHookDest,
void** aOrigFunc)
{
// Generally, code should not call this method directly. Use AddHook
unless
// there is a specific need to avoid nop space patches.
}}}
This fix prevents GCC to inline methods and destructors, to keep code
small enough to never do jumps too far.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/13893#comment:20>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list