gecko-dev/browser/app/winlauncher
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
..
freestanding Bug 1586358 - Replace existing instances of GENERATED_FILES with references to the GeneratedFile template r=firefox-build-system-reviewers,mshal 2019-10-07 21:15:19 +00:00
test Bug 1578895 - Compare NT paths if NtOpenFile failed with STATUS_OBJECT_PATH_NOT_FOUND. r=aklotz 2019-09-23 17:59:42 +00:00
DllBlocklistInit.cpp Bug 1542830: Part 2 - Modify launcher process blocklist to collect information about untrusted module loads; r=mhowell 2019-09-23 20:17:10 +00:00
DllBlocklistInit.h Bug 1542830: Part 2 - Modify launcher process blocklist to collect information about untrusted module loads; r=mhowell 2019-09-23 20:17:10 +00:00
ErrorHandler.cpp Bug 1567605 - Add is_admin_without_uac to the launcher-process-failure ping. r=aklotz 2019-09-09 18:09:22 +00:00
ErrorHandler.h Bug 1576697 - Use LauncherResult in WinHeaderOnlyUtils.h instead of WindowsErrorResult. r=aklotz 2019-09-07 18:17:45 +00:00
LaunchUnelevated.cpp Bug 1576697 - Use LauncherResult in WinHeaderOnlyUtils.h instead of WindowsErrorResult. r=aklotz 2019-09-07 18:17:45 +00:00
LaunchUnelevated.h Bug 1576697 - Use LauncherResult in WinHeaderOnlyUtils.h instead of WindowsErrorResult. r=aklotz 2019-09-07 18:17:45 +00:00
LauncherProcessWin.cpp Bug 1529593 - Make LauncherRegistryInfo delay write to the registry. r=aklotz 2019-10-14 17:14:54 +00:00
LauncherProcessWin.h Bug 1460433: Part 2 - Log launcher process failures to a telemetry ping; r=mhowell 2019-02-25 21:14:07 +00:00
NtLoaderAPI.cpp Bug 1542830: Part 2 - Modify launcher process blocklist to collect information about untrusted module loads; r=mhowell 2019-09-23 20:17:10 +00:00
ProcThreadAttributes.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
SameBinary.h Bug 1578895 - Compare NT paths if NtOpenFile failed with STATUS_OBJECT_PATH_NOT_FOUND. r=aklotz 2019-09-23 17:59:42 +00:00
moz.build Bug 1542830: Part 4 - Modify mozglue to use new untrusted modules interfaces; r=mhowell 2019-09-23 20:18:41 +00:00