Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 8d1be66

Browse files
committed
Bug 1542830: Part 4 - Modify mozglue to use new untrusted modules interfaces; 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
1 parent 4f7aaf1 commit 8d1be66

30 files changed

Lines changed: 698 additions & 692 deletions

browser/app/nsBrowserApp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#ifdef XP_WIN
2727
# include "LauncherProcessWin.h"
28+
# include "mozilla/WindowsDllBlocklist.h"
2829

2930
# define XRE_WANT_ENVIRON
3031
# define strcasecmp _stricmp
@@ -38,7 +39,6 @@
3839

3940
#include "mozilla/Sprintf.h"
4041
#include "mozilla/StartupTimeline.h"
41-
#include "mozilla/WindowsDllBlocklist.h"
4242
#include "BaseProfiler.h"
4343

4444
#ifdef LIBFUZZER

ipc/app/MozillaRuntimeMain.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#include "../contentproc/plugin-container.cpp"
88

99
#include "mozilla/Bootstrap.h"
10-
#include "mozilla/WindowsDllBlocklist.h"
10+
#if defined(XP_WIN)
11+
# include "mozilla/WindowsDllBlocklist.h"
12+
#endif // defined(XP_WIN)
1113

1214
using namespace mozilla;
1315

ipc/mscom/mozglue/ProcessRuntimeShared.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
66

77
#include "mozilla/mscom/ProcessRuntimeShared.h"
8-
#include "MozglueUtils.h"
8+
9+
#include "mozilla/glue/WinUtils.h"
910

1011
// We allow multiple ProcessRuntime instances to exist simultaneously (even
1112
// on separate threads), but only one should be doing the process-wide

ipc/mscom/mozglue/moz.build

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ EXPORTS.mozilla.mscom += [
1010
'ProcessRuntimeShared.h',
1111
]
1212

13-
LOCAL_INCLUDES += [
14-
'/mozglue/build',
15-
]
16-
1713
UNIFIED_SOURCES += [
1814
'ProcessRuntimeShared.cpp',
1915
]

js/xpconnect/shell/xpcshell.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88

99
#include <stdio.h>
1010

11-
#include "mozilla/WindowsDllBlocklist.h"
1211
#include "mozilla/Bootstrap.h"
1312

1413
#include "nsXULAppAPI.h"
1514
#ifdef XP_MACOSX
1615
# include "xpcshellMacUtils.h"
1716
#endif
1817
#ifdef XP_WIN
18+
# include "mozilla/WindowsDllBlocklist.h"
19+
1920
# include <windows.h>
2021
# include <shlobj.h>
2122

mozglue/build/UntrustedDllsHandler.cpp

Lines changed: 0 additions & 310 deletions
This file was deleted.

0 commit comments

Comments
 (0)