Commit Graph

7106 Commits

Author SHA1 Message Date
smolnar
7d35618a19 Backed out changeset 8e304bf129b7 (bug 1758055) for causing build bustages in nsISupportsImpl CLOSED TREE 2022-06-23 17:08:04 +03:00
Jari Jalkanen
8ded57a34e Bug 1758055 - Establish file system content and parent process IPC. r=janv,dom-storage-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D140486
2022-06-23 12:24:57 +00:00
Iulian Moraru
672f2cb672 Backed out 3 changesets (bug 1731778) for causing COEP related failures on embedding.tentative.https.window.html.
Backed out changeset c30f5751d54c (bug 1731778)
Backed out changeset 0eec19308453 (bug 1731778)
Backed out changeset 7c14fa8a4804 (bug 1731778)
2022-06-22 22:00:17 +03:00
Sean Feng
80b0c0f55b Bug 1731778 - Implement COEP: credentialless r=smaug,necko-reviewers,kershaw
Spec: https://html.spec.whatwg.org/multipage/#coep:coep-credentialless

Credentialless is a new cross-origin embedder policy which allows us
to not enforcing CORP when loading cross-origin resources while
providing SharedArrayBuffer.

There are two main things involved here:
  1. Fetching cross-origin no-CORS resources omits credentials
     - This is done by applying `LOAD_ANONYMOUS` flag to the request
  2. Other requests sent with credentials require the server's explicit
  permission through the CORS protocol or the CORS header
     - This is done by expanding `ProcessCrossOriginResourcePolicyHeader`
     function to apply the necessary checks.

Differential Revision: https://phabricator.services.mozilla.com/D147802
2022-06-22 13:13:39 +00:00
Manuel Bucher
1585146833 no bug - Fix indentation of bullet list in ipdl document DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D149969
2022-06-22 09:52:06 +00:00
Narcis Beleuzu
9e3db37db1 Backed out 2 changesets (bug 1731778) for wpt failures on embedding.tentative.https.window.html . CLOSED TREE
Backed out changeset 2510b654e8f2 (bug 1731778)
Backed out changeset fea9b21d8efe (bug 1731778)
2022-06-21 19:13:32 +03:00
Sean Feng
413fe3115c Bug 1731778 - Implement COEP: credentialless r=smaug,necko-reviewers,kershaw
Spec: https://html.spec.whatwg.org/multipage/#coep:coep-credentialless

Credentialless is a new cross-origin embedder policy which allows us
to not enforcing CORP when loading cross-origin resources while
providing SharedArrayBuffer.

There are two main things involved here:
  1. Fetching cross-origin no-CORS resources omits credentials
     - This is done by applying `LOAD_ANONYMOUS` flag to the request
  2. Other requests sent with credentials require the server's explicit
  permission through the CORS protocol or the CORS header
     - This is done by expanding `ProcessCrossOriginResourcePolicyHeader`
     function to apply the necessary checks.

Differential Revision: https://phabricator.services.mozilla.com/D147802
2022-06-21 13:56:52 +00:00
Jens Stutte
79586c0534 Bug 1775112 - Remove obsolete MessageChannel::Begin/StopPostponingSends feature. r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D149775
2022-06-21 06:18:31 +00:00
Jens Stutte
3dab700e29 Bug 1775076 - Reduce shutdown log verbosity of IdleSchedulerChild r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D149752
2022-06-20 12:55:12 +00:00
Jed Davis
c807158580 Bug 1770905 - Allow GeckoMediaPlugin processes on Linux to be profiled if memfd_create is available. r=gcp,mstange,media-playback-reviewers,padenot
There are two parts to this patch; both affect only Linux:

1. The GMP sandbox policy is adjusted to allow certain syscalls used in
   shared memory creation (ftruncate and fallocate).  However, the file
   broker is not used; the process still has no access to files in /dev/shm.

2. The profiler is not initialized for GMP processes unless memfd_create
   is available (so the process can create shared memory to send
   profiling data back, without filesystem access), or the GMP sandbox
   is disabled (either at runtime or build time).

As of this patch, profiling GMP processes on Linux should succeed on
distros with kernel >=3.17 (Oct. 2014), but native stack frames won't
have symbols (and may be incorrectly unwound, not that it matters much
without symbols); see the bug for more info.  Pseudo-stack frames and
markers should work, however.

Differential Revision: https://phabricator.services.mozilla.com/D148470
2022-06-15 20:55:24 +00:00
Sylvestre Ledru
42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Haik Aftandilian
94ba599969 Bug 1562756 - Code Injection in Firefox macOS desktop r=spohl
Drop the com.apple.security.cs.allow-dyld-environment-variables entitlement to disallow use of dyld environment variables in signed production builds.

Leave the entitlement in for signed developer builds.

Firefox gtests depend on the use of DYLD_LIBRARY_PATH. However, testing infrastructure does not run gtests on signed builds and therefore gtests are not impacted by this change. gtests could be run on signed developer builds in the future which will still allow dyld environment variables after this change.

browser.production.entitlements.xml and plugin-container.production.entitlements.xml are not used, but being kept up to date.

Differential Revision: https://phabricator.services.mozilla.com/D148324
2022-06-06 16:42:02 +00:00
Haik Aftandilian
4591ba72b4 Bug 1770484 - Make Mac processes not depend on DYLD_LIBRARY_PATH to load libraries r=glandium,gsvelto,mac-reviewers,necko-reviewers,dragana,spohl
Change XUL and other dylibs to be built with an @rpath/<dylib> install name (LC_ID_DYLIB) instead of @executable_path/<dylib>.

Change executables to be built with an @rpath dyld search path set to @executable_path by default so that @rpath/<dylib> dylibs in the same directory can be resolved. For executables not in the same directory as @rpath dylibs, such as plugin-container, set a relative @rpath such as @executable_path/../../../.

Previously, dylib install names were set as @executable_path/<dylib> allowing them to be resolved by dyld for the loading executable if the executable resided in the same directory as the dylib. For executables not in the same directory as the dylibs, dyld resolved these dylibs using DYLD_LIBRARY_PATH set before launching the process by Firefox code. With this change, loading does not rely on DYLD environment variables. Instead, dylibs have an install name set as @rpath/<dylib> and each executable loading a dylib has its @rpath set at compile-time to refer to dylib directory.

Differential Revision: https://phabricator.services.mozilla.com/D147360
2022-06-03 21:14:01 +00:00
ssengupta
ee2494ee39 Bug 1636050 - PCache protocol is now refcounted r=hsingh
Differential Revision: https://phabricator.services.mozilla.com/D85774
2022-06-03 08:58:30 +00:00
Nika Layzell
d65dcbe321 Bug 1743020 - Part 4: Use MoveOnlyFunction in DataPipe, r=ipc-reviewers,mccr8
This is mostly a simple use-case for the type which I was aware of and
could use to ensure it builds correctly.

Differential Revision: https://phabricator.services.mozilla.com/D145692
2022-06-02 13:24:10 +00:00
Nika Layzell
fc7c1048de Bug 1771234 - Make it easier to use a specific serial event target when binding an actor, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D147381
2022-06-01 14:35:16 +00:00
James Teh
8cda799e04 Bug 1756728 part 3: Remove now unused PDocAccessible::URL. r=morgan,ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D147718
2022-06-01 00:34:18 +00:00
Alexandre Lissy
da51fede3d Bug 1771416 - Disable utility audio tests on Android Isolated Process r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D147491
2022-05-27 19:08:48 +00:00
Alexandre Lissy
35c2287eb6 Bug 1767930 - Test for Utility AudioDecoder on Android r=alwu,jolin
Differential Revision: https://phabricator.services.mozilla.com/D145896
2022-05-26 23:00:08 +00:00
Alexandre Lissy
c53de97817 Bug 1767930 - Enable Utility AudioDecoder for Android r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D145785
2022-05-26 23:00:07 +00:00
Nika Layzell
d32f90fe46 Bug 1769593 - Part 2: Improve reporting of fatal DataPipe (de)serialization errors, r=jld
Depends on D146501

Differential Revision: https://phabricator.services.mozilla.com/D146502
2022-05-26 20:16:09 +00:00
Nika Layzell
cefa79c10e Bug 1769593 - Part 1: Fail when serializing file handles in excess of MAX_DESCRIPTORS_PER_MESSAGE, r=jld
Differential Revision: https://phabricator.services.mozilla.com/D146501
2022-05-26 20:16:09 +00:00
Alexandre Lissy
ed32e3d443 Bug 1770241 - Move SetThisProcessName() to avoid risky GetCurrentProcess() r=haik
Differential Revision: https://phabricator.services.mozilla.com/D146964
2022-05-25 20:59:32 +00:00
Nika Layzell
36b38fb3c0 Bug 1767514 - Part 3: Retry sending fds if sendmsg fails, r=ipc-reviewers,jld
Before this change, we wouldn't re-try sending fds if the first attempt
to send them failed, meaning that some fds wouldn't arrive if there was
any error sending (e.g. because the send buffer was full, which
is more common on macOS).

This new approach ensures we don't record that we've sent the fds until
the message is marked as successful, and should avoid the macOS errors.

Depends on D145392

Differential Revision: https://phabricator.services.mozilla.com/D146621
2022-05-24 14:41:11 +00:00
Nika Layzell
39f1df8386 Bug 1767514 - Part 2: Increase the attached handle limit for IPC Messages, r=ipc-reviewers,jld
This is made possible by part 1, which made it possible to send more messages
using IPC::Channel. A limit is still in place, however it is now substantially
higher, hopefully making it effectively unlimited for practical purposes.

Differential Revision: https://phabricator.services.mozilla.com/D145392
2022-05-24 14:41:10 +00:00
Nika Layzell
2a7c5cf9a5 Bug 1767514 - Part 1: Decouple the IPC::Message max handle count and the number of FDs supported by IPC::Channel, r=ipc-reviewers,jld
This is done by splitting messages with large numbers of handles into multiple
`sendmsg` calls, each of which contains less than the maximum number of
transferred handles per-message, and stitching the message back together on the
receiving side. Most of the work on the receiving side was already handled by
the IPC::Channel code, so the work required was only to ensure we could split
the handle list up when sending.

Differential Revision: https://phabricator.services.mozilla.com/D145391
2022-05-24 14:41:10 +00:00
Jan Varga
ba2d77a450 Bug 1759993 - QM: Introduce QM_IPC_FAIL macro; r=ipc-reviewers,mccr8,hsingh
Differential Revision: https://phabricator.services.mozilla.com/D141336
2022-05-24 14:39:13 +00:00
Tim Huang
bebf6a1109 Bug 1768193 - Part 1: Use maybe to hold mIsThirdPartyContextToTopWindow in LoadInfo. r=anti-tracking-reviewers,necko-reviewers,bvandersloot,kershaw
In order to know if the mIsThirdPartyContextToTopWindow was set in the
loadInfo of the channel, we use maybe to hold the value. So, we can know
if it was set before.

This patch also addes two methods in LoadInfo to clear and know if the
value is set.

Differential Revision: https://phabricator.services.mozilla.com/D146491
2022-05-24 08:17:28 +00:00
Bob Owen
b48aea26d9 Bug 1769845 p1: Use command line to pass whether win32k is locked down in policy. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D146930
2022-05-23 07:53:41 +00:00
Chris Martin
0549e90cbb Bug 1769807 - Ensure Win32k state initialized before content launch. r=nalexander
Win32k Lockdown state must be initialized on the main thread, but currently
a process launcher may be the first thing to read it on the IPC Thread

Initializing Win32k Lockdown state also relies on the gfxPlatform being
initialized, but that also isn't explicit anywhere.

This patch ensures both things are true: Always ensure that Win32k State is
initialized before queuing a process launch to the IPC Thread, and always
ensure that gfxPlatform is initialized before attempting to read the
gfx state.

Differential Revision: https://phabricator.services.mozilla.com/D146821
2022-05-20 20:55:05 +00:00
Cristian Tuns
b9179e443b Backed out changeset 9dc2f0c648e4 (bug 1769807) for causing mochitest failures on browser_xpcom_graph_wait.js CLOSED TREE 2022-05-20 14:01:26 -04:00
Chris Martin
4ef19ac392 Bug 1769807 - Ensure Win32k state initialized before content launch r=bobowen,nalexander
Win32k Lockdown state must be initialized on the main thread, but currently
a process launcher may be the first thing to read it on the IPC Thread

Initializing Win32k Lockdown state also relies on the gfxPlatform being
initialized, but that also isn't explicit anywhere.

This patch ensures both things are true: Always ensure that Win32k State is
initialized before queuing a process launch to the IPC Thread, and always
ensure that gfxPlatform is initialized before attempting to read the
gfx state.

Differential Revision: https://phabricator.services.mozilla.com/D146821
2022-05-20 17:12:36 +00:00
Alexandre Lissy
cd689b44aa Bug 1769033 - Add OpenBSD sandboxing support r=gaston
Differential Revision: https://phabricator.services.mozilla.com/D146568
2022-05-20 08:25:04 +00:00
Alexandre Lissy
2455fdcc08 Bug 1769624 - Verify shutdown status before asserting r=nika
Differential Revision: https://phabricator.services.mozilla.com/D146567
2022-05-19 23:50:57 +00:00
Marian-Vasile Laza
17f3ff6ecd Backed out changeset 0afbb1e34fe3 (bug 1769807) for causing bc failures on browser_xpcom_graph_wait.js. CLOSED TREE 2022-05-19 22:41:30 +03:00
Jed Davis
73a294a2b8 Bug 1769182 - Allow the RDD process to use EGL under X11 on Linux. r=gcp
This patch mostly turns on the features set up by the earlier patches:
allow connecting to the X server and reading various related things
(.Xauthority, GPU device info in sysfs, etc.).  It also turns off Mesa's
shader cache in the RDD process; that shouldn't be needed here, and
disabling it lets us avoid dealing with a few things in the sandbox
policy that we'd rather not (e.g., `getpwuid`).

Differential Revision: https://phabricator.services.mozilla.com/D146275
2022-05-19 17:02:33 +00:00
Chris Martin
2990ca00d8 Bug 1769807 - Ensure Win32k state initialized before content launch r=bobowen
Win32k Lockdown state must be initialized on the main thread, but currently
a process launcher may be the first thing to read it on the IPC Thread

Initializing Win32k Lockdown state also relies on the gfxPlatform being
initialized, but that also isn't explicit anywhere.

This patch ensures both things are true: Always ensure that Win32k State is
initialized before queuing a process launch to the IPC Thread, and always
ensure that gfxPlatform is initialized before attempting to read the
gfx state.

Differential Revision: https://phabricator.services.mozilla.com/D146821
2022-05-19 15:51:12 +00:00
Butkovits Atila
160c12d050 Backed out changeset 7b69c225f7c7 (bug 1769624) because the patch is not ready yet. CLOSED TREE 2022-05-18 01:40:17 +03:00
Alexandre Lissy
9ba8c615d5 Bug 1769624 - Verify shutdown status before asserting r=nika
Differential Revision: https://phabricator.services.mozilla.com/D146567
2022-05-17 20:44:24 +00:00
Andrew McCreight
fa8bfd1245 Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D146457
2022-05-17 20:24:19 +00:00
Alexandre Lissy
2be35f16d6 Bug 1769547 - Do not MOZ_CRASH() on missing process r=nika
Differential Revision: https://phabricator.services.mozilla.com/D146462
2022-05-16 17:02:44 +00:00
Alexandre Lissy
6330ec5e08 Bug 1767582 - Enable Utility AudioDecoder on Nightly r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D145584
2022-05-16 11:07:26 +00:00
Molnar Sandor
74e42d0f2f Backed out 5 changesets (bug 1743020) for causing linux build bustages in function2.hpp CLOSED TREE
Backed out changeset cf237471cf75 (bug 1743020)
Backed out changeset 78eb51447ce5 (bug 1743020)
Backed out changeset c486f95d55ec (bug 1743020)
Backed out changeset c0abfda55404 (bug 1743020)
Backed out changeset 16be18ca73fb (bug 1743020)
2022-05-14 10:31:12 +03:00
Iulian Moraru
cf3fad08ff Backed out 5 changesets (bug 1769182) for causing mochitest failures on browser_sandbox_test.js. CLOSED TREE
Backed out changeset f5b71a28f28b (bug 1769182)
Backed out changeset 7a64faec004f (bug 1769182)
Backed out changeset c7833370362a (bug 1769182)
Backed out changeset b91adae9bb59 (bug 1769182)
Backed out changeset cf7bb9b7414d (bug 1769182)
2022-05-14 05:20:37 +03:00
Jed Davis
accee09e1b Bug 1769182 - Allow the RDD process to use EGL under X11 on Linux. r=gcp
This patch mostly turns on the features set up by the earlier patches:
allow connecting to the X server and reading various related things
(.Xauthority, GPU device info in sysfs, etc.).  It also turns off Mesa's
shader cache in the RDD process; that shouldn't be needed here, and
disabling it lets us avoid dealing with a few things in the sandbox
policy that we'd rather not (e.g., `getpwuid`).

Differential Revision: https://phabricator.services.mozilla.com/D146275
2022-05-14 00:42:56 +00:00
Nika Layzell
a035fb975b Bug 1743020 - Part 4: Use MoveOnlyFunction in DataPipe, r=ipc-reviewers,mccr8
This is mostly a simple use-case for the type which I was aware of and
could use to ensure it builds correctly.

Differential Revision: https://phabricator.services.mozilla.com/D145692
2022-05-13 23:43:53 +00:00
Alexandre Lissy
dbf185ac34 Bug 1768411 - Test Utility AudioDecoder crash recovery r=alwu,nika
Differential Revision: https://phabricator.services.mozilla.com/D146100
2022-05-13 18:47:28 +00:00
Nika Layzell
1aa11ffed6 Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw
As serializing IPCStream no longer requires a manager or FileDescriptor array,
the arguments are no longer necessary, and can be removed. The AutoIPCStream
helper can also be removed, as managed actors are no longer used for
serialization, so a delayed start callback is not necessary.

The delayed start parameter is also removed from nsIIPCSerializableInputStream
instances, but is still present as `aAllowLazy` on the toplevel serialization
methods.

Differential Revision: https://phabricator.services.mozilla.com/D141048
2022-05-13 14:16:13 +00:00
Nika Layzell
4c0787e66e Bug 1754004 - Part 6: Preserve MIME information when serializing a lazy stream, r=asuth,necko-reviewers,dragana
the nsIMIMEInputStream type contains extra metadata header information
which shouldn't be lost when serializing the type over IPC. This patch
changes the LazyStream serialization to take this into account and only
serialize the value within the nsMIMEInputStream when sending a lazy
stream over IPC.

This information is specifically used by HTTP channels in order to
populate POST request headers.

Differential Revision: https://phabricator.services.mozilla.com/D141043
2022-05-13 14:16:11 +00:00
Nika Layzell
95a883d65d Bug 1754004 - Part 3: Move RemoteLazyInputStream to its own toplevel protocol, r=asuth,necko-reviewers,dragana
This is a complete rewrite of RemoteLazyInputStream to run off of its own
toplevel protocol, rather than being managed by other protocols like
PBackground or PContent. This should improve performance thanks to no longer
needing to operate on a main or worker thread, and due to no longer needing the
migration step for the stream actor.

This also acts as a step towards no longer requiring a manager actor to
serialize input streams, as the type is now actor-agnostic, and should support
being sent over IPC between any pair of processes.

Differential Revision: https://phabricator.services.mozilla.com/D141040
2022-05-13 14:16:10 +00:00