Commit graph

109 commits

Author SHA1 Message Date
serge-sans-paille
45901a24b9 Bug 1828382 - Make browser/app/winlauncher/freestanding buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D175595
2023-04-18 13:43:19 +00:00
Greg Stoll
2b461b0360 Bug 1744362 - Part 7: support code for about:third-party r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D164489
2022-12-30 20:10:04 +00:00
Greg Stoll
ae13a56ab0 Bug 1744362 - Part 6: use dynamic blocklist file to block third-party DLLs r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D164488
2022-12-30 20:10:04 +00:00
Butkovits Atila
5e31c1c2cf Backed out 12 changesets (bug 1744362) for causing build bustages.
Backed out changeset 3f63f21115e2 (bug 1744362)
Backed out changeset 0df403e8f6ba (bug 1744362)
Backed out changeset 34f51e6aee96 (bug 1744362)
Backed out changeset 39ff51df4a45 (bug 1744362)
Backed out changeset da9133df4cd4 (bug 1744362)
Backed out changeset 315c57948afa (bug 1744362)
Backed out changeset a2d8f526e0ff (bug 1744362)
Backed out changeset 401ebbc0159d (bug 1744362)
Backed out changeset 2911fe484cc3 (bug 1744362)
Backed out changeset d1f4b99f352b (bug 1744362)
Backed out changeset 0a3ce8ea039e (bug 1744362)
Backed out changeset ab1292118c00 (bug 1744362)
2022-12-27 22:54:30 +02:00
Greg Stoll
78bf088bb7 Bug 1744362 - Part 7: support code for about:third-party r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D164489
2022-12-27 20:06:41 +00:00
Greg Stoll
acc64a126e Bug 1744362 - Part 6: use dynamic blocklist file to block third-party DLLs r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D164488
2022-12-27 20:06:41 +00:00
Stanca Serban
822be63b67 Backed out 11 changesets (bug 1744362) for causing multiple failures and build bustages. CLOSED TREE
Backed out changeset 4b2e3689cea0 (bug 1744362)
Backed out changeset cf1db931c466 (bug 1744362)
Backed out changeset 8c87571dbb3e (bug 1744362)
Backed out changeset 8b50446f91e5 (bug 1744362)
Backed out changeset 848632184f56 (bug 1744362)
Backed out changeset acfdb2bcaa9f (bug 1744362)
Backed out changeset 80b67f7ea109 (bug 1744362)
Backed out changeset c88902b60d1f (bug 1744362)
Backed out changeset 438f74bb5b7c (bug 1744362)
Backed out changeset 704a4150d210 (bug 1744362)
Backed out changeset 1dd7e7c111da (bug 1744362)
2022-12-27 16:25:04 +02:00
Greg Stoll
934ea325f6 Bug 1744362 - Part 7: support code for about:third-party r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D164489
2022-12-27 12:59:09 +00:00
Greg Stoll
8578b985f6 Bug 1744362 - Part 6: use dynamic blocklist file to block third-party DLLs r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D164488
2022-12-27 12:59:09 +00:00
Bob Owen
692f8a5532 Bug 1689136: Apply MITIGATION_HARDEN_TOKEN_IL_POLICY to main and launcher processes. r=handyman
This also ensures that DEP without ATL thunk is enforced.

Differential Revision: https://phabricator.services.mozilla.com/D156069
2022-09-07 09:42:04 +00:00
Ray Kraesig
bc46f84efa Bug 1733821 - [9/9] Drive-by cleanup: add nullptr_t overload for CheckArg r=nika
Since `CheckArg`'s `aParam` is declared as `const CharT **`, it's
treated as a deduction parameter. Unfortunately, `nullptr` is of type
`nullptr_t`, and it doesn't get coerced before template argument
deduction takes place. To allow passing `nullptr`, people have been
using unwieldy constructs like `static_cast<const wchar_t**>(nullptr)`
when `aParam` isn't needed.

Centralize this by adding an overload of `CheckArg` that explicitly
takes `nullptr_t` and forwards it on to the primary implementation.
Strip out all the now-unnecessary `static_cast`s everywhere else.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D152327
2022-08-02 21:02:06 +00:00
Ray Kraesig
8ae15d70b0 Bug 1733821 - [8.5/9] Drive-by fix: set size-of field for Win32 API struct r=mhowell
Set the size-field of the struct before passing it to Windows, as one
customarily does.

(Given that STARTUPINFOEXW exists, it's not likely that this will ever
actually cause issues. But let's not rely on that.)

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D152544
2022-08-02 21:02:05 +00:00
Ray Kraesig
58c9b5ed09 Bug 1733821 - [8/9] Write deelevation-status enum into the launched parent process r=mhowell
Write the deelevation-status enum value into the parent process, where
it will (hopefully) show up in the event of a crash report.

(Presenting this value more conveniently -- _e.g._, in `about:support`
and/or Firefox telemetry -- would require additional plumbing, and so
has been left to future work as bug 1774703.)

This commit was previously submitted as D149546, and has not changed.

Differential Revision: https://phabricator.services.mozilla.com/D152326
2022-08-02 21:02:05 +00:00
Ray Kraesig
97ced28b8d Bug 1733821 - [7/9] Add deelevation flag; compute deelevation-attempt status r=mhowell,nalexander
Add a new command-line flag `--attempting-deelevation` which prevents
the launcher from entering an infinite loop of deelevation attempts.

Additionally, produce an enum value indicating the decisions made by the
launcher process. (Nothing is done with this value yet; that will happen
in the following commit.)

A commit loosely analogous to this was previously submitted as D149545.

Differential Revision: https://phabricator.services.mozilla.com/D152325
2022-08-02 21:02:04 +00:00
Ray Kraesig
aae42034c9 Bug 1733821 - [3.5/9] Unify Firefox arguments to EnsureCommandlineSafe r=mhowell,nalexander
Eliminate the need to keep Firefox's required-argument set in sync
across files by defining it only in a new header file.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D152543
2022-08-02 21:02:03 +00:00
Ray Kraesig
590e9c4f38 Bug 1733821 - [3/9] Heavily specialize strimatch() r=mhowell,Gijs
`strimatch` attempts to perform a generic case-insensitive match.
However, it doesn't handle edge cases very well -- and, for deep Unicode
reasons, it can't reasonably do so without being far more complicated.

However, we also don't need it to. The `lowerstr` input of `strimatch`
is only ever a constant string naming a command-line option. These are
(and probably always should be) strictly composed of lowercase ASCII,
numerals, and hyphens. _That_ character set is one that a simple
function can properly handle.

Restricting `lowerstr` to be `const char *`, regardless of `CharT`, also
obviates the macro-machinery of `GetLiteral` and `DECLARE_FLAG_LITERAL`.
Strip it all out.

Additionally and relatedly:
  * Add tests confirming that `strimatch` only matches things that it
    should be testing against at all.
  * Add a minor fix for a test which was discovered to crash rather than
    report failure.

----

Although this commit involves significant internal functional changes,
most users will see no differences. (Some users operating in Turkish or
Azerbaijani locales may notice that "-PRİVATE-WINDOW" is no longer a
recognized command-line option.)

Differential Revision: https://phabricator.services.mozilla.com/D152321
2022-08-02 21:02:02 +00:00
Ben Hearsum
85fad4f836 Bug 1733821: revert patches for causing bugs 1778267 and 1778252. r=rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D151167
2022-07-06 20:08:13 +00:00
Ray Kraesig
32dc43ec90 Bug 1733821 - [3/3] Write deelevation-status enum into the launched parent process r=mhowell
Write the deelevation-status enum value into the parent process, where
it will (hopefully) show up in the event of a crash report.

(Presenting this value more conveniently -- _e.g._, in `about:support`
and/or Firefox telemetry -- would require additional plumbing, and so
has been left to future work.)

Depends on D149545

Differential Revision: https://phabricator.services.mozilla.com/D149546
2022-06-17 00:09:51 +00:00
Ray Kraesig
daaf1ca50e Bug 1733821 - [2/3] Add deelevation flag; compute deelevation-attempt status r=mhowell
Add a new command-line flag `--attempting-deelevation` which prevents
the launcher from entering an infinite loop of deelevation attempts.

Additionally, produce an enum value indicating the decisions made by the
launcher process. (Nothing is done with this value yet; that will happen
in the following commit.)

Depends on D149544

Differential Revision: https://phabricator.services.mozilla.com/D149545
2022-06-17 00:09:50 +00:00
Ben Hearsum
21d677e73d Bug 1751002: Update command line parsing code to allow -private-window to be accepted with -osint launches. r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D137672
2022-02-02 21:21:37 +00:00
Toshihito Kikuchi
f5551c4395 Bug 1743489 - Content process makes early return from LauncherMain before any registry access. r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D132407
2021-11-29 22:04:19 +00:00
Toshihito Kikuchi
68dd038b3b Bug 1740619 - Include the launcher process in a Job object when "--wait-for-browser" is set. r=mhowell
When the launcher process is enabled, Puppeteer, or any other automation tools, cannot
have control of the lifetime of the browser process even though the `--wait-for-browser`
option is used.

This patch is to include the launcher process and the browser process to a job to enable
a launcher of the launcher process like Puppeteer to terminate the application by terminating
the launcher process if `--wait-for-browser` is set.

Differential Revision: https://phabricator.services.mozilla.com/D131170
2021-11-17 03:52:30 +00:00
Toshihito Kikuchi
7e19cd245f Bug 1740805 - Treat --remote-debugging-port as implicit --wait-for-browser. r=mhowell
Depends on D131170

Differential Revision: https://phabricator.services.mozilla.com/D131171
2021-11-16 19:03:55 +00:00
Marian-Vasile Laza
cc12927f82 Backed out 2 changesets (bug 1740619, bug 1740805) for causing multiple test failures. CLOSED TREE
Backed out changeset be8956524114 (bug 1740805)
Backed out changeset b5ae0c3e9c56 (bug 1740619)
2021-11-16 05:38:10 +02:00
Toshihito Kikuchi
d2034f189f Bug 1740805 - Treat --remote-debugging-port as implicit --wait-for-browser. r=mhowell
Depends on D131170

Differential Revision: https://phabricator.services.mozilla.com/D131171
2021-11-16 01:37:02 +00:00
Toshihito Kikuchi
30151da990 Bug 1740619 - Include the launcher process in a Job object when "--wait-for-browser" is set. r=mhowell
When the launcher process is enabled, Puppeteer, or any other automation tools, cannot
have control of the lifetime of the browser process even though the `--wait-for-browser`
option is used.

This patch is to include the launcher process and the browser process to a job to enable
a launcher of the launcher process like Puppeteer to terminate the application by terminating
the launcher process if `--wait-for-browser` is set.

Differential Revision: https://phabricator.services.mozilla.com/D131170
2021-11-16 01:37:02 +00:00
Andi-Bogdan Postelnicu
eab549fd19 Bug 1519636 - Initial reformat of C/C++ code with clang-format version 12.0.0. r=sylvestre
clang-format version 12.0.0 (taskcluster-KEgO7qdgQ8uaewA6NkRnRA)

Differential Revision: https://phabricator.services.mozilla.com/D114211
2021-05-10 07:15:07 +00:00
Adam Gashlin
37c29fd026 Bug 1685213 - Part 1: Save and access the startup shortcut. r=bytesized
A. The shell provides the startup shortcut in STARTUPINFOW when it
starts a process. If the launcher process runs, we must pass this along
to the real process being created.

B. lpTitle can be overwritten, in particular when the AUMID is set for
WinTaskbar, so save it in XREMain::XRE_mainStartup() in order to access
it later.

C. Add an accessor for the saved shortcut.

Differential Revision: https://phabricator.services.mozilla.com/D106343
2021-02-25 23:15:46 +00:00
Nick Alexander
fa959daec6 Bug 1689481 - Launcher process: Treat --backgroundtask mode as implicit --wait-for-browser. r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D103404
2021-01-29 00:04:49 +00:00
Toshihito Kikuchi
739b831899 Bug 1630444: Part1 - Put LauncherError behind MOZ_USE_LAUNCHER_ERROR. r=aklotz
This patch defines a new macro `MOZ_USE_LAUNCHER_ERROR` and keeps
the use of `LauncherError` behind `MOZ_USE_LAUNCHER_ERROR` instead of
`MOZILLA_INTERNAL_API` so that we can selectively use `LauncherError`
in locations where `MOZILLA_INTERNAL_API` is defined.

Differential Revision: https://phabricator.services.mozilla.com/D83638
2020-08-26 19:01:44 +00:00
Toshihito Kikuchi
dcef2560fb Bug 1642577 - De-elevate the process with CreateProcessAsUser if the compat flag RUNASADMIN is set. r=aklotz
If the process was elevated due to AppCompatFlags, we should not
use LaunchUnelevated to launch the browser process because it starts
an infinite loop of process launch.

The fix is to make GetElevationState return a new elevation state
if RUNASADMIN is set in AppCompatFlags.  With that state, we use
CreateProcessAsUser to launch the browser process.

Differential Revision: https://phabricator.services.mozilla.com/D80114
2020-06-22 18:37:49 +00:00
Toshihito Kikuchi
0d056e0130 Bug 1614885 - Do not attempt to bootstrap a child process if the launcher failed to boostrap the browser process. r=aklotz
Bug 1522830 added the call to `InitializeDllBlocklistOOP` in `SandboxBroker::LaunchApp`
to enable the new dll blocklist and telemetry in sandbox processes.  If the browser
process fails to bootstrap a process for some reason, firefox starts without any crash
nor any content processes because of that change.

What is worse is that this problem persists even after the launcher process was disabled.
To mitigate it, this patch stops an attempt to bootstrap a child process if the launcher
process already failed to do it.  With this, if something bad happens in the first launch,
the launcher process is automatically disabled via registry and next time firefox will work
normally.  So a user will see the launching problem only once.

We will follow up the bootstrap issue.

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

--HG--
extra : moz-landing-system : lando
2020-02-13 05:49:03 +00:00
Aaron Klotz
ff5730d1a7 Bug 1602383: Make InitializeDllBlocklistOOP a no-op on aarch64; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D56380

--HG--
extra : moz-landing-system : lando
2019-12-09 15:50:03 +00:00
Aaron Klotz
5db063f48a Bug 1522830: Part 12 - ASAN fix for DllBlocklistInit in launcher process; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D53685

--HG--
extra : moz-landing-system : lando
2019-12-06 22:14:07 +00:00
shindli
83be0128f4 Backed out 13 changesets (bug 1522830) for causing xpc shell failures in test_ThirdPartyModulesPing.js CLOSED TREE
Backed out changeset a3e44bbc9ce3 (bug 1522830)
Backed out changeset 11078767a246 (bug 1522830)
Backed out changeset c7ee156830cf (bug 1522830)
Backed out changeset 810f0cb2308d (bug 1522830)
Backed out changeset f8ab75219387 (bug 1522830)
Backed out changeset ec293f9a5e32 (bug 1522830)
Backed out changeset 4bfc013c3d79 (bug 1522830)
Backed out changeset f4ae67f2f231 (bug 1522830)
Backed out changeset 2737350b7d40 (bug 1522830)
Backed out changeset 52931597c652 (bug 1522830)
Backed out changeset bc8985a34539 (bug 1522830)
Backed out changeset 09cbbbc5c802 (bug 1522830)
Backed out changeset d5e366ea4657 (bug 1522830)
2019-12-06 02:07:16 +02:00
Aaron Klotz
8bc4f093b0 Bug 1522830: Part 12 - ASAN fix for DllBlocklistInit in launcher process; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D53685

--HG--
extra : moz-landing-system : lando
2019-12-05 22:00:50 +00:00
Toshihito Kikuchi
ee1f6d7a78 Bug 1529593 - Make LauncherRegistryInfo delay write to the registry. r=aklotz
We have the `LauncherRegistryInfo` class to check the launcher process was
launched successfully on Windows by comparing the timestamps in the registry
when each process was launched.

The problem was when the process is launched from an elevated process, we
relaunch a new launcher process via shell after we updated the launcher's
timestamp.  As a result, `LauncherRegistryInfo` unexpectedly disabled the
launcher process even though there was nothing wrong.

A proposed fix is to introduce delay-write to the `LauncherRegistryInfo`.  With
this, `LauncherRegistryInfo::Check` modifies only the image timestamp. To update
the launcher/browser timestamps, we need to call `LauncherRegistryInfo::Commit`.
When we ask shell to relaunch a new process, we hold back commit, delegating it
to the new process.

There is another consideration needed.  If something fails during `LauncherMain`,
we call `DisableDueToFailure()` to disable the launcher until the image timestamp
is changed.  In such a case, we should not change the stored timestamps even
though commit is attempted.  The problem is we use a different instance to call
`DisableDueToFailure()` in `HandleLauncherError`.  To deal with this design,
`LauncherRegistryInfo` has a static boolean to indicate disablement happens or not.

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

--HG--
extra : moz-landing-system : lando
2019-10-14 17:14:54 +00:00
Aaron Klotz
5690759b5c Bug 1542830: Part 2 - Modify launcher process blocklist to collect information about untrusted module loads; r=mhowell
* We refactor the blocklist code. Code that may possibly run before
  initialization of the Win32 subsystem and the CRT is contained within the
  `freestanding` library.
* The `freestanding` library's static initializers are placed in their own
  section so that they may be manually invoked separately from the remaining
  initializers in the binary.
* `CheckBlockInfo` and `IsDllAllowed` are modified to return a `BlockAction`
  enum instead of a `bool`. This will be used more extensively in the future for
  LSP blocking.
* The launcher process now hooks `LdrLoadDll` in addition to
  `NtMapViewOfSection`. This is necessary so that we can collect timing
  information.
* Telemetry recorders must implement the `LoaderObserver` interface.
* `ModuleLoadFrame` is a RAII class that collects the information about the
  DLL load and dispatches the information to `LoaderObserver`s.
* The launcher process exposes an implementation of the `LoaderAPI` interface
  that may be called by either the launcher process blocklist or the legacy
  blocklist in `mozglue`.
* During startup, the launcher process implements its own `LoaderObserver`.
  Once mozglue is running, it connects its `LoaderObserver` to the launcher
  process, receives a vector containing the module load events, and then
  stores and forwards them into XUL.

Depends on D43155

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

--HG--
rename : browser/app/winlauncher/DllBlocklistWin.cpp => browser/app/winlauncher/DllBlocklistInit.cpp
rename : browser/app/winlauncher/DllBlocklistWin.h => browser/app/winlauncher/DllBlocklistInit.h
rename : browser/app/winlauncher/DllBlocklistWin.cpp => browser/app/winlauncher/freestanding/DllBlocklist.cpp
rename : browser/app/winlauncher/DllBlocklistWin.h => browser/app/winlauncher/freestanding/DllBlocklist.h
rename : browser/app/winlauncher/moz.build => browser/app/winlauncher/freestanding/moz.build
extra : moz-landing-system : lando
2019-09-23 20:17:10 +00:00
Toshihito Kikuchi
1cc025cecd Bug 1578895 - Compare NT paths if NtOpenFile failed with STATUS_OBJECT_PATH_NOT_FOUND. r=aklotz
We compare two file ids to check the current process is launched from the same
executable.  However, our telemetry showed a number of Win7 users failed to open
a file handle of the parent process with STATUS_OBJECT_PATH_NOT_FOUND even
though we opened a process handle and retrieved a module path of the parent
process successfully.  We don't have data to explain how this happens or why
this happens only on Win7, Win10 10240, and 10586.

To mitigate this situation, this patch introduces a logic to compare NT path
strings.  The benefit from doing this is 1) we don't have to open a file handle
of a parent process executable and 2) when we get an NT path, a network drive
or a symbolic link is already solved.

This new logic is much faster, but we still compare file ids on the first
attempt to minimize the impact.  We fall back to the new logic only if we
detect the STATUS_OBJECT_PATH_NOT_FOUND failure.

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

--HG--
extra : moz-landing-system : lando
2019-09-23 17:59:42 +00:00
Brindusan Cristian
125c934a04 Backed out 8 changesets (bug 1542830) for causing Nightly bustages. a=backout
Backed out changeset 6fcb417f7ff4 (bug 1542830)
Backed out changeset 1aa253e6604a (bug 1542830)
Backed out changeset 73ec288886cd (bug 1542830)
Backed out changeset 84b903e60dc9 (bug 1542830)
Backed out changeset 8e2da9ff5f5a (bug 1542830)
Backed out changeset c4e547a6a039 (bug 1542830)
Backed out changeset 919f1af7c135 (bug 1542830)
Backed out changeset da7e775c4051 (bug 1542830)

--HG--
rename : browser/app/winlauncher/freestanding/DllBlocklist.cpp => browser/app/winlauncher/DllBlocklistWin.cpp
rename : browser/app/winlauncher/freestanding/DllBlocklist.h => browser/app/winlauncher/DllBlocklistWin.h
rename : mozglue/dllservices/Authenticode.cpp => mozglue/build/Authenticode.cpp
rename : mozglue/dllservices/Authenticode.h => mozglue/build/Authenticode.h
rename : mozglue/misc/WinUtils.h => mozglue/build/MozglueUtils.h
rename : mozglue/dllservices/WindowsDllBlocklist.cpp => mozglue/build/WindowsDllBlocklist.cpp
rename : mozglue/dllservices/WindowsDllBlocklist.h => mozglue/build/WindowsDllBlocklist.h
rename : mozglue/dllservices/WindowsDllBlocklistCommon.h => mozglue/build/WindowsDllBlocklistCommon.h
rename : mozglue/dllservices/WindowsDllBlocklistDefs.in => mozglue/build/WindowsDllBlocklistDefs.in
rename : mozglue/dllservices/WindowsDllServices.h => mozglue/build/WindowsDllServices.h
rename : mozglue/dllservices/gen_dll_blocklist_defs.py => mozglue/build/gen_dll_blocklist_defs.py
rename : toolkit/components/telemetry/docs/data/third-party-modules-ping.rst => toolkit/components/telemetry/docs/data/untrusted-modules-ping.rst
rename : toolkit/components/telemetry/tests/unit/test_ThirdPartyModulesPing.js => toolkit/components/telemetry/tests/unit/test_UntrustedModulesPing.js
rename : toolkit/xre/UntrustedModulesProcessor.cpp => toolkit/xre/ModuleEvaluator_windows.cpp
rename : toolkit/xre/UntrustedModulesProcessor.h => toolkit/xre/ModuleEvaluator_windows.h
rename : toolkit/xre/ModuleVersionInfo.cpp => toolkit/xre/ModuleVersionInfo_windows.cpp
rename : toolkit/xre/ModuleVersionInfo.h => toolkit/xre/ModuleVersionInfo_windows.h
2019-09-22 00:01:01 +03:00
Aaron Klotz
dc2d20955f Bug 1542830: Part 2 - Modify launcher process blocklist to collect information about untrusted module loads; r=mhowell
* We refactor the blocklist code. Code that may possibly run before
  initialization of the Win32 subsystem and the CRT is contained within the
  `freestanding` library.
* The `freestanding` library's static initializers are placed in their own
  section so that they may be manually invoked separately from the remaining
  initializers in the binary.
* `CheckBlockInfo` and `IsDllAllowed` are modified to return a `BlockAction`
  enum instead of a `bool`. This will be used more extensively in the future for
  LSP blocking.
* The launcher process now hooks `LdrLoadDll` in addition to
  `NtMapViewOfSection`. This is necessary so that we can collect timing
  information.
* Telemetry recorders must implement the `LoaderObserver` interface.
* `ModuleLoadFrame` is a RAII class that collects the information about the
  DLL load and dispatches the information to `LoaderObserver`s.
* The launcher process exposes an implementation of the `LoaderAPI` interface
  that may be called by either the launcher process blocklist or the legacy
  blocklist in `mozglue`.
* During startup, the launcher process implements its own `LoaderObserver`.
  Once mozglue is running, it connects its `LoaderObserver` to the launcher
  process, receives a vector containing the module load events, and then
  stores and forwards them into XUL.

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

--HG--
rename : browser/app/winlauncher/DllBlocklistWin.cpp => browser/app/winlauncher/DllBlocklistInit.cpp
rename : browser/app/winlauncher/DllBlocklistWin.h => browser/app/winlauncher/DllBlocklistInit.h
rename : browser/app/winlauncher/DllBlocklistWin.cpp => browser/app/winlauncher/freestanding/DllBlocklist.cpp
rename : browser/app/winlauncher/DllBlocklistWin.h => browser/app/winlauncher/freestanding/DllBlocklist.h
rename : browser/app/winlauncher/moz.build => browser/app/winlauncher/freestanding/moz.build
extra : moz-landing-system : lando
2019-09-20 19:43:00 +00:00
Ciure Andrei
7db4ad5d80 Backed out 8 changesets (bug 1542830) for causing spidermonkey bustages CLOSED TREE
Backed out changeset b9f7fc8d0172 (bug 1542830)
Backed out changeset b85f58fd5bbd (bug 1542830)
Backed out changeset 0a9169ab2623 (bug 1542830)
Backed out changeset 39a7c05d54ef (bug 1542830)
Backed out changeset 7a3cbd2f59f0 (bug 1542830)
Backed out changeset 268530552281 (bug 1542830)
Backed out changeset df658ffb8599 (bug 1542830)
Backed out changeset e7bef6486a38 (bug 1542830)

--HG--
rename : browser/app/winlauncher/freestanding/DllBlocklist.cpp => browser/app/winlauncher/DllBlocklistWin.cpp
rename : browser/app/winlauncher/freestanding/DllBlocklist.h => browser/app/winlauncher/DllBlocklistWin.h
rename : mozglue/dllservices/Authenticode.cpp => mozglue/build/Authenticode.cpp
rename : mozglue/dllservices/Authenticode.h => mozglue/build/Authenticode.h
rename : mozglue/misc/WinUtils.h => mozglue/build/MozglueUtils.h
rename : mozglue/dllservices/WindowsDllBlocklist.cpp => mozglue/build/WindowsDllBlocklist.cpp
rename : mozglue/dllservices/WindowsDllBlocklist.h => mozglue/build/WindowsDllBlocklist.h
rename : mozglue/dllservices/WindowsDllBlocklistCommon.h => mozglue/build/WindowsDllBlocklistCommon.h
rename : mozglue/dllservices/WindowsDllBlocklistDefs.in => mozglue/build/WindowsDllBlocklistDefs.in
rename : mozglue/dllservices/WindowsDllServices.h => mozglue/build/WindowsDllServices.h
rename : mozglue/dllservices/gen_dll_blocklist_defs.py => mozglue/build/gen_dll_blocklist_defs.py
rename : toolkit/components/telemetry/docs/data/third-party-modules-ping.rst => toolkit/components/telemetry/docs/data/untrusted-modules-ping.rst
rename : toolkit/components/telemetry/tests/unit/test_ThirdPartyModulesPing.js => toolkit/components/telemetry/tests/unit/test_UntrustedModulesPing.js
rename : toolkit/xre/UntrustedModulesProcessor.cpp => toolkit/xre/ModuleEvaluator_windows.cpp
rename : toolkit/xre/UntrustedModulesProcessor.h => toolkit/xre/ModuleEvaluator_windows.h
rename : toolkit/xre/ModuleVersionInfo.cpp => toolkit/xre/ModuleVersionInfo_windows.cpp
rename : toolkit/xre/ModuleVersionInfo.h => toolkit/xre/ModuleVersionInfo_windows.h
2019-09-20 21:21:39 +03:00
Aaron Klotz
b09839c047 Bug 1542830: Part 2 - Modify launcher process blocklist to collect information about untrusted module loads; r=mhowell
* We refactor the blocklist code. Code that may possibly run before
  initialization of the Win32 subsystem and the CRT is contained within the
  `freestanding` library.
* The `freestanding` library's static initializers are placed in their own
  section so that they may be manually invoked separately from the remaining
  initializers in the binary.
* `CheckBlockInfo` and `IsDllAllowed` are modified to return a `BlockAction`
  enum instead of a `bool`. This will be used more extensively in the future for
  LSP blocking.
* The launcher process now hooks `LdrLoadDll` in addition to
  `NtMapViewOfSection`. This is necessary so that we can collect timing
  information.
* Telemetry recorders must implement the `LoaderObserver` interface.
* `ModuleLoadFrame` is a RAII class that collects the information about the
  DLL load and dispatches the information to `LoaderObserver`s.
* The launcher process exposes an implementation of the `LoaderAPI` interface
  that may be called by either the launcher process blocklist or the legacy
  blocklist in `mozglue`.
* During startup, the launcher process implements its own `LoaderObserver`.
  Once mozglue is running, it connects its `LoaderObserver` to the launcher
  process, receives a vector containing the module load events, and then
  stores and forwards them into XUL.

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

--HG--
rename : browser/app/winlauncher/DllBlocklistWin.cpp => browser/app/winlauncher/DllBlocklistInit.cpp
rename : browser/app/winlauncher/DllBlocklistWin.h => browser/app/winlauncher/DllBlocklistInit.h
rename : browser/app/winlauncher/DllBlocklistWin.cpp => browser/app/winlauncher/freestanding/DllBlocklist.cpp
rename : browser/app/winlauncher/DllBlocklistWin.h => browser/app/winlauncher/freestanding/DllBlocklist.h
rename : browser/app/winlauncher/moz.build => browser/app/winlauncher/freestanding/moz.build
extra : moz-landing-system : lando
2019-09-20 16:59:40 +00:00
Andreea Pavel
31d9596a28 Backed out 8 changesets (bug 1542830) for gecko decision failure on a CLOSED TREE
DONTBUILD

Backed out changeset 4f72161be496 (bug 1542830)
Backed out changeset 7ee12138946d (bug 1542830)
Backed out changeset 9e90ee4981c6 (bug 1542830)
Backed out changeset 363039c98534 (bug 1542830)
Backed out changeset 70ffff30551a (bug 1542830)
Backed out changeset c25b7bf354d9 (bug 1542830)
Backed out changeset d156dc595b69 (bug 1542830)
Backed out changeset 9f5dbd1b2959 (bug 1542830)

--HG--
rename : browser/app/winlauncher/freestanding/DllBlocklist.cpp => browser/app/winlauncher/DllBlocklistWin.cpp
rename : browser/app/winlauncher/freestanding/DllBlocklist.h => browser/app/winlauncher/DllBlocklistWin.h
rename : mozglue/dllservices/Authenticode.cpp => mozglue/build/Authenticode.cpp
rename : mozglue/dllservices/Authenticode.h => mozglue/build/Authenticode.h
rename : mozglue/misc/WinUtils.h => mozglue/build/MozglueUtils.h
rename : mozglue/dllservices/WindowsDllBlocklist.cpp => mozglue/build/WindowsDllBlocklist.cpp
rename : mozglue/dllservices/WindowsDllBlocklist.h => mozglue/build/WindowsDllBlocklist.h
rename : mozglue/dllservices/WindowsDllBlocklistCommon.h => mozglue/build/WindowsDllBlocklistCommon.h
rename : mozglue/dllservices/WindowsDllBlocklistDefs.in => mozglue/build/WindowsDllBlocklistDefs.in
rename : mozglue/dllservices/WindowsDllServices.h => mozglue/build/WindowsDllServices.h
rename : mozglue/dllservices/gen_dll_blocklist_defs.py => mozglue/build/gen_dll_blocklist_defs.py
rename : toolkit/components/telemetry/docs/data/third-party-modules-ping.rst => toolkit/components/telemetry/docs/data/untrusted-modules-ping.rst
rename : toolkit/components/telemetry/tests/unit/test_ThirdPartyModulesPing.js => toolkit/components/telemetry/tests/unit/test_UntrustedModulesPing.js
rename : toolkit/xre/UntrustedModulesProcessor.cpp => toolkit/xre/ModuleEvaluator_windows.cpp
rename : toolkit/xre/UntrustedModulesProcessor.h => toolkit/xre/ModuleEvaluator_windows.h
rename : toolkit/xre/ModuleVersionInfo.cpp => toolkit/xre/ModuleVersionInfo_windows.cpp
rename : toolkit/xre/ModuleVersionInfo.h => toolkit/xre/ModuleVersionInfo_windows.h
2019-09-20 19:49:27 +03:00
Aaron Klotz
ee19c319fd Bug 1542830: Part 2 - Modify launcher process blocklist to collect information about untrusted module loads; r=mhowell
* We refactor the blocklist code. Code that may possibly run before
  initialization of the Win32 subsystem and the CRT is contained within the
  `freestanding` library.
* The `freestanding` library's static initializers are placed in their own
  section so that they may be manually invoked separately from the remaining
  initializers in the binary.
* `CheckBlockInfo` and `IsDllAllowed` are modified to return a `BlockAction`
  enum instead of a `bool`. This will be used more extensively in the future for
  LSP blocking.
* The launcher process now hooks `LdrLoadDll` in addition to
  `NtMapViewOfSection`. This is necessary so that we can collect timing
  information.
* Telemetry recorders must implement the `LoaderObserver` interface.
* `ModuleLoadFrame` is a RAII class that collects the information about the
  DLL load and dispatches the information to `LoaderObserver`s.
* The launcher process exposes an implementation of the `LoaderAPI` interface
  that may be called by either the launcher process blocklist or the legacy
  blocklist in `mozglue`.
* During startup, the launcher process implements its own `LoaderObserver`.
  Once mozglue is running, it connects its `LoaderObserver` to the launcher
  process, receives a vector containing the module load events, and then
  stores and forwards them into XUL.

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

--HG--
rename : browser/app/winlauncher/DllBlocklistWin.cpp => browser/app/winlauncher/DllBlocklistInit.cpp
rename : browser/app/winlauncher/DllBlocklistWin.h => browser/app/winlauncher/DllBlocklistInit.h
rename : browser/app/winlauncher/DllBlocklistWin.cpp => browser/app/winlauncher/freestanding/DllBlocklist.cpp
rename : browser/app/winlauncher/DllBlocklistWin.h => browser/app/winlauncher/freestanding/DllBlocklist.h
rename : browser/app/winlauncher/moz.build => browser/app/winlauncher/freestanding/moz.build
extra : moz-landing-system : lando
2019-09-20 00:09:35 +00:00
Toshihito Kikuchi
18aab300b5 Bug 1576697 - Use LauncherResult in WinHeaderOnlyUtils.h instead of WindowsErrorResult. r=aklotz
`WindowsErrorResult` is a class to hold either a value or a Windows error
code based on the `Result` template.  We also have `LauncherResult` for the
same purpose, which was introduced as a part of the launcher process feature
afterward.  The difference is `LauncherResult` holds a filename and line
number along with an error code.

This patch integrates LauncherResult.h into WinHeaderOnlyUtils.h so that we
can use `LauncherResult` more broadly.

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

--HG--
extra : moz-landing-system : lando
2019-09-07 18:17:45 +00:00
Gijs Kruitbosch
a48d81d4cb Bug 1577706 - move checks for -url from toolkit into browser code, and make osint sanitizer app-agnostic, r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D44395

--HG--
extra : moz-landing-system : lando
2019-09-03 17:01:33 +00:00
Andreea Pavel
746fe5255a Backed out changeset 316e6fc0e5c5 (bug 1577706) for build bustages on a CLOSED TREE 2019-09-03 18:29:19 +03:00
Gijs Kruitbosch
553eb88c50 Bug 1577706 - move checks for -url from toolkit into browser code, and make osint sanitizer app-agnostic, r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D44395

--HG--
extra : moz-landing-system : lando
2019-09-03 15:10:51 +00:00
Gijs Kruitbosch
7b142a3c2b Bug 1572838 - ensure osint commandline args are passed appropriately, r=mhowell,mossop
Differential Revision: https://phabricator.services.mozilla.com/D42311

--HG--
extra : moz-landing-system : lando
2019-08-20 19:51:34 +00:00