Commit Graph

1120 Commits

Author SHA1 Message Date
David Parks
24e1111be1 Bug 1459335 - Distinguish between unregistered and failed DLL function interceptions. r=aklotz
Each failed attempt to intercept functions in a DLL wastes valuable memory so we remember failures in order to avoid repeating them.
2018-05-23 16:36:45 -07:00
Dorel Luca
d54a3b06aa Backed out changeset da12c077747f (bug 1448040) for Android build bustage on build/src/obj-firefox/dist/include/mozilla/HangAnnotations.h. CLOSED TREE
--HG--
extra : amend_source : 683201b5a47af3cb7fdcb7426c65f1c9ed713186
2018-05-25 20:13:26 +03:00
Doug Thayer
9765bdd0e0 Bug 1448040 - Remove HangMonitor/ChromeHangs r=Nika
Fairly straightforward, just a blanket removal. Haven't heard
anything on dev-platform or fx-data-dev regarding this removal,
so I think it's likely safe to remove on Nightly, and we can
revert if anyone makes a fuss.

As part of removing the HangMonitor, I renamed a few things and
reorganized the namespaces to not depend on a HangMonitor
namespace. Hopefully this doesn't produce too much noise in the
diff, it just seemed appropriate to move everything around
rather than keep dangling vestiges of the old system.

MozReview-Commit-ID: 8C8NFnOP5GU

--HG--
extra : rebase_source : a8840bd26f4b01b756ffa72345ababb625048550
2018-04-29 18:21:20 -07:00
David Parks
1bfa456486 Bug 1366256 - Part 4: Add plugin DLL to plugin sandbox exceptions list. r=bobowen
This permits opening the DLL from the plugin sandbox under the USER_LIMITED sandbox setting (plugin sandbox level 3).

--HG--
extra : rebase_source : cf3719f7b418b3fcbb5244d06203836fd32e3900
extra : histedit_source : 9bacced088b9965cee10c871f3934980e0361dcc
2018-05-03 16:40:19 -07:00
David Parks
64235097b2 Bug 1366256 - Part 3: Broker camera CreateMutexW calls from plugin process. r=jimm
The camera is blocked by the sandbox hardening in part 1.  This intercepts and remotes the call to CreateMutexW that causes the camera to fail.

--HG--
extra : rebase_source : 9b1be5c95fda29ce7fe70287b7bb3e66d9562ebe
extra : histedit_source : 5b4d3c17eebb905c1f694489acb7b564ee98c875
2018-03-07 16:00:53 -08:00
David Parks
ae240a1586 Bug 1366256 - Part 2: Refactor EndpointHandler to make special type handling opt-in. r=jimm
Previously, all FunctionBrokers used the same global set of type marshalers to handle IPC.  The marshaling behavior is endpoint-dependent so it is done with the EndpointHandler.  This patch makes the EndpointHandler used by a specific RPC function into a template parameter to the function's FunctionBroker.  It also divides up the current special type handling into two cases -- FileDlgEndpointHandler for plugin file dialog brokering, and SslEndpointHandler for SSL communication brokering.

--HG--
extra : rebase_source : 37e34564bd9dbb0ad8594d4803e7478ca0824b72
extra : histedit_source : 0b54e7b297495a93564090f2671ce76b5e926085
2018-03-13 16:38:15 -07:00
Jim Mathies
5bb082d6a1 Bug 1460007 - Only call PluginInstanceChild's HookSetWindowLongPtr once. r=aklotz 2018-05-16 13:29:43 -05:00
Jim Mathies
ba6f25a6f4 Bug 1460006 - Only call PluginInstanceChild's InitPopupMenuHook once. r=aklotz 2018-05-16 13:23:43 -05:00
Makoto Kato
fb3fb140eb Bug 1456294 - Hook ImmAssociateContextEx. r=masayuki 2018-05-17 14:47:55 +09:00
Chris Peterson
d64b13a882 Bug 1461243 - Part 6: Stub out obsolete NPAPI APIs _getJavaEnv and _getJavaPeer. r=jimm
MozReview-Commit-ID: JkroiRAqzqg

--HG--
extra : rebase_source : 52cc13aec25d9dd5bc958347fc69b480c9b1d553
extra : intermediate-source : 53f9104261ba0b492d066fbdc3c106bfc216ede9
extra : source : 2ac3387ef82e725ea5200cb814ee466fedcda8bf
extra : histedit_source : 931f721ab33b38efe68cb91e7ab0410818813c31
2018-02-20 01:47:57 -08:00
Boris Zbarsky
25aa42d9a4 Bug 1455674 part 16. Remove most use of nsIDOMElement in dom. r=qdot 2018-04-26 23:37:34 -04:00
Boris Zbarsky
8a0b50bea8 Bug 1456588 part 1. Change nsIFocusManager::SetFocus to take Element. r=enndeakin 2018-04-26 10:37:46 -04:00
David Parks
dc1f619d39 Bug 1450708 - Ref-count the plugin FunctionBroker mutex. r=bobowen
Instead of contending with the idiosyncracies of the platform implementations of condition variables, which have been leading to strange crashes, we hold this mutex as a ref-counted object and avoid complex object lifetime reasoning.
2018-04-23 13:48:06 -07:00
Aaron Klotz
5317435ec0 Bug 1432653: Refactor the DLL interceptor and parameterize its memory operations; r=handyman
MozReview-Commit-ID: EYxVsQ1kicy

--HG--
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/interceptor/PatcherBase.h
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/interceptor/PatcherDetour.h
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/interceptor/PatcherNopSpace.h
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/nsWindowsDllInterceptor.h
rename : toolkit/xre/test/win/TestDllInterceptor.cpp => mozglue/tests/interceptor/TestDllInterceptor.cpp
extra : amend_source : 84a7590b40a649f7321eb05feca4f9256ecc5d22
2018-04-09 13:37:52 -06:00
Tom Bannister
988d18881f Bug 1434710 - Replaced all instances of mozilla::IndexSequence, mozilla::MakeIndexSequence and mozilla::IndexSequenceFor with std::index_sequence, std::make_index_sequence and std::index_sequence_for and removed mfbt/IndexSequence.h. r=botond
MozReview-Commit-ID: 1Ema7TUNr5v

--HG--
extra : rebase_source : e5bb164dbe19993214e8c16f92b0a1f5d2ff3fa1
2018-04-09 21:12:13 +10:00
Sebastian Hengst
0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Nika Layzell
952f6a915a Bug 1443954 - Part 3: Add support for RefCounted types to IPDL, r=bz,froydnj,baku
This patch was reviewed in parts, however the intermediate states would not build:

Bug 1443954 - Part 3A: Strip pointers from the argument to WriteParam and WriteIPDLParam before selecting the ParamTraits impl, r=froydnj

Bug 1443954 - Part 3B: Move nsIAlertNotification serialization to the refcounted system, r=bz

Bug 1443954 - Part 3C: Move geolocation serialization to the refcounted system, r=bz

Bug 1443954 - Part 3D: Move nsIInputStream serialization to the refcounted system, r=baku

Bug 1443954 - Part 3E: Move BlobImpl serialization to the refcounted system, r=baku

Bug 1443954 - Part 3F: Correctly implement ParamTraits for actors after the ParamTraits changes, r=froydnj
2018-04-10 17:49:48 -04:00
Jonathan Watt
ef1290712d Bug 1452170 follow-up - Fix Windows unified build bustage by adding missing AutoRestore.h includes. r=me on CLOSED TREE 2018-04-09 10:21:42 +01:00
David Parks
a9fd0592af Bug 1446499: Use static nsWindowsDllInterceptor in plugin's HookProtectedMode r=aklotz
HookProtectedMode requires its nsWindowsDllInterceptor to last as long as the functions need to be overridden.  This uses a static object instead of a local one.

--HG--
extra : rebase_source : 7ba3f2fc1e19f89936b7f7fa490554e9cf9b885c
2018-04-03 17:09:36 -07:00
Honza Bambas
31c173ca8a Bug 1443892 - Add -MOZ_LOG and -MOZ_LOG_FILE command line arguments. r=erahm, r=nfroyd 2018-04-03 11:32:00 -04:00
Haik Aftandilian
331dda9367 Bug 1444291 - Part 3 - Add read access to the Mac Flash sandbox, support sandbox levels r=Alex_Gaynor
Replace the boolean pref "security.sandbox.mac.flash.enabled"
with "dom.ipc.plugins.sandbox-level.flash" to support sandbox
levels and be consistent with the Windows pref name.

Adds filesystem read access to the sandbox using sandbox extensions
granted by the file dialog machinery (level 1).

Add support for level 2 which blocks read access.

Allow the sandbox to be disabled with MOZ_DISABLE_NPAPI_SANDBOX.


MozReview-Commit-ID: 4rfobEoxQpF

--HG--
extra : rebase_source : 05dc54b46063967e959bc3fced21c61e5463de48
2018-03-15 20:23:19 -07:00
Coroiu Cristina
62bb56ad86 Backed out 3 changesets (bug 1444291) for bustage at build/src/dom/plugins/ipc/PluginProcessChild.cpp
Backed out changeset 48a9c2131347 (bug 1444291)
Backed out changeset dfc31b6c9f53 (bug 1444291)
Backed out changeset 8ee3e65465ed (bug 1444291)
2018-03-16 03:07:35 +02:00
Haik Aftandilian
3aaa8d9f78 Bug 1444291 - Part 3 - Add read access to the Mac Flash sandbox, support sandbox levels r=Alex_Gaynor
Replace the boolean pref "security.sandbox.mac.flash.enabled"
with "dom.ipc.plugins.sandbox-level.flash" to support sandbox
levels and be consistent with the Windows pref name.

Adds filesystem read access to the sandbox using sandbox extensions
granted by the file dialog machinery (level 1).

Add support for level 2 which blocks read access.

Allow the sandbox to be disabled with MOZ_DISABLE_NPAPI_SANDBOX.


MozReview-Commit-ID: 4rfobEoxQpF

--HG--
extra : rebase_source : 87f2f00867c4522ae3102abbc44fd05db63c7ec7
2018-03-13 15:38:11 -07:00
David Parks
3b52a7becc Bug 1445471 - Recognize invalid HANDLEs in plugin brokering. r=jimm
When InternetOpenA, or some other brokered function that returns handles, fails, we should not return a valid HANDLE id.  We return an id of 0 instead.
2018-03-14 12:28:22 -07:00
Makoto Kato
897ea8c314 Bug 1438955 - Remove ImmReleaseContext hook. r=masayuki
--HG--
extra : rebase_source : 78eeb24aa1b89c634cb9da089b43c01bdd390906
2018-03-07 11:01:30 +09:00
Nathan Froyd
062f6d980e Bug 1443236 - remove static init and shutdown nsRegion routines; r=kats
These routines are no-ops; let's get rid of them.
2018-03-05 14:06:50 -05:00
Chris Peterson
d24d25c9c2 Bug 1330529 - Part 5: Remove some Windows line endings from PluginProcessChild.cpp. r=jimm
MozReview-Commit-ID: DhNuxymQ97U

--HG--
extra : rebase_source : a44fbff88fa2512d59944b8ef9b27417199a8962
extra : histedit_source : 48145759bc8918864435730b102ab3ef7785eafc
2018-02-02 22:45:12 -08:00
Chris Peterson
4c4286f348 Bug 1330529 - Part 3: Protect DLL loads in wmain instead of waiting until PluginProcessChild::Init. r=jimm
Removing #define XRE_DONT_PROTECT_DLL_LOAD from plugin-container.cpp and xpcshell.cpp allows the #included nsWindowsWMain.cpp to protect DLL loads much earlier in the plugin process startup.

MozReview-Commit-ID: HbgyfvljvFs

--HG--
extra : rebase_source : dccdabb2e5bee4472d5aef9400a58cb0e397c112
extra : histedit_source : da248fc6fbdf96f30979f3a0396aefcf4bfcd5d9
2018-02-02 22:53:34 -08:00
Chris Peterson
f980f52b31 Bug 1330529 - Part 2: Remove unused SetDllDirectory workaround for Shockwave Player plugin. r=jimm
This code was added in bug 607832 to work around a Shockwave Player bug where it tries to load some DLLs from the current directory, but the current directory is not the one it expects. We no longer support the Shockwave Player plugin, so this workaround is no longer necessary and we can always call SetDllDirectory("") to remove the current directory from the DLL search path.

MozReview-Commit-ID: C4MjB1SkZE3

--HG--
extra : rebase_source : 6473ca88db6bee484c3c97669dca39daf31b438e
extra : histedit_source : f4abb901979b07f0aa346508773a8e65f47451cd
2018-02-02 22:34:19 -08:00
Haik Aftandilian
c90be35636 Bug 1436566 - [Mac] Land disabled-by-default sandboxing for the Flash NPAPI plugin process. r=Alex_Gaynor,jimm
MozReview-Commit-ID: Es0GbMLKvH5

--HG--
extra : rebase_source : 991f20ac25735508d790947991f59214fb06e54f
2018-02-12 15:46:31 -08:00
David Parks
a14e9905f0 Bug 1436253 - Fix NPAPI FunctionBroker condition variable concurrency issues. r=aklotz
The Monitor's Wait call is subject to spurious waking and needed a condition guard (I just use a boolean) to detect if it should not have been awakened.  Additionally, the ok value was being assigned after the Notify, despite it no longer being valid on this thread.
2018-02-06 21:35:44 -08:00
David Parks
1dd54ad783 Bug 1433856 - Block PluginModuleChromeParent::CleanupFromTimeout from recursing. r=jimm
CleanupFromTimeout is (transitively) recursing in calls to Close(), as that now leads to shutting down the plugin broker thread and CleanupFromTimeout was being rerun since nsThread::Shutdown runs tasks..
2018-01-29 18:15:18 -08:00
David Parks
c6dc5f3406 Bug 1433855 - Make sure plugin function broker's PostToDispatchThread is Waiting before Notifying it. r=jimm
The Monitor's condition variable could be notified before the calling thread had begun to Wait for it.  This caused the Notify to be missed, leading to hangs.  By grabbing the Monitor in PostToDispatchHelper, we know Wait has been called because, otherwise, the calling thread would still hold the Monitor.
2018-01-30 17:32:27 -08:00
David Parks
271000d784 Bug 1429643: Limit Win32 NPAPI SSL brokering to 64-bit builds; r=jimm
Uses PluginQuirks to avoid brokering in 32-bit, as Flash has its own 32-bit sandbox.
2018-01-15 19:51:34 -08:00
David Parks
c0258f303a Bug 1382251: Part 11 - Update moz.build with new files; r=jimm
Includes the build changes made by the earlier patches in this series.  Also adds some #includes required by other files when these are added to the unified build.
2017-11-06 10:47:01 -08:00
David Parks
8b000b81a9 Bug 1382251: Part 9 - Hook functions needed for SSL communication in NPAPI process; r=jimm
Adds Win32 networking APIs to the function broker so that we can run SSL communications outside of the sandbox.
2017-11-06 10:41:21 -08:00
David Parks
cc15f3d517 Bug 1382251: Part 8 - Migrate some previously hooked functions to FunctionHook/Broker; r=jimm,froydnj
Moves GetWindowInfo, GetKeyState, SetCursorPos, GetSaveFileNameW and GetOpenFileNameW to the new FunctionHook and FunctionBroker systems.
2017-11-06 11:07:16 -08:00
David Parks
9a40a70447 Bug 1382251: Part 7 - Add mechanism for automatically brokering DLL functions; r=jimm
The FunctionBroker is a special kind of FunctionHook that brokers the hooked function on another process.  In the child process, it uses the FunctionBrokerChild to request that the FunctionBrokerParent run a function and return the response.  It handles most cases of parameter, return value and error marshaling on its own.  It also guarantees that requests are issued from the proper thread.
2017-11-06 10:34:47 -08:00
David Parks
93bbbac8e4 Bug 1382251: Part 6 - Start/stop new top-level brokering actors on their own threads; r=jld
The FunctionBroker actors allow the NPAPI process (child) to run methods on the main process (parent).  Both the parent and the child run dedicated threads for this task -- this is a top-level protocol.
2017-11-06 10:29:15 -08:00
David Parks
c28f7ffcb4 Bug 1382251: Part 5 - Add IpdlTuple for type-safely marshaling tuples; r=jld
IpdlTuple is an array of Variants that is accessed by type and that reports an error if there is a type error.  This is used for safe and easy communication of IPDL objects, validated at run time since IPC data is untrusted.
2017-11-06 10:17:15 -08:00
David Parks
8f6ea1789c Bug 1382251: Part 4 - Init/Shutdown parts of XPCOM needed in plugin process; r=erahm
We have not been initializing or shutting down XPCOM in the plugin process.  We need the nsThreadManager for this bug but, more importantly, we need to properly shut down XPCOM in order to get things like handlers connected to the ShutdownPhases (e.g. ClearOnShutdown, used to free resources at process end).

This patch includes some work to make services that are uninitialized in the plugin process to handle Shutdown calls without failing.
2017-11-06 10:10:43 -08:00
David Parks
bec525edde Bug 1382251: Part 3 - Add mechanism for automatically hooking DLL functions; r=jimm
FunctionHook uses the DLL interceptor to redirect Win32 calls to a user-supplied function.
2017-11-06 10:04:19 -08:00
David Parks
154fa0eb0a Bug 1430586 - Make sure the NPObjectData map still exists before use. r=jimm
The shutdown path has a way to free the sObjectMap before all plugin references to it have been executed.  It does this by scheduling a DeferNPObjectReleaseRunnable, then shutting down the plugin with PluginInstanceChild::Destroy.  This patch keeps the runnable from failing in that case.
2018-01-23 12:56:06 -08:00
Sylvestre Ledru
0039663a81 Bug 1431072 - Move a duplicate declarations (NS_NPAPIPLUGIN_CALLBACK) into a common file r=jimm
MozReview-Commit-ID: HZsNoNUOtnO

--HG--
extra : rebase_source : 21ccd11ee98faa43f3bc95f4f78ea56ab319eca6
2018-01-17 14:32:56 +01:00
Chris Peterson
37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Andrew McCreight
b01441d8e5 Bug 1426284 - Remove TransportDIB files. r=jld
PluginMessageUtils.h was bootlegging base/shared_memory.h via transport_dib.h

MozReview-Commit-ID: CPGxu2lpdj0

--HG--
extra : rebase_source : 796c747a4a125dddc2a0685f1e0d0152ac3ef74f
2017-12-19 12:40:41 -08:00
Petr Sumbera
3055fec73b Bug 1423174 - Rename CS to avoid macro conflict on Solaris. r=jgilbert
--HG--
extra : rebase_source : 22d7a56e7e18376f2bf0899a5cb358c6260d9835
2017-12-05 04:10:29 -08:00
Stephen A Pohl
5b3cbf1d2f Bug 1419004: Fix crash when setting plugin process names on macOS 10.13.2. r=mstange 2017-12-12 17:03:33 -06:00
Stephen A Pohl
957e2ba425 Backout e66e48637c65 (bug 1419004) for compile error. r=me 2017-12-12 16:57:35 -06:00