Commit Graph

6715 Commits

Author SHA1 Message Date
Nika Layzell
ab32545d5a Bug 1741152 - Add diagnostic warnings to process launch codepaths, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D131419
2021-11-17 22:19:13 +00:00
Andrew McCreight
484cac8a89 Bug 1707642 - Increase message size limit in fuzzing builds. r=ipc-reviewers,nika
If the limit is small, then the fuzzers hit crashes in various places when
passing in large data structures to DOM APIs, so increase the limit.

Differential Revision: https://phabricator.services.mozilla.com/D130890
2021-11-11 18:00:02 +00:00
Andrew McCreight
5c16837860 Bug 1740529 - Log the PID of the process we're waiting on in WillDestroyCurrentMessageLoop(). r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D130889
2021-11-11 00:19:20 +00:00
Marian-Vasile Laza
133cd29435 Backed out 2 changesets (bug 1712837) for causing mochitest and marionette test failures. CLOSED TREE
Backed out changeset ecfd23a7ef69 (bug 1712837)
Backed out changeset 51529cb4682e (bug 1712837)
2021-11-11 01:52:57 +02:00
Dana Keeler
15ebcb5e82 Bug 1712837 - introduce ipcclientcerts to allow client certificates to work with the socket process r=rmf,kershaw,necko-reviewers,ipc-reviewers,nika
This patch introduces ipcclientcerts, a PKCS#11 module that the socket process
can load to get access to client certificates and keys managed by the parent
process. This enables client certificate authentication to work with the socket
process (particularly for keys stored outside of NSS, as with osclientcerts or
third-party PKCS#11 modules).

Differential Revision: https://phabricator.services.mozilla.com/D122392
2021-11-10 21:48:47 +00:00
Nika Layzell
0d9a71dc85 Bug 1740596 - Include more details in IPDL warnings, r=ipc-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D130923
2021-11-10 21:48:22 +00:00
Marian-Vasile Laza
948f23ed24 Backed out changeset c667e28154b6 (bug 1707642) for causing build bustages on MessageLink.cpp. CLOSED TREES 2021-11-10 22:26:37 +02:00
Andrew McCreight
75a68d0785 Bug 1707642 - Increase message size limit in fuzzing builds. r=ipc-reviewers,nika
If the limit is small, then the fuzzers hit crashes in various places when
passing in large data structures to DOM APIs, so increase the limit.

Differential Revision: https://phabricator.services.mozilla.com/D130890
2021-11-10 17:59:24 +00:00
Nika Layzell
713c899320 Bug 1732343 - Part 10: Remove the now-unused ipc::DuplicateHandle, r=handyman
This should unblock removing support for BrokerDuplicateHandle from our fork of
the chromium sandboxing code.

Differential Revision: https://phabricator.services.mozilla.com/D126572
2021-11-09 14:17:35 +00:00
Nika Layzell
f3e5fa0fee Bug 1732343 - Part 7: Use attached handles for Windows CrossProcess{Mutex,Semaphore} serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126569
2021-11-09 14:17:34 +00:00
Nika Layzell
71d0301a3c Bug 1732343 - Part 6: Use attached handles for Windows TransportDescriptor serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126568
2021-11-09 14:17:34 +00:00
Nika Layzell
4bf7ce347c Bug 1732343 - Part 5: Use attached handles for Windows SharedMemory serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126567
2021-11-09 14:17:33 +00:00
Nika Layzell
95cdfbabee Bug 1732343 - Part 4: Use attached handles for Windows FileDescriptor serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126566
2021-11-09 14:17:33 +00:00
Nika Layzell
429530ace6 Bug 1732343 - Part 3: Support directly attaching handles to IPC messages on windows, r=handyman
Handles which are directly attached to IPC messages will be transferred by the
parent process. This is handled either directly by the parent process (if it is
one of the participants), or by relaying the message via the parent process if
it is not. Ordering issues are avoided here thanks to support in the mojo ports
code for messages being delivered out-of-order.

The actual handle values are encoded in the message after the message payload,
and removed from the message before handing it off to existing code, so it
should be fully transparent.

In addition, a new flag is added to the message header to support marking a
message as a "relay" message, as well as support for deserializing these
messages with an extra NodeName (the real target/source) in the message footer.

Differential Revision: https://phabricator.services.mozilla.com/D126565
2021-11-09 14:17:32 +00:00
Nika Layzell
d73755617d Bug 1732343 - Part 2: Migrate all uses of base::FileDescriptor to UniqueFileHandle, r=handyman
This is useful for the following parts, as UniqueFileHandle is a cross-platform
type which can also be used to support transferring HANDLEs between processes.

This change requires fairly sweeping changes to existing callsites, which
previously did not require owning access to the handle types when transferring.
For the most part these changes were straightforward, but manual.

Differential Revision: https://phabricator.services.mozilla.com/D126564
2021-11-09 14:17:32 +00:00
Nika Layzell
803584be9d Bug 1732343 - Part 1: Better support for moveonly types in IPDL, r=handyman
In part 2 of this patch, a large number of messages are being converted to
contain move-only types, both as direct arguments and within compound data
structures. This revealed some limitations in IPDL's handling of moveonly
types, which this patch hopes to rectify. This also required changes to allow
distinguishing between types which require move to send vs. them not having a
move constructor.

This does not fully fix the underlying issues, but attempts to preserve
existing behaviour while improving support for the new types being added. There
should be further cleanup in the future.

Differential Revision: https://phabricator.services.mozilla.com/D126563
2021-11-09 14:17:31 +00:00
Cristian Tuns
cbd178830f Backed out 10 changesets (bug 1732343) for causing coverage build bustages (Bug 1739590).
Backed out changeset bba94c79f3e1 (bug 1732343)
Backed out changeset d30fa1e1f605 (bug 1732343)
Backed out changeset ed0b4f757c4b (bug 1732343)
Backed out changeset a272da134c34 (bug 1732343)
Backed out changeset ccb259d73843 (bug 1732343)
Backed out changeset a292990b62de (bug 1732343)
Backed out changeset 7d1854782ca8 (bug 1732343)
Backed out changeset 29eaabd9ffb3 (bug 1732343)
Backed out changeset 1aa26657a7a6 (bug 1732343)
Backed out changeset 7a6708dc620a (bug 1732343)
2021-11-05 07:21:04 -04:00
James Teh
b2865987fc Bug 1736742 part 2: Provide ability to register a COM handler inside an MSIX container. r=nalexander,jmathies
We could do this in HKLM using registry.dat, but that file is difficult to manage.
Instead, we register in HKCU at runtime.
Also, RegCreateKeyTransacted doesn't work in MSIX containers, so we must use RegCreateKeyEx.

Differential Revision: https://phabricator.services.mozilla.com/D129950
2021-11-05 06:25:45 +00:00
Nika Layzell
1cd9e0c087 Bug 1732343 - Part 10: Remove the now-unused ipc::DuplicateHandle, r=handyman
This should unblock removing support for BrokerDuplicateHandle from our fork of
the chromium sandboxing code.

Differential Revision: https://phabricator.services.mozilla.com/D126572
2021-11-04 19:20:21 +00:00
Nika Layzell
902aa7430e Bug 1732343 - Part 7: Use attached handles for Windows CrossProcess{Mutex,Semaphore} serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126569
2021-11-04 19:20:19 +00:00
Nika Layzell
eb3349f581 Bug 1732343 - Part 6: Use attached handles for Windows TransportDescriptor serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126568
2021-11-04 19:20:19 +00:00
Nika Layzell
fc6ef2a44a Bug 1732343 - Part 5: Use attached handles for Windows SharedMemory serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126567
2021-11-04 19:20:19 +00:00
Nika Layzell
aa3b31b0e4 Bug 1732343 - Part 4: Use attached handles for Windows FileDescriptor serialization, r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D126566
2021-11-04 19:20:18 +00:00
Nika Layzell
4bd83c851e Bug 1732343 - Part 3: Support directly attaching handles to IPC messages on windows, r=handyman
Handles which are directly attached to IPC messages will be transferred by the
parent process. This is handled either directly by the parent process (if it is
one of the participants), or by relaying the message via the parent process if
it is not. Ordering issues are avoided here thanks to support in the mojo ports
code for messages being delivered out-of-order.

The actual handle values are encoded in the message after the message payload,
and removed from the message before handing it off to existing code, so it
should be fully transparent.

In addition, a new flag is added to the message header to support marking a
message as a "relay" message, as well as support for deserializing these
messages with an extra NodeName (the real target/source) in the message footer.

Differential Revision: https://phabricator.services.mozilla.com/D126565
2021-11-04 19:20:18 +00:00
Nika Layzell
b8279164db Bug 1732343 - Part 2: Migrate all uses of base::FileDescriptor to UniqueFileHandle, r=handyman
This is useful for the following parts, as UniqueFileHandle is a cross-platform
type which can also be used to support transferring HANDLEs between processes.

This change requires fairly sweeping changes to existing callsites, which
previously did not require owning access to the handle types when transferring.
For the most part these changes were straightforward, but manual.

Differential Revision: https://phabricator.services.mozilla.com/D126564
2021-11-04 19:20:17 +00:00
Nika Layzell
9f23266238 Bug 1732343 - Part 1: Better support for moveonly types in IPDL, r=handyman
In part 2 of this patch, a large number of messages are being converted to
contain move-only types, both as direct arguments and within compound data
structures. This revealed some limitations in IPDL's handling of moveonly
types, which this patch hopes to rectify. This also required changes to allow
distinguishing between types which require move to send vs. them not having a
move constructor.

This does not fully fix the underlying issues, but attempts to preserve
existing behaviour while improving support for the new types being added. There
should be further cleanup in the future.

Differential Revision: https://phabricator.services.mozilla.com/D126563
2021-11-04 19:20:17 +00:00
Dan Minor
bb596c69e6 Bug 1654112 - Add include dirs for abseil-cpp. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D130060
2020-10-26 15:19:21 -04:00
Dan Minor
38d5d300d9 Bug 1654112 - Update include paths for moved upstream code. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D130059
2020-10-23 14:02:54 -04:00
Florian Quèze
1c3f80fe51 Bug 1738285 - move AUTO_PROFILE_FOLLOWING_RUNNABLE to its own header, r=gerald.
Differential Revision: https://phabricator.services.mozilla.com/D129825
2021-10-28 20:35:06 +00:00
Alexandre Lissy
4e04ec89a3 Bug 1723505 - Convert IPC processes to GeckoArgs r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D123186
2021-10-26 19:42:03 +00:00
Marian-Vasile Laza
f8576fec48 Backed out changeset fe716ee1a126 (bug 1723505) for causing build bustages. CLOSED TREE 2021-10-26 20:45:47 +03:00
Alexandre Lissy
14420a3ffc Bug 1723505 - Convert IPC processes to GeckoArgs r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D123186
2021-10-26 17:14:13 +00:00
Kagami Sascha Rosylight
b393a76883 Bug 1725942 - Part 3: Migrate LockManager implementation to PLockManager r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D125555
2021-10-19 12:01:51 +00:00
Kagami Sascha Rosylight
1b81c6c3a4 Bug 1725942 - Part 2: Add ipc::ParamTraits for dom::Sequence r=ipc-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D126242
2021-10-19 12:01:50 +00:00
Nika Layzell
8d97cd8228 Bug 1725572 - Part 1: Support automatic cleanup for ManagedEndpoint instances, r=handyman
This patch adds support for ManagedEndpoint instances to be dropped &
gracefully destroyed. Before this change, a ManagedEndpoint which was
dropped without being bound would not clean up its' peer actor, meaning
that messages to and from that actor would be discarded.

This is done by adding a new actor destroy reason for dropping a
ManagedEndpoint.

Differential Revision: https://phabricator.services.mozilla.com/D128776
2021-10-18 22:59:17 +00:00
Mike Hommey
7debb35262 Bug 1572618 - Statically link the rlbox library to libxul. r=firefox-build-system-reviewers,nika,andi
We still rely on dynamic loading to find the symbols, but since we get
them from libxul, we don't need to load the library before activating
the process sandbox anymore.

Differential Revision: https://phabricator.services.mozilla.com/D128333
2021-10-15 01:17:58 +00:00
Thinker Li
d608329c0a Bug 1697429 - Handle crash with the old way if the fork server is prefed out. r=jld
Handle crash with the old way if the fork server is prefed out, and waitpid() for all available stat changes of children processes in the forkserver.

Differential Revision: https://phabricator.services.mozilla.com/D110507
2021-10-14 03:13:00 +00:00
Noemi Erli
ee28b70fed Backed out changeset 88ae7d2397eb (bug 1697429) for causing bustages in process_util_posix.cc 2021-10-08 03:05:56 +03:00
Thinker Li
956b05e8b1 Bug 1697429 - Handle crash with the old way if the fork server is prefed out. r=jld
Handle crash with the old way if the fork server is prefed out, and waitpid() for all available stat changes of children processes in the forkserver.

Differential Revision: https://phabricator.services.mozilla.com/D110507
2021-10-07 23:42:22 +00:00
Jens Stutte
0a2448163d Bug 1731564: Use motivated SpinEventLoopUntil inside ipc/*. r=ipc-reviewers,nika
Depends on D127100

Differential Revision: https://phabricator.services.mozilla.com/D127102
2021-10-07 08:06:12 +00:00
Marian-Vasile Laza
18fb16c542 Backed out 18 changesets (bug 1731564) for causing build bustages on SpinEventLoopUntil. CLOSED TREE
Backed out changeset 0464dbdc8584 (bug 1731564)
Backed out changeset 0d996df13545 (bug 1731564)
Backed out changeset 5630a0e7a109 (bug 1731564)
Backed out changeset 37b41d187cdb (bug 1731564)
Backed out changeset d37700fa60b6 (bug 1731564)
Backed out changeset b0ce7db44b99 (bug 1731564)
Backed out changeset aa5ec3aa1535 (bug 1731564)
Backed out changeset 73b648f1fa70 (bug 1731564)
Backed out changeset bb8fb0f9833e (bug 1731564)
Backed out changeset 0d8905144f5d (bug 1731564)
Backed out changeset 2cfb094a1ec3 (bug 1731564)
Backed out changeset 78d3b0257a6a (bug 1731564)
Backed out changeset e9d32926e93c (bug 1731564)
Backed out changeset 874cab520ce5 (bug 1731564)
Backed out changeset d8071cc32bd9 (bug 1731564)
Backed out changeset 283c5393cbbc (bug 1731564)
Backed out changeset 317bc38e3de5 (bug 1731564)
Backed out changeset 53e3f4862439 (bug 1731564)
2021-10-07 00:09:19 +03:00
Jens Stutte
4c843c7054 Bug 1731564: Use motivated SpinEventLoopUntil inside ipc/*. r=ipc-reviewers,nika
Depends on D127100

Differential Revision: https://phabricator.services.mozilla.com/D127102
2021-10-06 19:45:13 +00:00
Petr Sumbera
7ee3993e66 Bug 1732325 - SharedMemory::FindFreeAddressSpace should use MAP_NORESERVE r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D126510
2021-10-01 08:16:37 +00:00
Alexandre Lissy
9a7966a721 Bug 1732999 - Annotate intentional crash when testing buildid mismatch r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D126905
2021-09-29 13:47:00 +00:00
Eitan Isaacson
1de5b0abcd Bug 1731374 - Add string storage to AccAttributes with move semantics. r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D126012
2021-09-28 22:01:35 +00:00
Jed Davis
fb5243f075 Bug 1715414 - Start PBackground earlier in content processes. r=nika
Previously we were staring `PBackground` in content processes in
response to receiving the `SetXPCOMProcessAttributes` IPC message, which
is sent immediately after the process is launched.  Meanwhile, the
idle scheduler tries to use PBackground when the main thread considers
itself idle.  But if thread scheduling is such that the content process
main thread becomes idle before the IPC I/O thread has received and
dispatched that message, then we have a problem (signaled by an assertion
failure).

This patch moves content process `PBackground` startup earlier, to the
end of `ContentProcess::Init`; that point is after enough of IPC and
XPCOM is started for it to work, but before we start spinning the main
thread event loop.

Differential Revision: https://phabricator.services.mozilla.com/D126144
2021-09-28 19:13:15 +00:00
criss
a8345dc602 Backed out changeset 671ba1530436 (bug 1715414) for casuing bustages on ContentProcess.cpp. CLOSED TREE 2021-09-28 07:33:53 +03:00
Jed Davis
86b3598e72 Bug 1715414 - Start PBackground earlier in content processes. r=nika
Previously we were staring `PBackground` in content processes in
response to receiving the `SetXPCOMProcessAttributes` IPC message, which
is sent immediately after the process is launched.  Meanwhile, the
idle scheduler tries to use PBackground when the main thread considers
itself idle.  But if thread scheduling is such that the content process
main thread becomes idle before the IPC I/O thread has received and
dispatched that message, then we have a problem (signaled by an assertion
failure).

This patch moves content process `PBackground` startup earlier, to the
end of `ContentProcess::Init`; that point is after enough of IPC and
XPCOM is started for it to work, but before we start spinning the main
thread event loop.

Differential Revision: https://phabricator.services.mozilla.com/D126144
2021-09-28 02:02:19 +00:00
Mike Hommey
87a967bf85 Bug 1732208 - Silence the unused-but-set-variable warning in ipc. r=mccr8
ipc/chromium/src/chrome/common/ipc_channel_win.cc(133,8): error: variable 'waited' set but not used [-Werror,-Wunused-but-set-variable]
  bool waited = false;
       ^
ipc/mscom/InterceptorLog.cpp(183,12): error: variable 'rv' set but not used [-Werror,-Wunused-but-set-variable]
  nsresult rv = mThread->Dispatch(
           ^

Differential Revision: https://phabricator.services.mozilla.com/D126455
2021-09-28 00:02:45 +00:00
Tim Huang
93a518fe4f Bug 1731557 - Part 1: Using an enum to represent storage permission in the loadInfo. r=pbz,necko-reviewers,dragana
To differentiate the storage permission is granted by either the
permission or the allowList, we need to change the hasStoragePermission
to an enum to represent the storage permission state.

This patch also changes the name of the attribute to make it reasonable
with respect to this change.

Differential Revision: https://phabricator.services.mozilla.com/D126276
2021-09-27 22:50:41 +00:00