Граф коммитов

5526 Коммитов

Автор SHA1 Сообщение Дата
Bobby Holley a2b5e1de1e Bug 1562763 - Factor process launching into a helper class, and use more promises. r=jld
This is intended to facilitate future work to break up
PerformAsyncLaunch into asynchronous pieces. It also aims to fix some
raciness around access to state in the GeckoChildProcessHost instance.
There appears to be at least one data race in the existing code, in which
OpenPrivilegedHandle are run on both the launcher thread and the IO
thread without synchronization.

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

--HG--
extra : moz-landing-system : lando
2019-07-10 22:37:37 +00:00
Bobby Holley 3b7fbc734f Bug 1562763 - Move some types around. r=jld
Having to namespace these into GeckoChildProcessHost is annoying. The
|using| declarations help to some extent, but it's easier to just put
them in mozilla::ipc.

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

--HG--
extra : moz-landing-system : lando
2019-07-10 22:37:35 +00:00
Bobby Holley e40b45dc28 Bug 1562763 - Don't crash child or parent on failed InitBackground. r=nika
This can happen if the parent starts shutting down before a child has
finished starting up.

The main thread case in the child has always just warned, and this MOZ_CRASH was
added recently to the dispatch case in [1]. This can happen if the
parent starts shutting down while the child is still initializing.

[1] https://hg.mozilla.org/mozilla-central/rev/bd8fd9a22dc08d63cec68de475182a1b8eeeca4b

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

--HG--
extra : moz-landing-system : lando
2019-07-10 22:37:32 +00:00
Barret Rennie 0b66a71420 Bug 1289211 - Rename InfallibleTArray to nsTArray in ipc/ r=nika
Differential Revision: https://phabricator.services.mozilla.com/D36961

--HG--
extra : moz-landing-system : lando
2019-07-10 03:31:24 +00:00
Jonathan Kingston 31441f82ea Bug 1560455 - rename CodebasePrincipal to ContentPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D35504

--HG--
extra : moz-landing-system : lando
2019-07-08 16:37:45 +00:00
Sylvestre Ledru fc2eb5393c Bug 1562642 - Part 2 - Add missing MPL2 headers r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D37146

--HG--
extra : moz-landing-system : lando
2019-07-08 09:27:47 +00:00
Victor Porof 251f88082d Bug 1561435 - Format ipc/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : 2fa9743b80561bb68a7b4bf76b1b636d97d82942
2019-07-05 10:48:16 +02:00
Narcis Beleuzu a89b67e772 Backed out 15 changesets (bug 1479960, bug 1426526, bug 1534780, bug 1536697) for toolchain bustages on UniquePtrExtensions.h . CLOSED TREE
Backed out changeset a8518ea4b594 (bug 1479960)
Backed out changeset 7172762c4b87 (bug 1536697)
Backed out changeset 2ea5ccb8f3a1 (bug 1426526)
Backed out changeset d892a888fe9c (bug 1426526)
Backed out changeset 2c4d12bdfec3 (bug 1479960)
Backed out changeset 8a322064cf6d (bug 1479960)
Backed out changeset 47d387b6cd4a (bug 1479960)
Backed out changeset 8332565a6943 (bug 1479960)
Backed out changeset 9d7f1835f96f (bug 1479960)
Backed out changeset 0aa8af4965c5 (bug 1479960)
Backed out changeset 036809330a51 (bug 1479960)
Backed out changeset 39e18373e3d3 (bug 1479960)
Backed out changeset 6c2b995a9d30 (bug 1479960)
Backed out changeset 3c2b31744645 (bug 1534780)
Backed out changeset 26bb00a94d5d (bug 1534780)
2019-06-28 22:42:00 +03:00
shindli c0ca77697c Merge inbound to mozilla-central. a=merge 2019-06-21 12:34:14 +03:00
Tarek Ziadé a494b08766 Bug 1529022 - Add a GeckoChildProcessHosts iterator r=jld
Adds GeckoChildProcessHost::GetAll() and use it in ChromeUtils::GetProcInfo()

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

--HG--
extra : moz-landing-system : lando
2019-06-21 01:33:47 +00:00
Jed Davis d9d1bec632 Bug 1479960 - Add unit tests for shared memory freezing. r=froydnj
Also refactor SharedMemoryBasic::SystemProtect to allow testing cases
that are expected to fail.

Depends on D26748

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

--HG--
rename : ipc/moz.build => ipc/gtest/moz.build
extra : moz-landing-system : lando
2019-06-20 22:40:46 +00:00
Jed Davis 1388eadfff Bug 1536697 - Fix error handling in base::SharedMemory::Map. r=froydnj
If mmap failed, we'd leave the memory_ member variable set to MAP_FAILED,
but everything else in this file checks for nullptr (and only nullptr) to
test if the pointer is valid.

Also, this removes the debug assertion that the mmap succeeded, to allow
writing unit tests where we expect it to fail (e.g., for insufficient
permissions).

Depends on D26747

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

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:44 +00:00
Jed Davis 5c3a0a30d3 Bug 1426526 - Delete file_util from ex-Chromium IPC source. r=froydnj
Depends on D26746

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

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:40 +00:00
Jed Davis b1c82b278b Bug 1479960 - Add freezing of IPC shared memory. r=froydnj,kmag
This allows writing to shared memory and then making it read-only before
sharing it to other processes, such that a malicious sandboxed process
cannot regain write access.  This is currently available only in the
low-level base::SharedMemory interface.

The freeze operation exposes the common subset of read-only shared
memory that we can implement on all supported OSes: with some APIs
(POSIX shm_open) we can't revoke writeability from existing capabilies,
while for others (Android ashmem) we *must* revoke it.  Thus, we require
that the writeable capability not have been duplicated or shared to
another process, and consume it as part of freezing.  Also, because in
some backends need special handling at creation time, freezeability must
be explicitly requested.

In particular, this doesn't allow giving an untrusted process read-only
access to memory that the original process can write.

Note that on MacOS before 10.12 this will use temporary files in order to
avoid an OS security bug that allows regaining write access; those OS
versions are no longer supported by Apple (but are supported by Firefox).

Depends on D26742

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

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:32 +00:00
Jed Davis 0a231ee919 Bug 1479960 - Clean up shared_memory_posix error handling. r=froydnj
This uses RAII to handle error-case cleanup in the POSIX backend for
SharedMemory::Create, to simplify the complexity that will be added to
support freezing.

Depends on D26741

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

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:28 +00:00
Jed Davis 6559e7ab1f Bug 1479960 - Fix max_size in shared_memory_posix. r=froydnj
The Unix backend for shared memory needs to keep the mapped size to pass
to munmap, while the Windows backend doesn't.  Currently it's reusing the
max_size field, and then zeroing it when it's unmapped, which breaks the
freezing use case.  This patch uses a dedicated field for that.

Depends on D26740

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

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:21 +00:00
Jed Davis 3c945a3e99 Bug 1479960 - Get rid of base::SharedMemory::handle. r=froydnj
Despite the comment saying not to use the "handle" except as an opaque
identifier, it is being used to pass the handle to other OS APIs.  Direct
access to the handle needs to be controlled to make sure freezing is
safe, so this patch replaces that with interfaces that are more explicit
about ownership and lifetime.

Depends on D26739

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

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:19 +00:00
Jed Davis b916fc745c Bug 1479960 - Remove SHM_ANON support. r=froydnj
FreeBSD's SHM_ANON is useful for the usual case of shared memory, but it
doesn't support freezing.  It could be re-added later, but for now it's
simplest to remove it (and use named shm instead) while refactoring.

Depends on D26738

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

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:17 +00:00
Jed Davis d32b9ba525 Bug 1534780 - Add free interconversion between UniqueFileHandle and ipc::FileDescriptor and use it in a few places. r=froydnj
Now that UniqueFileHandle can be used more widely, and with
ipc::FileDescriptor being essentially a copyable UniqueFileHandle, it
makes sense to add a move constructor and a "forget"-like method to
convert between them when needed.

Depends on D26737

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

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:15 +00:00
Jed Davis 35bc3bb540 Bug 1534780 - Move ipc::FileDescriptor's UniquePtr instance into MFBT as UniqueFileHandle. r=froydnj
MozReview-Commit-ID: 7bbGVIjTTaJ

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

--HG--
extra : moz-landing-system : lando
2019-06-20 22:40:13 +00:00
Boris Zbarsky e0bd7114ae Bug 1559468 part 1. Move JS_DefineProfilingFunctions into InitClassesWithNewWrappedGlobal. r=mccr8
All callers of InitClassesWithNewWrappedGlobal already call it.

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

--HG--
extra : moz-landing-system : lando
2019-06-20 21:44:03 +00:00
myfreeweb 01916974b0 Bug 1213601 - implement kinetic/inertial scrolling (fling) for Gtk. r=botond
--HG--
extra : rebase_source : 69a374c26bcb8781e83aeb26058a2de349313bbc
extra : amend_source : 521bb6f2b5799bfca5f8b8b5bbe9e4fef1f2dd1e
2019-06-20 16:18:45 -04:00
Oana Pop Rus 288befd88a Backed out changeset f79736d79ee1 (bug 1529022) for build bustages in GeckoChildProcessHost.cpp a=backout 2019-06-20 01:57:00 +03:00
Tarek Ziadé 2b03934b7d Bug 1529022 - Add a GeckoChildProcessHosts iterator r=jld
Adds GeckoChildProcessHost::GetAll() and use it in ChromeUtils::GetProcInfo()

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

--HG--
extra : moz-landing-system : lando
2019-06-19 06:13:50 +00:00
Gurzau Raul 376affada3 Backed out changeset 11c118fa5f2b (bug 1529022) for build bustages at GeckoChildProcessHost.cpp a=backout 2019-06-19 09:07:19 +03:00
Tarek Ziadé 9f31044be3 Bug 1529022 - Add a GeckoChildProcessHosts iterator r=jld
Adds GeckoChildProcessHost::GetAll() and use it in ChromeUtils::GetProcInfo()

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

--HG--
extra : moz-landing-system : lando
2019-06-18 16:36:52 +00:00
Haik Aftandilian d302444d67 Bug 1498742 - Part 2 - Start the GMP sandbox earlier during process startup r=jya,cpearce
Change the Mac GMP process launch to include sandboxing params on the command line to allow the sandbox to be started earlier during GMP process launch. Content, extension, and RDD processes have already been changed to start the sandbox earlier.

Update GMPProcessParent to override GeckoChildProcessHost methods used to construct sandboxing parameters. Pass the plugin path as a sandbox parameter so that the sandbox rules can whitelist the plugin directory which is now read after the sandbox is enabled in the plugin process. On development builds, pass "testingReadPath" params so directories needed during automated tests can be whitelisted.

Update Mac sandboxing code to detect GMP sandbox params on the command line and enable the sandbox with additional arguments needed for early sandbox start.

Allow reverting to the old implementation by setting security.sandbox.gmp.mac.earlyinit to false.

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

--HG--
extra : moz-landing-system : lando
2019-06-14 22:55:27 +00:00
Dorel Luca fb616d00a6 Backed out 2 changesets (bug 1498742) for OSX build bustages. CLOSED TREE
Backed out changeset f6da94d90350 (bug 1498742)
Backed out changeset 4f3e83d8de59 (bug 1498742)
2019-06-15 00:13:05 +03:00
Haik Aftandilian c0874f2dba Bug 1498742 - Part 2 - Start the GMP sandbox earlier during process startup r=jya,cpearce
Change the Mac GMP process launch to include sandboxing params on the command line to allow the sandbox to be started earlier during GMP process launch. Content, extension, and RDD processes have already been changed to start the sandbox earlier.

Update GMPProcessParent to override GeckoChildProcessHost methods used to construct sandboxing parameters. Pass the plugin path as a sandbox parameter so that the sandbox rules can whitelist the plugin directory which is now read after the sandbox is enabled in the plugin process. On development builds, pass "testingReadPath" params so directories needed during automated tests can be whitelisted.

Update Mac sandboxing code to detect GMP sandbox params on the command line and enable the sandbox with additional arguments needed for early sandbox start.

Allow reverting to the old implementation by setting security.sandbox.gmp.mac.earlyinit to false.

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

--HG--
extra : moz-landing-system : lando
2019-06-14 20:12:01 +00:00
Bogdan Tara d62176d3d7 Backed out 2 changesets (bug 1498742) for nsMacUtilsImpl.cpp related build bustage a=backout
Backed out changeset 6729dc168afd (bug 1498742)
Backed out changeset e5eed57a9111 (bug 1498742)
2019-06-14 12:50:04 +03:00
Jed Davis ded11c124c Bug 1554244 - Tolerate multiple calls to MessageChannel::Close. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D34804

--HG--
extra : moz-landing-system : lando
2019-06-13 15:40:58 +00:00
Sebastian Streich 5462226932 Bug 1450965 Skip Cors Check for Early WebExtention Redirects r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D30509

--HG--
extra : moz-landing-system : lando
2019-06-13 09:57:13 +00:00
Jonathan Kingston a5ba216f93 Bug 1315460 - Removal of keygen element r=keeler,baku,jld,hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D22810

--HG--
extra : moz-landing-system : lando
2019-06-13 08:58:07 +00:00
Haik Aftandilian f87e72036e Bug 1498742 - Part 2 - Start the GMP sandbox earlier during process startup r=jya,cpearce
Change the Mac GMP process launch to include sandboxing params on the command line to allow the sandbox to be started earlier during GMP process launch. Content, extension, and RDD processes have already been changed to start the sandbox earlier.

Update GMPProcessParent to override GeckoChildProcessHost methods used to construct sandboxing parameters. Pass the plugin path as a sandbox parameter so that the sandbox rules can whitelist the plugin directory which is now read after the sandbox is enabled in the plugin process. On development builds, pass "testingReadPath" params so directories needed during automated tests can be whitelisted.

Update Mac sandboxing code to detect GMP sandbox params on the command line and enable the sandbox with additional arguments needed for early sandbox start.

Allow reverting to the old implementation by setting security.sandbox.gmp.mac.earlyinit to false.

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

--HG--
extra : moz-landing-system : lando
2019-06-13 06:32:37 +00:00
Andreea Pavel 307e3f181b Backed out 2 changesets (bug 1498742) for build bustages at GMPProcessParent.cpp on a CLOSED TREE
Backed out changeset 5f9d32e26c71 (bug 1498742)
Backed out changeset ffc8d151cf3a (bug 1498742)
2019-06-13 04:38:56 +03:00
Haik Aftandilian 0f858863b6 Bug 1498742 - Part 2 - Start the GMP sandbox earlier during process startup r=jya,cpearce
Change the Mac GMP process launch to include sandboxing params on the command line to allow the sandbox to be started earlier during GMP process launch. Content, extension, and RDD processes have already been changed to start the sandbox earlier.

Update GMPProcessParent to override GeckoChildProcessHost methods used to construct sandboxing parameters. Pass the plugin path as a sandbox parameter so that the sandbox rules can whitelist the plugin directory which is now read after the sandbox is enabled in the plugin process. On development builds, pass "testingReadPath" params so directories needed during automated tests can be whitelisted.

Update Mac sandboxing code to detect GMP sandbox params on the command line and enable the sandbox with additional arguments needed for early sandbox start.

Allow reverting to the old implementation by setting security.sandbox.gmp.mac.earlyinit to false.

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

--HG--
extra : moz-landing-system : lando
2019-06-12 23:41:53 +00:00
Jean-Yves Avenard 638940d1fc Bug 1554559 - P1. Test for invalid arguments. r=kershaw
Will also silence static analysis in phabricator whenever a caller of this code is used.

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

--HG--
extra : moz-landing-system : lando
2019-06-11 06:29:23 +00:00
Matt Woodrow 15fec19828 Bug 1555891 - Merge PVideoDecoder into PRemoteDecoder. r=jya,jld
Differential Revision: https://phabricator.services.mozilla.com/D33587

--HG--
extra : moz-landing-system : lando
2019-06-11 02:01:51 +00:00
Matt Woodrow 4908a84df2 Bug 1555891 - Merge PVideoDecoderManager into PRemoteDecoderManager. r=jya,jld
Differential Revision: https://phabricator.services.mozilla.com/D33586

--HG--
extra : moz-landing-system : lando
2019-06-11 02:01:34 +00:00
Tarek Ziadé c10664f1c1 Bug 1533675 - Name all threads in Firefox r=Ehsan
This patch adds thread names where they are missing

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

--HG--
extra : moz-landing-system : lando
2019-06-06 21:07:29 +00:00
Christoph Kerschbaumer 242bf62249 Bug 1555050: Always (if non null) set any CSP as cspToInherit on the loadinfo of new document load. Update documentation for GetCSP, GetPreloadCSP() and GetCSPToInherit and update two callsites which called GetCSP instead of GetCSPToInherit. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D33499

--HG--
extra : moz-landing-system : lando
2019-06-06 20:19:56 +00:00
Bogdan Tara bde97b25f5 Backed out 2 changesets (bug 1555050) for test_reloadInFreshProcess.html failures CLOSED TREE
Backed out changeset f5e954d593f8 (bug 1555050)
Backed out changeset b5b99e78b753 (bug 1555050)
2019-06-06 23:13:52 +03:00
Christoph Kerschbaumer a9912a9803 Bug 1555050: Always (if non null) set any CSP as cspToInherit on the loadinfo of new document load. Update documentation for GetCSP, GetPreloadCSP() and GetCSPToInherit and update two callsites which called GetCSP instead of GetCSPToInherit. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D33499

--HG--
extra : moz-landing-system : lando
2019-06-06 18:09:03 +00:00
Nika Layzell 03a2f40528 Bug 1553272 - Eliminate the unnecessary ProtocolState object, r=froydnj
The vast majority of the virtual methods which were used on ProtocolState were
actually methods which only had meaningful implementations on the toplevel
protocol. This patch adds a new field to IProtocol holding a direct pointer to
the protocol's `IToplevelProtocol`, and the methods formerly implemented with
ProtocolState now directly call the corresponding method on IToplevelProtocol.
IToplevelProtocol then shadows these methods with the toplevel protocol
implementation, meaning that the right code is run in the right places.

In addition, some state was maintained for protocols inside of the separate
ProtocolState allocation, and this patch moves that state back into the actor
itself.

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

--HG--
extra : moz-landing-system : lando
2019-06-06 14:57:34 +00:00
sotaro 3d0c73c202 Bug 1537586 - Address build failure with --disable-printing r=bobowen,froydnj
Make nsIWebBrowserPrint included unconditionally for addressing nsIDocShell.rs build failure.

Remove direct_call of PPrinting and PRemotePrintJob. Their ipdl are built unconditionally, but their derived classes are not built with --disable-printing.

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

--HG--
extra : moz-landing-system : lando
2019-06-05 01:25:36 +00:00
Gabriele Svelto 76021a664b Bug 1555917 - Exception handler and crash reporter client cleanup r=froydnj
This patch includes multiple changes cleaning up various aspects of the crash
reporter client and exception handler:

* Some Unix-specific code was moved out from the base crashreporter client
  code and into the appropriate platform implementation
* Functions used to open files in the crashreporter client now accept C++
  `std::ios` flags instead of unreadable booleans
* Useless character conversion routines were removed from the
  minidump-analyzer
* Crash annotations are not serialized into a huge string anymore every time
  they change. They are all written out individually during an exception.
* `WriteEscapedMozCrashReason()` uses the exception-safe `my_strlen()` instead
  of plain `strlen()`
* The Windows-specific DLL-blocklist shutdown was removed from the Linux &
  macOS Breakpad callbacks
* The `CrashReporterHost`, `CrashReporterClient` and
  `CrashReporterMetadataShmem` classes now take `nsACString` references
  instead of `nsCString` ones since they never modify their contents

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

--HG--
extra : moz-landing-system : lando
2019-05-31 21:54:03 +00:00
shindli b374b306cf Merge mozilla-central to inbound. a=merge CLOSED TREE 2019-05-30 06:50:22 +03:00
Mike Hommey 2abcc3d7cb Bug 1553363 - Generalize the *_impl goop for allocation functions in mozglue. r=froydnj
The current situation is suboptimal, where we have the same goop
repeated in multiple files, and where things kinda sorta work out fine
thanks to the linker for files that would have been forbidden, except
when the linker doesn't do its job, which apparently happen on
mingwclang builds.

This change only really covers C++ code using operator new/delete, and
not things that would be using malloc/free, because it's easier.
malloc/free is left for a followup.

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

--HG--
extra : moz-landing-system : lando
2019-05-29 22:49:42 +00:00
PHO 08186e772d Bug 1553389 - Fix "pipe error: Message too long" on NetBSD 2019-05-22 15:13:33 +09:00
Christoph Kerschbaumer 046bb46c32 Bug 1553742: Null Check CSP before calling CSPToCSPInfo to avoid half initialized state of cspinfo. r=baku,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D32990

--HG--
extra : moz-landing-system : lando
2019-05-29 15:42:13 +00:00