Commit Graph

1593 Commits

Author SHA1 Message Date
Gerald Squelart
29ff6c0fbd Bug 1616298 - Run BaseProfiler-independent tests even when BaseProfiler is not built - r=gregtatum,canaltinova
Some of the BaseProfile headers are always available, even when BaseProfiler
itself is not built, so we should test these in all cases.

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

--HG--
extra : moz-landing-system : lando
2020-02-26 01:39:58 +00:00
Arthur Iakab
a973454927 Backed out 2 changesets (bug 1616298)for causing build bustages on TestBaseProfiler.cpp
CLOSED TREE

Backed out changeset 781be7f64b1a (bug 1616298)
Backed out changeset a3920eccb1ac (bug 1616298)
2020-02-25 20:55:44 +02:00
Gerald Squelart
bd615e6031 Bug 1616298 - ULEB128Reader - r=canaltinova
Unsigned LEB128 parser class that can be fed bytes one by one.

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

--HG--
extra : moz-landing-system : lando
2020-02-25 06:05:29 +00:00
Gerald Squelart
8f7a1f5c14 Bug 1616298 - Run BaseProfiler-independent tests even when BaseProfiler is disabled - r=gregtatum,canaltinova
Some of the BaseProfile headers are always available, even when BaseProfiler
itself is disabled, so we should test these in all cases.

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

--HG--
extra : moz-landing-system : lando
2020-02-25 17:01:37 +00:00
Christian Holler
583260130a Bug 1615265 - Suppress data race in OffThreadDecodeCallback. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D63448

--HG--
extra : moz-landing-system : lando
2020-02-20 10:00:12 +00:00
Michal Novotny
427ad8bf1f Bug 1614637 - Remove suppression for data race in CacheStorageService::OnMemoryConsumptionChange() r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D63259

--HG--
extra : moz-landing-system : lando
2020-02-19 09:52:12 +00:00
Christian Holler
35f070d805 Bug 1616342 - Add Unity-related library to TSan suppression list. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63309

--HG--
extra : moz-landing-system : lando
2020-02-19 10:39:03 +00:00
Mike Shal
d8e4653d19 Bug 1611326 - Default to py3_action, and add a py2 attribute to GENERATED_FILES; r=firefox-build-system-reviewers,rstewart
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.

Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.

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

--HG--
extra : moz-landing-system : lando
2020-02-14 13:22:46 +00:00
Doug Thayer
7847f77986 Bug 1615045 - Remove StartupCache tsan race suppression r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D62849

--HG--
extra : moz-landing-system : lando
2020-02-14 20:29:26 +00:00
Christian Holler
1847c7f638 Bug 1615275 - Add temporary suppression for GetVelocity data race. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D62887

--HG--
extra : moz-landing-system : lando
2020-02-14 21:37:13 +00:00
Cosmin Sabou
302a8d76a6 Backed out 2 changesets (bug 1615045) for tsan failures on StartupCache.cpp.
CLOSED TREE

Backed out changeset c0414b3adbe8 (bug 1615045)
Backed out changeset 56ef1d43a305 (bug 1615045)
2020-02-14 19:32:41 +02:00
Doug Thayer
7e6ec0f8b0 Bug 1615045 - Remove StartupCache tsan race suppression r=froydnj
Depends on D62848

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

--HG--
extra : moz-landing-system : lando
2020-02-14 13:40:53 +00:00
Cosmin Sabou
ff39f9206d Backed out 2 changesets (bug 1613263, bug 1611326) for presummably causing l10n langpack bustages. a=backout
Backed out changeset 77e54e76848a (bug 1611326)
Backed out changeset 36ba18ac3a68 (bug 1613263)
2020-02-14 15:02:21 +02:00
Mike Shal
ad0c283ab2 Bug 1611326 - Default to py3_action, and add a py2 attribute to GENERATED_FILES; r=firefox-build-system-reviewers,rstewart
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.

Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.

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

--HG--
extra : moz-landing-system : lando
2020-02-13 23:07:04 +00:00
Coroiu Cristina
fc53596ca3 Backed out 2 changesets (bug 1598068) for build bustage at ShowSSEConfig on a CLOSED TREE
Backed out changeset 5fb8d24977eb (bug 1598068)
Backed out changeset eba60d849030 (bug 1598068)
2020-02-14 00:48:07 +02:00
James Willcox
5a405a1191 Bug 1598068 - Add ashmem abstraction to mozglue and use it everywhere r=glandium,jld
Apps targeting SDK 29 are not allowed to open /dev/ashmem directly, and
instead must use NDK functions. Those functions are only available in
SDK 26 and higher, so we need this shim to use the functions if they
are available, else fallback to opening /dev/ashmem directly.

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

--HG--
extra : moz-landing-system : lando
2020-02-13 22:17:05 +00:00
Brindusan Cristian
e2fb6b8344 Backed out changeset 7fefed11f117 (bug 1611326) for build bustages at update-1.xpi.stub. CLOSED TREE 2020-02-13 23:33:34 +02:00
Mike Shal
e6464dd404 Bug 1611326 - Default to py3_action, and add a py2 attribute to GENERATED_FILES; r=firefox-build-system-reviewers,rstewart
GENERATED_FILES now defaults to python3 unless py2=True is specified as
an argument. All existing GENERATED_FILES scripts and GeneratedFile
templates have the py2=True attribute added, so this patch should
effectively be a no-op.

Going forward, individual scripts can be converted to python3 and their
corresponding py2=True attribute can be deleted. In effect, this patch
will be backed out in pieces until all scripts run in python3, at which
point the py2 attribute itself can be removed.

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

--HG--
extra : moz-landing-system : lando
2020-02-13 20:31:50 +00:00
Christian Holler
9614ab7d1f Bug 1615202 - Suppression intermittent XDR race variation in TSan. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D62722

--HG--
extra : moz-landing-system : lando
2020-02-13 14:26:59 +00:00
Christian Holler
57dc730d44 Bug 1615228 - Suppress race with base::Thread::Stop(). r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D62720

--HG--
extra : moz-landing-system : lando
2020-02-13 14:27:38 +00:00
Christian Holler
5059d9b44d Bug 1615125 - Update TSan suppressions to address intermittents. r=njn CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com//D62674

--HG--
extra : amend_source : d855ee5e660ebb11f62f84a1745441add5b52b0d
2020-02-13 02:43:32 +02:00
Christian Holler
3ec290bd27 Bug 1615045 - Add temporary TSan suppression for StartupCache. r=froydnj CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D62647

--HG--
extra : amend_source : 36b0f1625051fc190a0238908917138d229f07bf
2020-02-12 22:19:04 +02:00
Christian Holler
782c1333ca Bug 1612711 - Update TSan suppressions for Mochitests/XPCShell tests. r=froydnj
Depends on D62628

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

--HG--
extra : moz-landing-system : lando
2020-02-12 19:15:16 +00:00
Toshihito Kikuchi
f6a7430688 Bug 1610790: Part 2 - Implement GetProcAddress for a remote process. r=handyman
This patch adds a function to get an exported function in a remote process.
We need this implementation to address Bug 1604008, Bug 1608645, and Bug 1610790.

When `WindowsDllInterceptor` detours a function in a remote process, we used the
native `GetProcAddress` locally, and then detours the returned address in the
target process.  The problem is if the caller's export table was modified, the
address returned from `GetProcAddress` might be invalid in the target process,
which is Bug 1604008.

I implemented `GetProcAddress` depending on both local and remote process image,
but it caused two regressions Bug 1608645 and Bug 1610790 because multiple
applications modify firefox's export table in multiple ways, such as replacing
an entry of EAT, replacing an RVA to Export section, or etc.

With this patch, we can use `PEExportSection<MMPolicy>::GetProcAddress` to get
an exported function in a remote process without relying on any local data so
that it's not impacted by modification of the local export table.

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

Depends on D62314
2020-02-11 22:21:10 +02:00
Toshihito Kikuchi
1764f470d6 Bug 1610790: Part 1 - Use wmain in mozglue/tests. r=handyman
This patch changes the entrypoint of test programs under mozglue/tests so that
a coming test program can handle a command string easily.

Differential Revision: https://phabricator.services.mozilla.com//D62314
2020-02-12 02:23:57 +02:00
Cosmin Sabou
aa2a505209 Backed out 2 changesets (bug 1610790) for causing build bustages about ShowSSEConfig.
CLOSED TREE
2020-02-12 01:10:38 +02:00
Toshihito Kikuchi
23b368208e Bug 1610790: Part 2 - Implement GetProcAddress for a remote process. r=handyman
This patch adds a function to get an exported function in a remote process.
We need this implementation to address Bug 1604008, Bug 1608645, and Bug 1610790.

When `WindowsDllInterceptor` detours a function in a remote process, we used the
native `GetProcAddress` locally, and then detours the returned address in the
target process.  The problem is if the caller's export table was modified, the
address returned from `GetProcAddress` might be invalid in the target process,
which is Bug 1604008.

I implemented `GetProcAddress` depending on both local and remote process image,
but it caused two regressions Bug 1608645 and Bug 1610790 because multiple
applications modify firefox's export table in multiple ways, such as replacing
an entry of EAT, replacing an RVA to Export section, or etc.

With this patch, we can use `PEExportSection<MMPolicy>::GetProcAddress` to get
an exported function in a remote process without relying on any local data so
that it's not impacted by modification of the local export table.

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

Depends on D62314

--HG--
extra : rebase_source : 3088f5997a2097ef22ce8567783375e5f7866ab2
2020-02-11 22:21:10 +02:00
Toshihito Kikuchi
638cc48d46 Bug 1610790: Part 1 - Use wmain in mozglue/tests. r=handyman
This patch changes the entrypoint of test programs under mozglue/tests so that
a coming test program can handle a command string easily.

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

--HG--
extra : rebase_source : a180de844700bbee60a6491a35da33da84aa12ed
2020-02-10 19:58:33 +02:00
Cosmin Sabou
d8474fa6b6 Backed out changeset f0890a32d6bb (bug 1604008) as requested by tkikuchi (toshi).
--HG--
extra : rebase_source : 799ec22fbc48b549c2e9d5ea295bcf92cb941b5d
2020-02-11 23:21:17 +02:00
Cosmin Sabou
b438e2a16f Backed out changeset f74adc43b654 (bug 1608645) as requested by tkikuchi (toshi).
--HG--
extra : rebase_source : 83d53600fe057aca34128ac37b451120cb3337b5
2020-02-11 23:19:56 +02:00
Toshihito Kikuchi
3694eeda43 Bug 1592486 - Store ModuleLoadFrame::sTopFrame as a global variable if TLS is not ready. r=aklotz
We had a thread-local varialbe `ModuleLoadFrame::sTopFrame` to track the topmost
stack frame of `LdrLoadDll`.  However, our hook function `patched_LdrLoadDll` can
be called even before TLS is initialized.  In such a case, accessing `sTopFrame`
causes AV.

This patch introduces `SafeThreadLocal` to safely access a thread-local varialbe.
If TLS is not initialized, it falls back to a global variable because in that
early stage there is only a single thread running.

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

--HG--
extra : moz-landing-system : lando
2020-02-07 18:08:11 +00:00
Narcis Beleuzu
614e851352 Backed out changeset 6866be136e53 (bug 1592486) for cppunit failures on TestNativeNt.exe . CLOSED TREE 2020-02-06 11:53:45 +02:00
Toshihito Kikuchi
c531413173 Bug 1592486 - Store ModuleLoadFrame::sTopFrame as a global variable if TLS is not ready. r=aklotz
We had a thread-local varialbe `ModuleLoadFrame::sTopFrame` to track the topmost
stack frame of `LdrLoadDll`.  However, our hook function `patched_LdrLoadDll` can
be called even before TLS is initialized.  In such a case, accessing `sTopFrame`
causes AV.

This patch introduces `SafeThreadLocal` to safely access a thread-local varialbe.
If TLS is not initialized, it falls back to a global variable because in that
early stage there is only a single thread running.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 03:10:57 +00:00
Emilio Cobos Álvarez
33b4cfe736 Bug 1610702 - Generalize Vector::podResizeToFit into Vector::shrinkStorageToFit(). r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D61337

--HG--
extra : moz-landing-system : lando
2020-02-03 17:32:12 +00:00
Edwin Takahashi
d174b45f2d Bug 1602689 - whitelist RegisteredThread::RegisteredThread r=decoder,gerald
Changes:

Whitelist the `RegisteredThread::RegisteredThread` failures for linux1804-64-asan/opt temporarily while the parent bug is left open, to support `mochitest-browser-chrome` migration to linux1804-64.

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

--HG--
extra : moz-landing-system : lando
2020-01-30 20:21:31 +00:00
Sylvestre Ledru
1ba4b73c17 Bug 1611635 - TestPrintf.cpp: remove a test - causes a warning with gcc > 9 r=froydnj
The "(null)" printing behavior is a glibc extension and the specified behavior
in the standard is undefined

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

--HG--
extra : moz-landing-system : lando
2020-01-26 08:23:45 +00:00
David Major
76ce9d96fa Bug 1598119 - Disable Control Flow Guard for WindowsDllInterceptor returns r=handyman
Under the stronger Control Flow Guard scheme coming in clang 10, when a nop-space hook jumps back to the original API, at `ntdll!Whatever+2`, that address is not a registered jump target, so we crash with a CFG failure. Since this is a deliberate violation of the rules, let's disable CFG for these calls.

Based on my testing, this is the only place we need to use this attribute, so I placed its definition close to the use. (Had we needed more of these, I would have put it in mfbt/.)

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

--HG--
extra : moz-landing-system : lando
2020-01-21 18:50:22 +00:00
Sylvestre Ledru
187e9bafaf Bug 1519636 - Automatically reformat recent changes using clang-format r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2020-01-21 09:51:27 +00:00
Toshihito Kikuchi
a172471711 Bug 1608645 - Ensure FindExportAddressTableEntry can handle a modified Export Table. r=aklotz
A third-party application can modify the export directory, the export address/name/ordinal
tables, or an entry in those tables.  If that happens, we will see an RVA is located outside
the mapped image and `RVAToPtr` returns null.  This patch makes sure we don't hit null AV
when modification is detected.

`FindExportAddressTableEntry` should not return a pointer to the modified table entry because
we dereference it in another process to cross-process detour.

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

--HG--
extra : moz-landing-system : lando
2020-01-21 00:44:28 +00:00
Emilio Cobos Álvarez
256c124f94 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez
4f0e8086f2 Bug 1609996 - Fix some things that the automated replacement didn't catch. r=froydnj
This makes Gecko build again. I'll squash this into the previous commit anyhow.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:28 +00:00
Emilio Cobos Álvarez
aa3a695712 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:20 +00:00
Nazım Can Altınova
d8afe0647a Bug 1609708 - Rename PROFILER_TRACING to PROFILER_TRACING_MARKER. r=gerald
Depends on D60229

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

--HG--
extra : moz-landing-system : lando
2020-01-17 21:29:15 +00:00
shindli
c52d5f8025 Backed out 2 changesets (bug 1586939) for causing perma bc failures in automation.py CLOSED TREE
Backed out changeset 922243345807 (bug 1586939)
Backed out changeset b5aac83f7f4f (bug 1586939)
2020-01-16 09:51:49 +02:00
Gerald Squelart
50efb05c6b Bug 1586939 - Remove "_BASE" from most Base Profiler env-vars - r=gregtatum
Now both profilers are controlled by the same environment variables, e.g.
"MOZ_PROFILER_STARTUP" to run both profilers at startup.

The only remaining Base Profiler-specific commands are:
- MOZ_BASE_PROFILER_HELP, because the Base Profiler doesn't have the same
  capabilities as Gecko, so it may display different available features.
- MOZ_BASE_PROFILER_LOGGING, because the Base Profiler doesn't have access to
  MOZ_LOG (both the env-var and the C++ macros).

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

--HG--
extra : moz-landing-system : lando
2020-01-15 01:57:35 +00:00
Gerald Squelart
407454a9e0 Bug 1586939 - Re-enable MOZ_BASE_PROFILER_STARTUP_DURATION and _INTERVAL - r=gregtatum
This env-vars were not processed because of some needed special processing, and
they were not critical.
But now we want them to be correctly read, to match the Gecko Profiler features.

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

--HG--
extra : moz-landing-system : lando
2020-01-15 01:57:13 +00:00
Andrew McCreight
b50a606c57 Bug 1608533 - Whitelist libX11.so for LSan. r=decoder
Differential Revision: https://phabricator.services.mozilla.com/D59576

--HG--
extra : moz-landing-system : lando
2020-01-12 10:09:58 +00:00
Toshihito Kikuchi
eb086eb295 Bug 1604008 - Use a target process's export table to cross-process detour. r=aklotz
When `WindowsDllInterceptor` detours a function in a remote process, it calculates
a target address via `GetProcAddress` in the caller's process first, and detours
that address in the target process.  If the caller's export table was modified, the
target address might be invalid in the target process.

With this patch, `WindowsDllInterceptor` uses the target process's export table to
calculate a target function address.

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

--HG--
extra : moz-landing-system : lando
2020-01-11 00:34:21 +00:00
Sylvestre Ledru
c521758c5e Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2020-01-09 21:50:11 +00:00
Toshihito Kikuchi
db6fc91531 Bug 1601796 - Use GetSystemTimePreciseAsFileTime instead of GetSystemTime+SystemTimeToFileTime. r=mayhemer,aklotz
`GetProcessTimes` is based on QPC, while `GetSystemTime` is based on clock
interruption whose accuracy is lower than QPC.  This means in a process's early
stage, `GetSystemTime` may return a timestamp earlier than creation timestamp.
If this happens we'll keep a negative process uptime which causes overflow in
telemetry processing.

Win8+ has a handy API `GetSystemTimePreciseAsFileTime` that solves everything.

On Win7, `GetSystemTimeAsFileTime` still solves this issue.  In the worst case,
it returns the exact same timestamp as process creation, but it's ok.

Because the system time is stored as a `FILETIME` in `KUSER`, converting it to
a `SYSTEMTIME` with `GetSystemTime` drops accuracy.  We should avoid it unless
needed.

This patch also moves the call to `GetProcessTimes` before getting the current
timestamp in case clock interruption happens in between those two function calls.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 16:53:17 +00:00
Gerald Squelart
1484f8824a Bug 1600644 - Don't count ActivePS::mProfileBuffer's own size twice - r=canaltinova
In bug 1587332, ActivePS::mProfileBuffer was changed from
`const UniquePtr<ProfileBuffer>` to just `ProfileBuffer`, so its own object size
is now counted as part of `sizeof(ActivePS)`, and we should only count its
dependencies with `SizeOfExcludingThis`.

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

--HG--
extra : moz-landing-system : lando
2020-01-02 12:21:58 +00:00
Toshihito Kikuchi
3518bfb5e3 Bug 1599015 - Graciously return a failure if we fail to change the attribute of a trampoline. r=handyman,dmajor
Our detour allocates a trampoline with `PAGE_EXECUTE_READ` first, and then makes
it writable before use.  If the dynamic code policy is enabled after allocation,
we fail to change the attribute, and crash the process because we try to write
data into a readonly page.  We need to check the validity of a trampoline before
writing data.

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

--HG--
extra : moz-landing-system : lando
2020-01-02 17:08:33 +00:00
Aaron Klotz
ea529fe28c Bug 1598703: Part 2 - Add IAT Patching capabilities to the Windows DLL Interceptor; r=mhowell
This is a pretty straightforward patch; we add `WindowsIATPatcher` to
implement the actual IAT patching, and use a partial specialization of
`FuncHook` to account for the underlying differences in implementation vs our
existing interceptor code.

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

--HG--
extra : moz-landing-system : lando
2019-12-23 23:11:35 +00:00
Aaron Klotz
88b936e379 Bug 1598703: Part 1 - Rename PEHeaders::GetIATForModule to PEHeaders::GetImportDescriptor; r=mhowell
Strictly speaking, the import descriptor includes more than just the IAT,
so renaming this method to reflect that.

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

--HG--
extra : moz-landing-system : lando
2019-12-23 23:11:07 +00:00
Gurzau Raul
e014bf8778 Backed out 2 changesets (bug 1598703) for bustage at WindowsDllBlocklist.obj on a CLOSED TREE.
Backed out changeset b9c2e8b94733 (bug 1598703)
Backed out changeset 6d7358a0e785 (bug 1598703)
2019-12-23 22:53:32 +02:00
Aaron Klotz
21fed2ab5e Bug 1603714: Follow-up: also add move constructor and move assignment operator to MemorySectionNameBuf; r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D58142

--HG--
extra : moz-landing-system : lando
2019-12-23 20:27:38 +00:00
Aaron Klotz
1a8cc2849d Bug 1598703: Part 2 - Add IAT Patching capabilities to the Windows DLL Interceptor; r=mhowell
This is a pretty straightforward patch; we add `WindowsIATPatcher` to
implement the actual IAT patching, and use a partial specialization of
`FuncHook` to account for the underlying differences in implementation vs our
existing interceptor code.

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

--HG--
extra : moz-landing-system : lando
2019-12-23 20:13:31 +00:00
Aaron Klotz
68eee2c6ab Bug 1598703: Part 1 - Rename PEHeaders::GetIATForModule to PEHeaders::GetImportDescriptor; r=mhowell
Strictly speaking, the import descriptor includes more than just the IAT,
so renaming this method to reflect that.

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

--HG--
extra : moz-landing-system : lando
2019-12-23 20:11:26 +00:00
Chris Peterson
406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

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

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Aaron Klotz
844739bc32 Bug 1605248: Convert LoaderObserver::Clear to LoaderObserver::Disable; r=mhowell
We rename `LoaderObserver::Clear` to `LoaderObserver::Disable` to more accurately
reflect the following behaviour change:

Not only does the `Disable` call free any enqueued module load events, it also
ensures that no further module loads will be saved in the future. This reflects
the reality that any `mozglue` client that calls `Disable` has no intention of
ever processing these events.

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

--HG--
extra : moz-landing-system : lando
2019-12-19 22:20:37 +00:00
Aaron Klotz
72918a2e58 Bug 1603714: Add explicit copy constructor and copy assignment operators to nt::MemorySectionNameBuf; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D57889

--HG--
extra : moz-landing-system : lando
2019-12-19 22:11:24 +00:00
Gerald Squelart
7a41d8998c Bug 1604661 - Gecko Profiler filter "*" selects all registered threads - r=gregtatum
The only way to select all registered threads was to have an empty entry in the
filter list, usually by just having "," (a single comma).
The popup removes spurious empty items, making this impossible for most users.

It is now possible to just have "*" (as the whole filter string, or at least one
item in the list) to select all registered threads.

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

--HG--
extra : moz-landing-system : lando
2019-12-18 20:38:59 +00:00
Jeff Walden
e57173377f Bug 1439659 - Make |MOZ_{LITTLE,BIG}_ENDIAN| into function macros so that invoking them inside |#if| conditions when they haven't been defined yet is a compile error. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D57038

--HG--
extra : moz-landing-system : lando
2019-12-13 20:51:04 +00:00
Tom Ritter
37f89d5a1d Bug 1590624 - mingw-clang cannot use _xgetbv without -mavx, work around it r=lsalzman,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D54531

--HG--
extra : moz-landing-system : lando
2019-12-12 06:38:39 +00:00
Andreea Pavel
a533b175dd Backed out 4 changesets (bug 1590624) for breaking gecko decision task on a CLOSED TREE
Backed out changeset 2ac8dd1d709d (bug 1590624)
Backed out changeset 8432398c212a (bug 1590624)
Backed out changeset 2b28154aacdb (bug 1590624)
Backed out changeset d305e4160ee4 (bug 1590624)

--HG--
rename : build/build-clang/clang-9-mingw.json => build/build-clang/clang-8-mingw.json
rename : taskcluster/scripts/misc/build-clang-mingw.sh => taskcluster/scripts/misc/build-clang-8-mingw.sh
2019-12-12 08:35:11 +02:00
Tom Ritter
d536ec53bb Bug 1590624 - mingw-clang cannot use _xgetbv without -mavx, work around it r=lsalzman,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D54531

--HG--
extra : moz-landing-system : lando
2019-12-10 18:41:41 +00:00
Andrew McCreight
e53b07137d Bug 1602645 - Add leak suppression for libfreetype.so. r=decoder
Changing the OS we run Linux ASan on from ubuntu1604 to ubuntu1804
causes 820800 bytes of leaks with libfreetype.so in the stack in
almost every test suite. Presumably this is just a variation on
existing leaks we get because we don't shut down fonts properly, so
just whitelist it.

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

--HG--
extra : moz-landing-system : lando
2019-12-10 12:37:15 +00:00
Aaron Klotz
23e61114cf Bug 1522830: Part 8 - Update UntrustedModulesProcessor to support processing child processes; r=mhowell
This patch contains the core changes to make this all work across e10s:

* We clarify the naming of path variables to be more specific as to whether they are NT paths or DOS paths;
* We add IPC `ParamTraits` that are necessary for `UntrustedModulesData` types;
* We implement `ProcessModuleLoadQueue` for child processes. Because of sandboxing, we need to split this sequence into multiple async operations:
  ** Initial queue processing;
  ** Sending the list of modules to the parent process to determine trustworthiness (via `GetModulesTrust`);
  ** Receiving the results from the parent process and producing a final result (via `CompleteProcessing`).
* We implement the `GetModulesTrust` function for the parent process, which evaluates the trust of child process modules;
* We change all hash tables to be keyed using NT paths. Because resolving DOS paths may not be permitted in sandboxed processes,
  we need to standardize on NT paths as the "universal path" across processes.
* We add `WinDllServices::StartUntrustedModulesProcessor` to separate untrusted modules startup from `WinDllServices` construction:
  ** While we now start `WinDllServices` across all child process types, only specific process types will support untrusted modules.
  ** Furthermore, untrusted modules must be started at a very specific point that is dependent on the type of child process.
  ** We add those calls to `StartUntrustedModulesProcessor` in subsequent patches.

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

--HG--
extra : moz-landing-system : lando
2019-12-06 22:06:26 +00:00
Aaron Klotz
78b5fd3fbf Bug 1522830: Part 6 - Add API to be able to initialize launcher dll blocklist during spawning of child process; r=mhowell
We need a way for the sandbox broker to be able to initialize the launcher
DLL blocklist when starting a new content process.

This patch adds the ability to resolve the initialization function through
DLL services.

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

--HG--
extra : moz-landing-system : lando
2019-12-06 22:03:45 +00:00
Aaron Klotz
ddf3168d35 Bug 1522830: Part 3 - Change launcher blocklist generation to include child processes; r=bytesized
Now that the launcher blocklist will support child processes, we need to add
them to the launcher blocklist. The revised criteria the `Launcher` blocklist
matches the criteria already in use by the `Legacy` blocklist.

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

--HG--
extra : moz-landing-system : lando
2019-12-06 22:01:02 +00:00
Aaron Klotz
b43c0975e4 Bug 1522830: Part 2 - Make launcher blocklist work in child processes; r=mhowell
* We change `InitializeDllBlocklistOOP` to be able to set the correct flags
  when initializing a sandbox child process.
* We change the freestanding DLL blocklist code to be sensitive to the
  `CHILD_PROCESSES_ONLY` flag;
* We move the declaration of `gBlocklistInitFlags` to `WindowsDllBlocklist.h`
  so that it is visible to more code.

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

--HG--
extra : moz-landing-system : lando
2019-12-06 22:00:18 +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
4204671639 Bug 1522830: Part 8 - Update UntrustedModulesProcessor to support processing child processes; r=mhowell
This patch contains the core changes to make this all work across e10s:

* We clarify the naming of path variables to be more specific as to whether they are NT paths or DOS paths;
* We add IPC `ParamTraits` that are necessary for `UntrustedModulesData` types;
* We implement `ProcessModuleLoadQueue` for child processes. Because of sandboxing, we need to split this sequence into multiple async operations:
  ** Initial queue processing;
  ** Sending the list of modules to the parent process to determine trustworthiness (via `GetModulesTrust`);
  ** Receiving the results from the parent process and producing a final result (via `CompleteProcessing`).
* We implement the `GetModulesTrust` function for the parent process, which evaluates the trust of child process modules;
* We change all hash tables to be keyed using NT paths. Because resolving DOS paths may not be permitted in sandboxed processes,
  we need to standardize on NT paths as the "universal path" across processes.
* We add `WinDllServices::StartUntrustedModulesProcessor` to separate untrusted modules startup from `WinDllServices` construction:
  ** While we now start `WinDllServices` across all child process types, only specific process types will support untrusted modules.
  ** Furthermore, untrusted modules must be started at a very specific point that is dependent on the type of child process.
  ** We add those calls to `StartUntrustedModulesProcessor` in subsequent patches.

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

--HG--
extra : moz-landing-system : lando
2019-12-05 21:57:29 +00:00
Aaron Klotz
a62a0441c9 Bug 1522830: Part 6 - Add API to be able to initialize launcher dll blocklist during spawning of child process; r=mhowell
We need a way for the sandbox broker to be able to initialize the launcher
DLL blocklist when starting a new content process.

This patch adds the ability to resolve the initialization function through
DLL services.

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

--HG--
extra : moz-landing-system : lando
2019-12-05 21:55:02 +00:00
Aaron Klotz
21f179a116 Bug 1522830: Part 3 - Change launcher blocklist generation to include child processes; r=bytesized
Now that the launcher blocklist will support child processes, we need to add
them to the launcher blocklist. The revised criteria the `Launcher` blocklist
matches the criteria already in use by the `Legacy` blocklist.

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

--HG--
extra : moz-landing-system : lando
2019-12-05 21:52:13 +00:00
Aaron Klotz
1faa66d3d6 Bug 1522830: Part 2 - Make launcher blocklist work in child processes; r=mhowell
* We change `InitializeDllBlocklistOOP` to be able to set the correct flags
  when initializing a sandbox child process.
* We change the freestanding DLL blocklist code to be sensitive to the
  `CHILD_PROCESSES_ONLY` flag;
* We move the declaration of `gBlocklistInitFlags` to `WindowsDllBlocklist.h`
  so that it is visible to more code.

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

--HG--
extra : moz-landing-system : lando
2019-12-05 21:51:35 +00:00
David Parks
3100db960f Bug 1598650: Copy operand for mov byte ptr, imm8 in DLL interceptor r=aklotz
mov byte ptr support was added in bug 1382251 but did not properly count the instruction size.  It was missing the 1-byte operand, which causes the rest of the trampoline to be garbage.

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

--HG--
extra : moz-landing-system : lando
2019-12-03 22:47:58 +00:00
David Parks
e3cb2950f2 Bug 1489391: Part 2 - Remove SetWindowLong*/SetWindowLongPtr* from TestDllInterceptor r=aklotz
SetWindowLong*/SetWindowLongPtr* was being intercepted so that we could override windowprocs in windowed plugins on Windows.  We no longer support windowed plugins so these functions are never intercepted.

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

--HG--
extra : moz-landing-system : lando
2019-12-05 00:41:32 +00:00
David Parks
8310e7a2d9 Bug 1489391: Part 1 - Use 10-byte patch in DLL interceptor for CloseHandle on Win8/8.1 r=aklotz
CloseHandle has a jump followed by enough `nop`s to fit a 10-byte patch but not enough to fit the default 13-byte patch when running Windows 8 or 8.1.  This patch tells the interceptor to use a 10-byte patch on those OSs.

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

--HG--
extra : moz-landing-system : lando
2019-12-05 00:41:23 +00:00
Jesse Schwartzentruber
81870fa7c5 Bug 1482167 - Create --enable-fuzzing ASAN build job for Android x86-64 firefox. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D3027

--HG--
extra : moz-landing-system : lando
2019-12-04 21:44:06 +00:00
Gabriele Svelto
d0e4d2c6c2 Bug 1420363 - Write crash annotations as JSON r=froydnj,agi
This patch rolls up all the required changes for this purpose. Since the
whole crash reporting flow must understand the new format it's not possible
to land this as separate patches as individually they would be broken. This
patch includes the following changes:

* Changes to the crash reporting machinery to write out annotations as JSON,
  these includes changes to the DLL blocklist code that must be run at crash
  time.
* Modifications to the crash reporter client so that it can read and
  submit the new format; this includes platform-specific changes to the
  Breakpad libraries it uses for submitting crashes.
* Modifications to the minidump-analyzer to understand and process the new
  format correctly.
* Modifications to the crash manager to understand and process the new format
  correctly.
* Modifications to GeckoView's crash handler to understand and submit the
  new format correctly.
* Added new tests to cover the new format and modified existing ones to
  accomodate the new one.

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

--HG--
extra : moz-landing-system : lando
2019-12-02 13:18:35 +00:00
Gerald Squelart
fb5cbabc75 Bug 1598531 - Output Base Profiler logging to stderr, so it is correctly sync'd with MOZ_LOG - r=gregtatum
This is especially useful when debugging both Base Profiler and Gecko Profiler,
so that their messages are correctly sequenced.

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

--HG--
extra : moz-landing-system : lando
2019-11-26 23:01:25 +00:00
Gerald Squelart
9da1d33d1e Bug 1598992 - Use same thread names in Base Profiler filter as in Gecko, and suffix with "(pre-xul)" in JSON - r=gregtatum
The Base Profiler originally named the main thread "Main Thread", which is
friendlier than "GeckoMain". However this makes it more difficult to combine the
controls for both profilers if they use different names.

So now both profilers use "GeckoMain", so filters can be exactly the same.
Base Profiler adds "(pre-xul)" to the name to distinguish tracks in the
frontend -- This distinction is actually necessary so the frontend doesn't get
confused by threads with the exact same name, but eventually tracks will get
combined in the frontend as well.

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

--HG--
extra : moz-landing-system : lando
2019-11-26 23:01:10 +00:00
Narcis Beleuzu
822a54d9fb Backed out 6 changesets (bug 1598992, bug 1598531, bug 1598529) for causing MinGW bustages on GeckoProfiler.cpp. CLOSED TREE
Backed out changeset 407ccb5f316b (bug 1598531)
Backed out changeset 40903d7428fb (bug 1598992)
Backed out changeset 53bc356053b0 (bug 1598992)
Backed out changeset a7931318ce6c (bug 1598992)
Backed out changeset b3880cc8dc23 (bug 1598992)
Backed out changeset 1e969b7c2352 (bug 1598529)
2019-11-26 23:36:11 +02:00
Gerald Squelart
8bd3b43665 Bug 1598531 - Output Base Profiler logging to stderr, so it is correctly sync'd with MOZ_LOG - r=gregtatum
This is especially useful when debugging both Base Profiler and Gecko Profiler,
so that their messages are correctly sequenced.

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

--HG--
extra : moz-landing-system : lando
2019-11-26 11:28:33 +00:00
Gerald Squelart
65a045f543 Bug 1598992 - Use same thread names in Base Profiler filter as in Gecko, and suffix with "(pre-xul)" in JSON - r=gregtatum
The Base Profiler originally named the main thread "Main Thread", which is
friendlier than "GeckoMain". However this makes it more difficult to combine the
controls for both profilers if they use different names.

So now both profilers use "GeckoMain", so filters can be exactly the same.
Base Profiler adds "(pre-xul)" to the name to distinguish tracks in the
frontend -- This distinction is actually necessary so the frontend doesn't get
confused by threads with the exact same name, but eventually tracks will get
combined in the frontend as well.

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

--HG--
extra : moz-landing-system : lando
2019-11-26 11:27:45 +00:00
Toshihito Kikuchi
952d5f6b7e Bug 1417772 - Skip testcases in TestAssemblyFunctions in CCov build. r=handyman
Our detour cannot handle assembly patterns which is injected by the code coverage
instrumentation.  We need to skip them in CCov build.

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

--HG--
extra : moz-landing-system : lando
2019-11-26 17:39:25 +00:00
Mike Hommey
b1d0510804 Bug 1598196 - Support disabling the linker on Android in the code. r=froydnj
For now, there is no flag to actually allow it, but this is the
code-side changes to allow the linker being disabled.

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

--HG--
extra : moz-landing-system : lando
2019-11-21 14:57:24 +00:00
Mike Hommey
6b83eba3c7 Bug 1598194 - Make FaultyLib-specific code FaultyLib-specific rather than Android-specific. r=gerald
The custom linker used on Android (FaultyLib), can be enabled on
non-Android, and in the near future, may not always be enabled on
Android, so the FaultyLib-specific parts of the profile need to not be
specific to Android, but to the linker being enabled instead.

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

--HG--
extra : moz-landing-system : lando
2019-11-25 23:04:24 +00:00
Andrew McCreight
d25c3b20ae Bug 1598787 - Rename XRE_ChildProcessTypeToString to XRE_GeckoProcessTypeToString. r=froydnj
This function works on all GeckoProcessTypes, not just those for child
processes.

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

--HG--
extra : moz-landing-system : lando
2019-11-25 22:45:31 +00:00
Toshihito Kikuchi
764bd4d432 Bug 1596930 - Add new patterns to detour. r=handyman
This patch adds the following pattern to our x64 detour so that we can hook APIs
even though a target is already detoured by another application.

```
mov   rax, imm64
push  rax
ret
```

We already have `PatchIfTargetIsRecognizedTrampoline` to detour the pattern
`mov; jmp`.  There is another variation using `push rax;ret` to jump.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 00:36:46 +00:00
David Major
4afd3b6941 Bug 1577236 - clang-10: Fix -Wimplicit-int-float-conversion warnings in TimeStamp r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D54031

--HG--
extra : moz-landing-system : lando
2019-11-20 21:06:33 +00:00
Toshihito Kikuchi
0be9cffb93 Bug 1597605 - Pass a valid OBJECT_ATTRIBUTES to NtQueryFullAttributesFile. r=handyman
Passing a dummy object to `NtQueryFullAttributesFile` to avoid AV on WOW64.

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

--HG--
extra : moz-landing-system : lando
2019-11-20 01:15:49 +00:00
Randell Jesup
b3b313e654 Bug 1595482: change "responsiveness" field to "eventDelay" in profiler r=canaltinova
We want the profiler UI to be able to know if the data can be used for
reconstructing the event delays, since it measures something different
from the old 16ms event injection.

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

--HG--
extra : moz-landing-system : lando
2019-11-18 14:26:14 +00:00
Razvan Maries
b90bde90fc Backed out changeset 1603f5abc56e (bug 1420363) for perma fails on test_busy_hang.xul. CLOSED TREE
--HG--
extra : rebase_source : 02c0d2f9f92f0a01ef57e4f9b38a008f6bc0eb50
2019-11-16 13:00:43 +02:00
Gabriele Svelto
fb2b45f492 Bug 1420363 - Write crash annotations as JSON r=froydnj,agi
This patch rolls up all the required changes for this purpose. Since the
whole crash reporting flow must understand the new format it's not possible
to land this as separate patches as individually they would be broken. This
patch includes the following changes:

* Changes to the crash reporting machinery to write out annotations as JSON,
  these includes changes to the DLL blocklist code that must be run at crash
  time.
* Modifications to the crash reporter client so that it can read and
  submit the new format; this includes platform-specific changes to the
  Breakpad libraries it uses for submitting crashes.
* Modifications to the minidump-analyzer to understand and process the new
  format correctly.
* Modifications to the crash manager to understand and process the new format
  correctly.
* Modifications to GeckoView's crash handler to understand and submit the
  new format correctly.
* Added new tests to cover the new format and modified existing ones to
  accomodate the new one.

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

--HG--
extra : moz-landing-system : lando
2019-11-16 08:29:07 +00:00
Toshihito Kikuchi
bd457a84a8 Bug 1587642 - Make the blocklist work when the process heap is not initialized. r=aklotz
`patched_NtMapViewOfSection` uses the process default heap to copy a string.
However, `patched_NtMapViewOfSection` can be invoked even before the process
heap is initialized. One example we found is Windows Defender's EAF, with
which "verifier.dll" is loaded before the process heap is initialized.

This patch adds a check whether the heap is initialized or not in
`patched_NtMapViewOfSection` and `NativeNtBlockSet::Add`. This also minimizes
the usage of the heap, i.e. not copying a string when we block a dll.

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

--HG--
extra : moz-landing-system : lando
2019-11-15 22:53:49 +00:00
Mike Hommey
87b77cda38 Bug 1594998 - Make standalone SpiderMonkey use libxul-like panic. r=froydnj
This moves the parts of toolkit/library/rust/shared/lib.rs related to
panic hooking to a new mozglue subdirectory, which will be used for
things that can be statically linked to e.g. libxul, rather than in
a "shared library".

The panic hook is disabled when building spidermonkey via the mozjs_sys
crate.

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

--HG--
extra : moz-landing-system : lando
2019-11-15 13:14:42 +00:00
Nazım Can Altınova
b7c55f9282 Bug 1468789 - Part 3: Serialize innerWindowID for js/jit frames. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D51861

--HG--
extra : moz-landing-system : lando
2019-11-14 14:15:03 +00:00
Nazım Can Altınova
8f6754f6fc Bug 1468789 - Part 2: Collect inner window id information for js interpreter frames and add a mechanism to get that for jit frames r=gerald,jandem,mstange
Differential Revision: https://phabricator.services.mozilla.com/D51860

--HG--
extra : moz-landing-system : lando
2019-11-15 08:01:30 +00:00
philipp
0815d73047 Bug 1576728 - Let blocklist entries for FYUnZIP and PuddingZip ride the trains but confine them to older/unversioned dlls. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D53103

--HG--
extra : moz-landing-system : lando
2019-11-14 23:40:00 +00:00
Ciure Andrei
70b54837ac Backed out changeset 7a28c229e654 (bug 1594998) for causing bustages CLOSED TREE 2019-11-15 03:26:34 +02:00
Mike Hommey
63489b5491 Bug 1594998 - Make standalone SpiderMonkey use libxul-like panic. r=froydnj
This moves the parts of toolkit/library/rust/shared/lib.rs related to
panic hooking to a new mozglue subdirectory, which will be used for
things that can be statically linked to e.g. libxul, rather than in
a "shared library".

The panic hook is disabled when building spidermonkey via the mozjs_sys
crate.

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

--HG--
extra : moz-landing-system : lando
2019-11-15 00:21:32 +00:00
Gurzau Raul
f4fadbbe04 Backed out changeset 4cf8f3f89042 (bug 1594998) for xpcshell failures at test_crash_rust_panic.js on a CLOSED TREE. 2019-11-14 03:52:52 +02:00
Mike Hommey
f33a622429 Bug 1594998 - Make standalone SpiderMonkey use libxul-like panic. r=froydnj,jandem
This moves the parts of toolkit/library/rust/shared/lib.rs related to
panic hooking to a new mozglue subdirectory, which will be used for
things that can be statically linked to e.g. libxul, rather than in
a "shared library".

The panic hook is disabled when building spidermonkey via the mozjs_sys
crate.

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

--HG--
extra : moz-landing-system : lando
2019-11-13 22:07:08 +00:00
Narcis Beleuzu
f0fe67f321 Backed out changeset 70738ac7ba9b (bug 1595482) for xpcshell failures on test_responsiveness.js . CLOSED TREE 2019-11-13 18:28:31 +02:00
Randell Jesup
f542396ff9 Bug 1595482: change "responsiveness" field to "eventDelay" in profiler r=canaltinova
We want the profiler UI to be able to know if the data can be used for
reconstructing the event delays, since it measures something different
from the old 16ms event injection.

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

--HG--
extra : moz-landing-system : lando
2019-11-13 14:21:52 +00:00
Randell Jesup
3d6c5b76dd Bug 1572337: Don't call TimeStamp::Now() within SuspendAndSample r=froydnj
Avoids deadlocks on Windows due to Now() taking a lock; if done while we've
paused a thread that holds the lock we will deadlock.

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

--HG--
extra : moz-landing-system : lando
2019-11-08 21:18:06 +00:00
Randell Jesup
05d65a0464 Bug 1572337: Remove old responsiveness profiler measurement r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D44060

--HG--
extra : moz-landing-system : lando
2019-11-08 21:08:07 +00:00
Ciure Andrei
b7c3599997 Backed out 3 changesets (bug 1572337, bug 1594015) for causing linting failures and build bustages CLOSED TREE
Backed out changeset 25f074eb5074 (bug 1594015)
Backed out changeset fc8a37c2c22c (bug 1572337)
Backed out changeset 913d6bd82284 (bug 1572337)
2019-11-07 16:37:00 +02:00
Randell Jesup
95be6cffe0 Bug 1572337: Remove old responsiveness profiler measurement r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D44060

--HG--
extra : moz-landing-system : lando
2019-11-07 12:53:35 +00:00
Toshihito Kikuchi
c277593b98 Bug 1587539 - Skip bounds check when getting IAT if Import Directory is tampered. r=aklotz
Some applications tamper Import Directory entry of a loaded executable image
to pretend static dependency on their module.  We have `RestoreImportDirectory`
to revert it in the browser process.  If tampering happened in the launcher
process, however, we failed to get an IAT thunk address via `GetIATThunksForModule`
because it could be located outside the mapped image.

With this patch, we skip bounds check in `GetIATThunksForModule` if we detect
tampering in the launcher process.  We can proceed safely because it's expected
that Import Directory is still valid though it's located outside.

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

--HG--
extra : moz-landing-system : lando
2019-11-06 21:54:55 +00:00
Toshihito Kikuchi
141244d0f5 Bug 1318858 - Block Digital Guardian's module which crashes Firefox. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D51192

--HG--
extra : moz-landing-system : lando
2019-11-04 21:58:36 +00:00
Gerald Squelart
1824e6f651 Bug 1584190 - In JSON profile, counters' sample_groups should be an array of objects - r=canaltinova
profile.counters[n].sample_groups was mistakenly streamed as an object, which
prevents having more than one, and goes against the published format
documentation.

The front-end was implemented to process the incorrect format, so it will need
to be updated as well; hence the version change to 18.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 22:20:06 +00:00
Aaron Klotz
b3407dccf1 Bug 1592120: Add flag to Authenticode::GetBinaryOrgName to skip trust verification and use it in untrusted modules processing; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D50862

--HG--
extra : moz-landing-system : lando
2019-10-28 21:58:49 +00:00
Gabriele Svelto
aae539c2f2 Bug 1566109 - Add SolidWorks DLL to the blocklist; r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D50437

--HG--
extra : moz-landing-system : lando
2019-10-24 22:08:24 +00:00
Christian Holler
e5a22220fd Bug 1590423 - Suppress races related to Rust std::sync::Arc. r=jseward
Differential Revision: https://phabricator.services.mozilla.com/D50078

--HG--
extra : moz-landing-system : lando
2019-10-23 10:02:14 +00:00
Christian Holler
2d9d1fdf77 Bug 1587463 - Use builtin suppression lists for LSan and TSan. r=jseward
Differential Revision: https://phabricator.services.mozilla.com/D48786

--HG--
extra : moz-landing-system : lando
2019-10-16 16:09:21 +00:00
Gabriele Svelto
850ac9c631 Bug 1579758 - Block a nightly build of OpenSC which crashes Firefox; r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D48296

--HG--
extra : moz-landing-system : lando
2019-10-13 04:20:45 +00:00
Geoff Brown
3dbb203a84 Bug 1558885 - Use separate directory for android gtest libxul; r=bc,nalexander
In Android gtest, instead of pushing the gtest libxul.so to the
(assumed and potentially incorrect) location of the test application's
libraries, push libxul.so to /data/local/gtest, and direct the linker
to use that instead.

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

--HG--
extra : moz-landing-system : lando
2019-10-10 21:38:01 +00:00
Gerald Squelart
d24177fe2a Bug 1587332 - Encapsulate ActivePS::mProfileBuffer as a ProfileBuffer value - r=canaltinova
Having `mProfileBuffer` be a pointer is not really helpful:
- The pointer is never null (It's allocated on ActivePS construction, and
  implicitly deleted on ActivePS destruction); it's never moved-from.
- It requires an extra `new` and an extra `delete`.

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

--HG--
extra : moz-landing-system : lando
2019-10-10 10:52:09 +00:00
Gerald Squelart
dff1750481 Bug 1587329 - MOZ_ASSERT(sInstance) in all functions that dereference sInstance - r=canaltinova
Add assertions that all `sInstance` pointers (from both `CorePS` and `ActivePS`)
are not null before being dereferenced.

This is probably more than needed, but it's only `MOZ_ASSERT`s limited to
Nightly, and it should give better feedback in case something goes wrong.

Eventually, I think it would be better to make most methods non-static, and have
a checked reference-to-instance getter.

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

--HG--
extra : moz-landing-system : lando
2019-10-10 10:51:50 +00:00
Nazım Can Altınova
2e832289ac Bug 1512500 - Record parent page information in profiler r=gerald,nika
Differential Revision: https://phabricator.services.mozilla.com/D47426

--HG--
extra : moz-landing-system : lando
2019-10-09 21:25:19 +00:00
Nazım Can Altınova
6379b166c1 Bug 1583271 - Part 3: Remove the disabled assertion and add a mechanism to capture the first non-auto:blank frame r=nika
We are not simply excluding all about:blanks because there might be some
about:blank that user really visits. But for others we don't want to include
the first about:blank because when a BrowsingContext is loaded, and if the
principal matches, the first document loaded in it will share the inner window.

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

--HG--
extra : moz-landing-system : lando
2019-10-09 20:58:06 +00:00
Nazım Can Altınova
20fc64e558 Bug 1583271 - Part 1: Change profiler page information IDs to BrowsingContextID and InnerWindowID r=gerald,nika
We were keeping nsDocShell::mHistoryId and nsDocShell::mOSHE as keys. They
weren't quite good because:
1. While loading an iframe, they were being registered twice with the same
ids(for about:blank and the real URL) sometimes.
2. It wasn't possible to access to the parent mHistoryId and mOSHE from a child
processes if the parent is in a different process. That may not be the case for
now, but it will be after fission.
So we had to find other IDs to:
1. Determine the Tab of the frames.
2. Determine the URLs of the frames.
For the first use case, we were using nsDocShell::mHistoryId for that purpose
but that was wrong. The closest thing that we can get to a tab ID is
BrowsingContext ID because they don't change after a navigation. But iframes
have different BrowsingContext's, so we still need to create a tree to
construct a tab content. That can be either in the front-end or capture time.
For the second use case, we were using a key pair of mHistoryId and mOSHE. We
now chose to keep inner window IDs for that purpose. Inner window IDs are
unique for each navigation loads because inner window correspond to each JS
window global objects. That's why we can use that without any problem. But one
problem is that we cannot handle `history.pushState` and `history.replaceState`
changes with that change since window global objects won't change during those.
But that was the best thing we can do after fission. So this will be a small
sacrifice for us to keep that functionality working after fission.
In that patch we also remove the registration/unregistration calls. We are
going to add those calls in the next patch.

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

--HG--
extra : moz-landing-system : lando
2019-10-09 21:25:11 +00:00
Sylvestre Ledru
f12b9fa5c3 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-10-06 18:29:55 +00:00
Gerald Squelart
499b5db10f Bug 1583868 - New profiler feature "nostacksampling" - r=gregtatum
Previously, the absence of "stackwalk", "leaf", and "javascript" implied that
the test/user didn't want any sampling, but this caused issues in some tests
that enabled "stackwalk" on platforms that didn't support stack-walking, which
ended up suppressing label-only stacks that the test expected.

we now have an explicit feature "nostacksampling" that disables backtraces from
the samplers in both profilers. This effectively cancels "stackwalk", "leaf",
and "javascript" if present.

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

--HG--
extra : moz-landing-system : lando
2019-10-01 22:49:13 +00:00
Brindusan Cristian
79e9f1a034 Backed out changeset 8989d1a83de8 (bug 1583868) for xpcshell failures at test_ext_geckoProfiler_schema.js. CLOSED TREE 2019-10-01 22:27:11 +03:00
Gerald Squelart
fa7dc1a809 Bug 1583868 - New profiler feature "nostacksampling" - r=gregtatum
Previously, the absence of "stackwalk", "leaf", and "javascript" implied that
the test/user didn't want any sampling, but this caused issues in some tests
that enabled "stackwalk" on platforms that didn't support stack-walking, which
ended up suppressing label-only stacks that the test expected.

we now have an explicit feature "nostacksampling" that disables backtraces from
the samplers in both profilers. This effectively cancels "stackwalk", "leaf",
and "javascript" if present.

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

--HG--
extra : moz-landing-system : lando
2019-10-01 14:00:21 +00:00
Aaron Klotz
d1c0cbeb08 Bug 1584571: Fix DLL blocklist entries for oly*.dll to use the correct condition; r=mhowell
I also fixed a couple of typos in comments in the python script that didn't
seem to warrant their own bug.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 18:07:20 +00:00
kriswright
ddd0133b2a Bug 1572238 - Dump assertion stacks using __android_log_print. r=Ehsan
Defines an android-only version of nsTraceRefcnt::WalkTheStack that takes a function callback, which outputs the stack frame buffer to `__android_log_print`. Also uses `__wrap_dladdr` in MozDescribeCodeAddress, which outputs slightly more informative data for the stack trace (instead of instances of '???/??? [???]').

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

--HG--
extra : moz-landing-system : lando
2019-09-24 20:50:41 +00:00
Tyson Smith
d9bce5f0fe Bug 1581656 - Fix default UBSAN_OPTIONS. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D46970

--HG--
extra : moz-landing-system : lando
2019-09-24 17:52:11 +00:00
Bogdan Tara
e4913f5aeb Backed out changeset 88334e3a605e (bug 1572238) for causing windows 2012 bustages CLOSED TREE 2019-09-24 21:57:56 +03:00
kriswright
9ac396cf78 Bug 1572238 - Dump assertion stacks using __android_log_print. r=Ehsan
Defines an android-only version of nsTraceRefcnt::WalkTheStack that takes a function callback, which outputs the stack frame buffer to `__android_log_print`. Also uses `__wrap_dladdr` in MozDescribeCodeAddress, which outputs slightly more informative data for the stack trace (instead of instances of '???/??? [???]').

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

--HG--
extra : moz-landing-system : lando
2019-09-24 12:14:24 +00:00
Aaron Klotz
edafb91e6b Bug 1583417: Remove assertion that may fire spuriously due to racy condition; r=mhowell
This assertion could fire if the profiler state changes between beginning and
ending a DLL load. That's less than ideal, so let's just get rid of it.

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

--HG--
extra : moz-landing-system : lando
2019-09-24 14:53:23 +00:00
Gerald Squelart
16dbd4f365 Bug 1582992 - Removed unneded BlocksRingBuffer's entry destructor, and ProfilerBuffer's JS::AutoSuppressGCAnalysis - r=gregtatum
`BlocksRingBuffer` had an "entry destructor" to make it a more generic
container, and it was useful during early prototyping of the new profiler
storage (so that we could store owning pointers).
But this entry destructor is stored in an `std::function`, which gets marked as
a potential GC caller by the js rooting hazard analyzer; and as this bug found,
it's not obvious where to place `JS::AutoSuppressGCAnalysis`, because profiler
entries (including stacks) could be added on one thread while GC happens
elsewhere, which triggers the embedded `AutoAssertNoGC` check.

Since we don't actually use the entry destructor facility in the profiler, it's
easier to just get rid of it. As a bonus, it's a small optimization.
Tests that were using an entry destructor now use the `State` instead, to verify
that entries are pushed and cleared as expected.

If needed in the future outside of the profiler, `BlocksRingBuffer` could again
include an entry destructor, but it would have to be through templating, so that
the class used in the profiler wouldn't contain an `std::function`.

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

--HG--
extra : moz-landing-system : lando
2019-09-23 20:50:20 +00:00
Aaron Klotz
fccd6eb9ba 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.

Depends on D43157

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 : browser/app/winlauncher/freestanding/LoaderAPIInterfaces.h => mozglue/dllservices/LoaderAPIInterfaces.h
rename : browser/app/winlauncher/freestanding/ModuleLoadInfo.h => mozglue/dllservices/ModuleLoadInfo.h
rename : browser/app/winlauncher/NtLoaderAPI.h => mozglue/dllservices/NtLoaderAPI.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
2019-09-23 20:18:41 +00:00
Aaron Klotz
c27d5345fc Bug 1542830: Part 1 - Updates to NativeNt.h; r=mhowell
This patch adds the following:

* The `AllocatedUnicodeString` class which encapsulates a `UNICODE_STRING` and
  owns its buffer. The buffers are null-terminated so that they may be used as
  C-style strings without modification.
** We do not allow either creation or copying within XUL
* `RtlGetCurrentThreadId` and a test to validate it, so that we may obtain the
  current thread ID directly from the `TEB` when we do not yet have access to
  kernel32.
* An implementation of `SRWLock` that uses Rtl instead of Win32 so that we may
  use them before we have access to Win32 DLLs.
* A memory allocation policy that uses Rtl heap functions so that we may use
  MFBT `Vector` in code that might not yet have access to Win32 heap functions.

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

--HG--
extra : moz-landing-system : lando
2019-09-23 20:16:51 +00:00
philipp
e517ca80d9 Bug 1576728 - Add crashing dlls from chinese unzipping tools to the blocklist. r=aklotz
--HG--
extra : rebase_source : b8eda4974164e350fa6e1df9bcf79c5f9baa966a
2019-09-23 21:19:02 +03: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
8d1be668f6 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
2019-09-20 19:43:33 +00:00
Aaron Klotz
f5081e7b43 Bug 1542830: Part 1 - Updates to NativeNt.h; r=mhowell
This patch adds the following:

* The `AllocatedUnicodeString` class which encapsulates a `UNICODE_STRING` and
  owns its buffer. The buffers are null-terminated so that they may be used as
  C-style strings without modification.
** We do not allow either creation or copying within XUL
* `RtlGetCurrentThreadId` and a test to validate it, so that we may obtain the
  current thread ID directly from the `TEB` when we do not yet have access to
  kernel32.
* An implementation of `SRWLock` that uses Rtl instead of Win32 so that we may
  use them before we have access to Win32 DLLs.
* A memory allocation policy that uses Rtl heap functions so that we may use
  MFBT `Vector` in code that might not yet have access to Win32 heap functions.

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

--HG--
extra : moz-landing-system : lando
2019-09-20 19:42:40 +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
12843d81e9 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
2019-09-20 17:00:14 +00:00
Aaron Klotz
57df2b6a01 Bug 1542830: Part 1 - Updates to NativeNt.h; r=mhowell
This patch adds the following:

* The `AllocatedUnicodeString` class which encapsulates a `UNICODE_STRING` and
  owns its buffer. The buffers are null-terminated so that they may be used as
  C-style strings without modification.
** We do not allow either creation or copying within XUL
* `RtlGetCurrentThreadId` and a test to validate it, so that we may obtain the
  current thread ID directly from the `TEB` when we do not yet have access to
  kernel32.
* An implementation of `SRWLock` that uses Rtl instead of Win32 so that we may
  use them before we have access to Win32 DLLs.
* A memory allocation policy that uses Rtl heap functions so that we may use
  MFBT `Vector` in code that might not yet have access to Win32 heap functions.

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

--HG--
extra : moz-landing-system : lando
2019-09-20 16:59:28 +00:00
Aaron Klotz
38e11b4896 Bug 1582776: Change cross-process stub to not store remote stub pointer in local mOrigFunc; r=handyman
This is showing up with hooks that are set both by the launcher process and by
the browser process when starting early DLL blocklist init on content processes:

* The browser's copy of mOrigFunc was set by the launcher process.
* The browser is setting a hook in the new child process, which writes to the
  child's mOrigFunc.
* But FuncHookCrossProcess also writes that pointer to the browser's mOrigFunc,
  thus corrupting the browser process's copy of the pointer.

For in-process hooks, we want to immediately write the stub pointer to its final
location; this is not an issue for cross-process hooks since the child process
is suspended when we do this and the parent process can't call the stub; there
is no possibility of a race.

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

--HG--
extra : moz-landing-system : lando
2019-09-20 16:55:27 +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
6c7b43b9c8 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
2019-09-20 00:09:41 +00:00
Aaron Klotz
f3b16f06a4 Bug 1542830: Part 1 - Updates to NativeNt.h; r=mhowell
This patch adds the following:

* The `AllocatedUnicodeString` class which encapsulates a `UNICODE_STRING` and
  owns its buffer. The buffers are null-terminated so that they may be used as
  C-style strings without modification.
** We do not allow either creation or copying within XUL
* `RtlGetCurrentThreadId` and a test to validate it, so that we may obtain the
  current thread ID directly from the `TEB` when we do not yet have access to
  kernel32.
* An implementation of `SRWLock` that uses Rtl instead of Win32 so that we may
  use them before we have access to Win32 DLLs.
* A memory allocation policy that uses Rtl heap functions so that we may use
  MFBT `Vector` in code that might not yet have access to Win32 heap functions.

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

--HG--
extra : moz-landing-system : lando
2019-09-20 00:09:33 +00:00
Gerald Squelart
1549c7e36e Bug 1582357 - Allow profiler entries up to the size of the buffer - r=gregtatum
In some situations, entries may in fact take more than half the buffer size
(e.g., when duplicating a stack into a small temporary buffer).
So we now allow blocks to take the full buffer size -- but not more, as they
would start overwriting themselves!

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

--HG--
extra : moz-landing-system : lando
2019-09-19 13:40:01 +00:00