Skip to content

Commit

Permalink
Bug 1542830: Part 4 - Modify mozglue to use new untrusted modules int…
Browse files Browse the repository at this point in the history
…erfaces; r=mhowell

* At this point our DLL blocking infra is complicated enough that I decided to
  bite the bullet and move all of this code out of `mozglue/build` and into its
  own subdirectory, `mozglue/dllservices`.
* We delete the original `UntrustedDllsHandler` code which is now obsolete.
* We implement mozglue's `LoaderObserver`:
** When this observer registers itself with the launcher process API, it
   receives a vector containing all saved records of loaded DLLs that happened
   until that moment.
** This code handles profiler labels and stackwalking suppression.
** Once a load has completed, we either pass the load on to XUL for further
   processing, or save it for later if XUL is not initialized yet.
* mozglue has its own `ModuleLoadFrame` implementation for the legacy blocklist.
* `DllServicesBase` is updated to support the new interfaces.
* We implement `FallbackLoaderAPI` for `plugin-container`, `xpcshell`, and
  any other non-`firefox` processes that do not have a launcher process
  providing a loader API.
* We add some wide to UTF8 conversion functions.

Differential Revision: https://phabricator.services.mozilla.com/D43158

--HG--
rename : mozglue/build/Authenticode.cpp => mozglue/dllservices/Authenticode.cpp
rename : mozglue/build/Authenticode.h => mozglue/dllservices/Authenticode.h
rename : mozglue/build/WindowsDllBlocklist.cpp => mozglue/dllservices/WindowsDllBlocklist.cpp
rename : mozglue/build/WindowsDllBlocklist.h => mozglue/dllservices/WindowsDllBlocklist.h
rename : mozglue/build/WindowsDllBlocklistCommon.h => mozglue/dllservices/WindowsDllBlocklistCommon.h
rename : mozglue/build/WindowsDllBlocklistDefs.in => mozglue/dllservices/WindowsDllBlocklistDefs.in
rename : mozglue/build/WindowsDllServices.h => mozglue/dllservices/WindowsDllServices.h
rename : mozglue/build/gen_dll_blocklist_defs.py => mozglue/dllservices/gen_dll_blocklist_defs.py
rename : mozglue/build/moz.build => mozglue/dllservices/moz.build
rename : mozglue/build/MozglueUtils.h => mozglue/misc/WinUtils.h
extra : moz-landing-system : lando
  • Loading branch information
dblohm7 committed Sep 20, 2019
1 parent 1d681f2 commit 12843d8
Show file tree
Hide file tree
Showing 30 changed files with 696 additions and 692 deletions.
2 changes: 1 addition & 1 deletion browser/app/nsBrowserApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#ifdef XP_WIN
# include "LauncherProcessWin.h"
# include "mozilla/WindowsDllBlocklist.h"

# define XRE_WANT_ENVIRON
# define strcasecmp _stricmp
Expand All @@ -38,7 +39,6 @@

#include "mozilla/Sprintf.h"
#include "mozilla/StartupTimeline.h"
#include "mozilla/WindowsDllBlocklist.h"
#include "BaseProfiler.h"

#ifdef LIBFUZZER
Expand Down
4 changes: 3 additions & 1 deletion ipc/app/MozillaRuntimeMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include "../contentproc/plugin-container.cpp"

#include "mozilla/Bootstrap.h"
#include "mozilla/WindowsDllBlocklist.h"
#if defined(XP_WIN)
# include "mozilla/WindowsDllBlocklist.h"
#endif // defined(XP_WIN)

using namespace mozilla;

Expand Down
3 changes: 2 additions & 1 deletion ipc/mscom/mozglue/ProcessRuntimeShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "mozilla/mscom/ProcessRuntimeShared.h"
#include "MozglueUtils.h"

#include "mozilla/glue/WinUtils.h"

// We allow multiple ProcessRuntime instances to exist simultaneously (even
// on separate threads), but only one should be doing the process-wide
Expand Down
4 changes: 0 additions & 4 deletions ipc/mscom/mozglue/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ EXPORTS.mozilla.mscom += [
'ProcessRuntimeShared.h',
]

LOCAL_INCLUDES += [
'/mozglue/build',
]

UNIFIED_SOURCES += [
'ProcessRuntimeShared.cpp',
]
3 changes: 2 additions & 1 deletion js/xpconnect/shell/xpcshell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@

#include <stdio.h>

#include "mozilla/WindowsDllBlocklist.h"
#include "mozilla/Bootstrap.h"

#include "nsXULAppAPI.h"
#ifdef XP_MACOSX
# include "xpcshellMacUtils.h"
#endif
#ifdef XP_WIN
# include "mozilla/WindowsDllBlocklist.h"

# include <windows.h>
# include <shlobj.h>

Expand Down
310 changes: 0 additions & 310 deletions mozglue/build/UntrustedDllsHandler.cpp

This file was deleted.

Loading

0 comments on commit 12843d8

Please sign in to comment.