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

157 Коммитов

Автор SHA1 Сообщение Дата
Toshihito Kikuchi 056103e63e Bug 1620114 - Enable pre-spawn CIG in RDD. r=bobowen
This patch enables pre-spawn CIG in the RDD process.

If CIG prevents a module in the executable's Import Directory Table, Windows totally
fails to launch a process.  So we add a policy rule of `SUBSYS_SIGNED_BINARY` for
all files under the directory containing the executable such as mozglue.dll, and
modules injected via Import Directory Table.  The latter ones will be blocked by our
blocklist with `REDIRECT_TO_NOOP_ENTRYPOINT` (bug 1659438).

Differential Revision: https://phabricator.services.mozilla.com/D96933
2020-11-19 21:59:47 +00:00
Bob Owen a8453ad25d Bug 1668876: Take chromium commit b8479b16bfe703cb09147f4d5cff0cfa3bd91366. r=tkikuchi
Differential Revision: https://phabricator.services.mozilla.com/D94583
2020-10-23 16:01:59 +00:00
Jed Davis 8ea790a391 Bug 1663550 - Add security/sandbox/chromium files needed for ARM/ARM64. r=bobowen
Chromium's Linux sandboxing code needs some architecture-specific files
for ARM and ARM64 that we don't currently include in our partial import.
These are copied from Chromium tag 81.0.4044.138 (matching the latest
import of the rest of security/sandbox/chromium) without changes.

Differential Revision: https://phabricator.services.mozilla.com/D89994
2020-09-15 14:46:35 +00:00
Toshihito Kikuchi 2810e91249 Bug 1639030 - Part 3: Roll-up patch to apply remaining mozilla changes to chromium sandbox. r=bobowen
This commit applies patches under security/sandbox/chromium-shim/patches/after_update/.

Differential Revision: https://phabricator.services.mozilla.com/D79561
2020-07-08 12:54:35 +00:00
Toshihito Kikuchi 0e041b91bd Bug 1639030 - Part 2: Roll-up of chromium sandbox update and patches to get a running browser. r=bobowen
This commit does:
- Sync files under security/sandbox/chromium/ with Chromium 81.0.4044.138
- Update files under security/sandbox/chromium-shim/
- Apply patches under security/sandbox/chromium-shim/patches/with_update/
- Add mozilla::AddWin32kLockdownPolicy to apply MITIGATION_WIN32K_DISABLE before SUBSYS_WIN32K_LOCKDOWN

Differential Revision: https://phabricator.services.mozilla.com/D79560
2020-07-08 12:54:33 +00:00
Dorel Luca feebf13084 Backed out 3 changesets (bug 1639030) for MDA failures in dom/media/test/test_eme_autoplay.html. CLOSED TREE
Backed out changeset e614d160ab92 (bug 1639030)
Backed out changeset e93c2e3b1e62 (bug 1639030)
Backed out changeset c40a82e96834 (bug 1639030)
2020-07-06 16:16:42 +03:00
Toshihito Kikuchi 1f41e7ebe4 Bug 1639030 - Part 3: Roll-up patch to apply remaining mozilla changes to chromium sandbox. r=bobowen
This commit applies patches under security/sandbox/chromium-shim/patches/after_update/.

Differential Revision: https://phabricator.services.mozilla.com/D79561
2020-07-06 04:04:19 +00:00
Toshihito Kikuchi 0cbcab5ebb Bug 1639030 - Part 2: Roll-up of chromium sandbox update and patches to get a running browser. r=bobowen
This commit does:
- Sync files under security/sandbox/chromium/ with Chromium 81.0.4044.138
- Update files under security/sandbox/chromium-shim/
- Apply patches under security/sandbox/chromium-shim/patches/with_update/
- Apply a workaround for Clang's bug to compile *_interception.cc
- Add mozilla::AddWin32kLockdownPolicy to apply MITIGATION_WIN32K_DISABLE before SUBSYS_WIN32K_LOCKDOWN

Differential Revision: https://phabricator.services.mozilla.com/D79560
2020-07-06 04:04:12 +00:00
Dorel Luca 751ff32a41 Backed out 3 changesets (bug 1639030) for build bustage. CLOSED TREE
Backed out changeset d7bd92ae8de6 (bug 1639030)
Backed out changeset dc961d2004fd (bug 1639030)
Backed out changeset 2c6cfddbc1af (bug 1639030)
2020-07-03 23:26:12 +03:00
Toshihito Kikuchi e77485c628 Bug 1639030 - Part 3: Roll-up patch to apply remaining mozilla changes to chromium sandbox. r=bobowen
This commit applies patches under security/sandbox/chromium-shim/patches/after_update/.

Differential Revision: https://phabricator.services.mozilla.com/D79561
2020-07-03 19:15:53 +00:00
Toshihito Kikuchi 617828f9d5 Bug 1639030 - Part 2: Roll-up of chromium sandbox update and patches to get a running browser. r=bobowen
This commit does:
- Sync files under security/sandbox/chromium/ with Chromium 81.0.4044.138
- Update files under security/sandbox/chromium-shim/
- Apply patches under security/sandbox/chromium-shim/patches/with_update/
- Apply a workaround for Clang's bug to compile *_interception.cc
- Add mozilla::AddWin32kLockdownPolicy to apply MITIGATION_WIN32K_DISABLE before SUBSYS_WIN32K_LOCKDOWN

Differential Revision: https://phabricator.services.mozilla.com/D79560
2020-07-03 19:15:30 +00:00
Bogdan Tara 55458f847e Backed out 3 changesets (bug 1639030) for sandbox related bustages CLOSED TREE
Backed out changeset 55b963f34eb0 (bug 1639030)
Backed out changeset 0c2d7e8a4131 (bug 1639030)
Backed out changeset 9d82c8fa3d3b (bug 1639030)
2020-06-15 20:36:02 +03:00
Toshihito Kikuchi fb0684d83f Bug 1639030 - Part 3: Roll-up patch to apply remaining mozilla changes to chromium sandbox. r=bobowen
This commit applies patches under security/sandbox/chromium-shim/patches/after_update/.

Depends on D79560

Differential Revision: https://phabricator.services.mozilla.com/D79561
2020-06-15 15:57:13 +00:00
Toshihito Kikuchi 8a6f673311 Bug 1639030 - Part 2: Roll-up of chromium sandbox update and patches to get a running browser. r=bobowen
This commit does:
- Sync files under security/sandbox/chromium/ with Chromium 81.0.4044.138
- Update files under security/sandbox/chromium-shim/
- Apply patches under security/sandbox/chromium-shim/patches/with_update/
- Apply a workaround for Clang's bug to compile filesystem_interception.cc
- Add mozilla::AddWin32kLockdownPolicy to apply MITIGATION_WIN32K_DISABLE before SUBSYS_WIN32K_LOCKDOWN

Depends on D79558

Differential Revision: https://phabricator.services.mozilla.com/D79560
2020-06-15 15:57:03 +00:00
Bob Owen 739da258cc Bug 1557282 Part 1: Take chromium commit c1ce57ea5d31208af589b4839390a44ab20b0c8f. r=handyman,gcp
This adds AddRestrictingRandomSid feature, which fixes our issues with
SetLockdownDefaultDacl, apart from when we are running from a network drive.

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

--HG--
extra : moz-landing-system : lando
2020-03-12 20:39:40 +00:00
Narcis Beleuzu feebca4edf Backed out 4 changesets (bug 1557282) as requested by tjr . CLOSED TREE
Backed out changeset deabd1e1018b (bug 1557282)
Backed out changeset 25e5b5ba8ac3 (bug 1557282)
Backed out changeset 30afcaf2782a (bug 1557282)
Backed out changeset f83095f739e0 (bug 1557282)

--HG--
extra : rebase_source : 1730b805fbd8d0b786f7dcec71aa9c02a8f7a93a
2020-03-12 19:39:27 +02:00
Bob Owen a48bb12597 Bug 1557282 Part 1: Take chromium commit c1ce57ea5d31208af589b4839390a44ab20b0c8f.
This adds AddRestrictingRandomSid feature, which fixes our issues with
SetLockdownDefaultDacl, apart from when we are running from a network drive.

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

--HG--
extra : moz-landing-system : lando
2020-03-12 16:56:48 +00:00
Toshihito Kikuchi d992a091fa Bug 1615401 - Part 3: Use OSInfo::Kernel32Version() to select a thunk resolver. r=bobowen
Cherry-picking Chromium's commit 01c8afd0dc14a1acef383c5f231258d0cfac95e5
to fix the crash caused by Chromium's sandbox code.

The original bug on Chromium side: https://crbug.com/1053805

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

Depends on D65802
2020-03-06 18:52:25 +02:00
Toshihito Kikuchi 866761cd8a Bug 1615401 - Part 2: Keep Chromium's file_version_info_win.cpp updated r=bobowen
Cherry-picking the following commits from Chromium to keep file_version_info_win.cpp
up-to-date.

1. Use StringPiece rather than std::string for Version parsing.
15a9d1733f

2. [Cleanup] Un-const the result of base::Version::GetString()
fde745d058

3. Export Windows file version as base::Version
e93de3a37d

4. Tidy FileVersionInfoWin.
4bb23ded3a

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

Depends on D65744
2020-03-06 22:24:01 +02:00
Michael Forney 4809dfc033 Bug 1611565 - Cherry-pick upstream patch to use public siginfo_t fields r=gcp
Upstream patch:
6bd491daaf%5E%21/#F0

_sifields is a glibc-internal field, and is not available on musl
libc. Instead, use the public-facing fields si_call_addr, si_syscall,
and si_arch, if they are available.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 17:17:18 +00:00
Bob Owen 9e974a273b Bug 1605867: Don't duplicate IPC shared memory when we might fail to launch the process correctly. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D58271

--HG--
extra : moz-landing-system : lando
2019-12-26 19:19:49 +00:00
Sylvestre Ledru 145d349a98 Bug 1577236 - clang-10: Fix a -Wimplicit-int-float-conversion warning in chromium r=bobowen
Fix:
/var/lib/jenkins/workspace/firefox-clang-lld-last/security/sandbox/chromium/base/time/time.h:796:18: error: implicit conversion from 'long' to 'double' changes value from 922337203
  return value > std::numeric_limits<int64_t>::max()
               ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Upstream code is very different now (uses some saturated_cast):
https://chromium.googlesource.com/chromium/src/base/+/master/time/time.h#846

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

--HG--
extra : moz-landing-system : lando
2019-12-09 08:43:16 +00:00
Gian-Carlo Pascutto 98d994f03d Bug 1591117 - Report ENOSYS on statx, but allow membarrier. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D50623

--HG--
extra : moz-landing-system : lando
2019-11-07 09:21:51 +00:00
Bob Owen 23d09ead45 Bug 1565848: Revert latest change to MITIGATION_DLL_SEARCH_ORDER. r=aklotz
This is until any regressions can be fixed, see bug 1568850.

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

--HG--
extra : moz-landing-system : lando
2019-07-25 17:44:24 +00:00
Bob Owen 95b19e37ff Bug 1564899: Make CloseHandleWrapper CHECK a DCHECK on non-Nightly builds. r=handyman
This is because we are hitting it frequently during PolicyBase::OnJobEmpty and
currently we can't work out how this can happen.

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

--HG--
extra : moz-landing-system : lando
2019-07-15 17:19:17 +00:00
Tom Ritter 01f7b56cf8 Bug 1552706 - Update MinGW version and remove MinGW sandbox hacks r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D36218

--HG--
extra : moz-landing-system : lando
2019-06-28 09:53:12 +00:00
Bob Owen 0162cd1ed7 Bug 1552160 Part 2: Roll-up patch to apply remaining mozilla changes to chromium sandbox. r=tabraldes,aklotz,jimm,bobowen
Patches re-applied from security/sandbox/chromium-shim/patches/after_update/.
See patch files for additional commit comments.
2014-11-29 17:12:18 +00:00
Bob Owen 2cad8de361 Bug 1552160 Part 1: Roll-up of chromium sandbox update and mozilla patches to get a running browser. r=jld,aklotz,tjr,bobowen
This updates security/sandbox/chromium/ files to chromium commit 84108231f6e6e0772fb9a4643679ce76aa771e67.

Existing and new patches applied from security/sandbox/chromium-shim/patches/with_update/ to give a compiling and mostly working browser.
See patch files for additional commit comments.

--HG--
rename : security/sandbox/chromium-shim/base/debug/debugging_flags.h => security/sandbox/chromium-shim/base/debug/debugging_buildflags.h
rename : security/sandbox/chromium-shim/base/win/base_features.h => security/sandbox/chromium-shim/base/win/base_win_buildflags.h
2019-06-12 11:10:48 +01:00
David Major 6efaa8b1cd Bug 1523526 - Don't allow CFG on old releases of Windows for arm64 r=bobowen,aklotz
There's a bug in ole32.dll on arm64 versions of Windows prior to 1809, that crashes our content processes if we enable CFG. We've reported the issue, but even if it gets fixed, we can't assume users will have the update.

This patch uses process mitigation policy flags to disable CFG on arm64 before 1809. Based on testing, we only need to do this in the sandbox for child processes, and it's not strictly necessary for the launcher stub to set the flag on the main process. But I've included that anyway as a guard against some yet-undiscovered scenario that might hit the issue and make the browser unusable.

The effects of this patch won't be visible until we actually enable CFG in a subsequent landing.

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

--HG--
extra : moz-landing-system : lando
2019-05-20 17:25:30 +00:00
Coroiu Cristina 55a63d1520 Backed out 2 changesets (bug 1523526, bug 1526443) for Be bustage on Windows AArch on a CLOSED TREE
Backed out changeset 98013639d600 (bug 1526443)
Backed out changeset e8ac4b512f9d (bug 1523526)
2019-05-20 20:21:56 +03:00
David Major 250aff00e7 Bug 1523526 - Don't allow CFG on old releases of Windows for arm64 r=bobowen,aklotz
There's a bug in ole32.dll on arm64 versions of Windows prior to 1809, that crashes our content processes if we enable CFG. We've reported the issue, but even if it gets fixed, we can't assume users will have the update.

This patch uses process mitigation policy flags to disable CFG on arm64 before 1809. Based on testing, we only need to do this in the sandbox for child processes, and it's not strictly necessary for the launcher stub to set the flag on the main process. But I've included that anyway as a guard against some yet-undiscovered scenario that might hit the issue and make the browser unusable.

The effects of this patch won't be visible until we actually enable CFG in a subsequent landing.

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

--HG--
extra : moz-landing-system : lando
2019-05-07 18:37:13 +00:00
Bob Owen 3761608ad2 Bug 1534196: Correct return values from failed brokering. r=jmathies 2019-04-08 08:54:27 +01:00
Bob Owen 36320360f7 Bug 1515088 Part 2: Set LoaderThreads to 1 in the RTL_USER_PROCESS_PARAMETERS structure on child process start-up. r=aklotz 2019-02-08 17:17:52 +00:00
Tom Ritter 77cce78dd3 Bug 1520310 - Backout the patch from Bug 1498695 and cast to void*. r=bobowen
In Bug 1462100 we started casting to void* because mingw doesn't do
automatic conversions like MSVC does.  In Bug 1498695 I backed out that
change because I (mistakenly) thought it wasn't necessary for mingw-clang
when in actuality, I simply wasn't hitting the code path due to
SANDBOX_EXPORTS being defined.

Since we want to _not_ define SANDBOX_EXPORTS I need to put the original
patch back in place.

--HG--
extra : amend_source : a26eec746e7881fa88b963c8dd3c1fa900b6a8b6
2019-01-21 14:13:17 -06:00
Bob Owen f71af67dbf Bug 1481518 part 1: Add aarch64 Windows support to the chromium sandbox code. r=handyman
This patch includes the changes that Microsoft landed for the sandbox along
with other changes to the supporting base files that they depend upon.
2018-12-14 13:07:35 +00:00
Tom Ritter 24a82c667b Bug 1504022 - Backout 1498693 to restore mingw exceptions for __try/__except r=bobowen
mingw-clang, when using SEH exceptions, compile these fine but don't unwind
them properly. When using sj/lj exceptions it can't compile them at all.

--HG--
extra : histedit_source : 4bda121d4d60ab6e7cf51a3d4287261c81904fe2
2018-11-02 13:06:24 -05:00
Tom Ritter 4c8004df52 Bug 1498695 Revert casting to void* (1462100) because mingwclang doesn't need to do that. r=bobowen 2018-10-16 11:33:32 +03:00
Tom Ritter cc01d26509 Bug 1498694 Revert the patch that relaxes the MSVC requirement (1431807) since mingw-clang passes it now r=bobowen 2018-10-12 13:45:49 -05:00
Tom Ritter 8ae788d2db Bug 1498693 - Revert the other part of 1431803, since mingw-clang can handle it now r=bobowen 2018-10-12 13:44:37 -05:00
Tom Ritter 6b740111c1 Bug 1461421 Use OffsetOf to calculate the location of parameters_ rather than making assumptions about the parent class r=bobowen
MozReview-Commit-ID: D7REZiAIMpN

--HG--
extra : rebase_source : 5b320ee658589feec6d95b01448def7eb0a56b69
2018-06-07 13:08:27 -05:00
Tom Ritter e8c4e33bea Bug 1462100 Cast to void* to avoid conversion errors on MinGW, which does not do the automatic conversion like msvc r=bobowen
MozReview-Commit-ID: 8fO9Nu9gaxh

--HG--
extra : rebase_source : 896c58b8050304c6a47dcbd9f7744923a721fa69
2018-05-16 14:18:20 -05:00
Bob Owen f299b6bfc7 Bug 1444699: Remove dynamic load and call for GetUserDefaultLocaleName. r=handyman
This was only required because it is not available on Windows XP, which is no
longer supported. Patch already landed upstream in chromium.
2018-04-24 09:21:51 +01:00
Bob Owen cfaaf3c336 Bug 1449480: Don't crash in opt builds when scoped_handle.cc CloseHandleWrapper fails. r=jimm
I'm not adding a patch to security/sandbox/chromium-shim/patches for this,
because we need to get this fixed ASAP, certainly before we take another update.
2018-03-28 16:07:15 +01:00
Bob Owen af1e9f58c5 Bug 1445167 Part 1: Revert change to make USER_NON_ADMIN a blacklist. r=handyman
This is only used by default in the file content process now and we also have a
FILES_ALLOW_READONLY rule for all paths anyway.
2018-03-20 10:42:05 +00:00
Bob Owen 92db53b861 Bug 1432381: Replace sidestep resolvers with stubs as they are not actually used. r=aklotz
These cause compilation issues for MinGW.
It looks like these are a legacy from the original sandbox code before it was
integrated into chromium.
2018-02-06 08:52:26 +00:00
Tom Ritter 2d53d71b7b Bug 1431803 Disable a specific __try block on MinGW r=bobowen
This function is a technique to name a thread for debugging purposes,
and it always throws an exception (and then continues). On MinGW
we don't want it to throw an exception, so we do nothing.

This means on MinGW we won't get nice thread naming during debugging,
but we'll limp along.

MozReview-Commit-ID: JRKY4wp7sdu

--HG--
extra : rebase_source : 439205d83167dcde5306f9899244e7d336116111
2018-01-19 13:26:22 -06:00
Tom Ritter 2f2511d2e9 Bug 1431797 Correct the capitalization of headers inside the chromium code so MinGW can compile r=bobowen
MozReview-Commit-ID: DFlruq4iIUe

--HG--
extra : rebase_source : a883cb8264292143a90846f02a548c7da68fb168
2018-01-24 14:25:59 -06:00
Tom Ritter 2f8e7d0c85 Bug 1432790 Fix MinGW Sandbox linking error about not being able to find _ReturnAddress() r=bobowen
This reverts 6e41201152dd (Bug 1431621) which compiled but did not link.
It also fixes the original issue by removing the stray \ at the end of the
line that was causing the error.

MozReview-Commit-ID: LgaxYK3EOwR

--HG--
extra : rebase_source : 7de3b5126417ea99ff7fee3a809e556b5a2de4a6
2018-01-23 22:08:21 -06:00
Tom Ritter b009e6cd23 Bug 1432295 Cast GetProcAddress to (void*) r=bobowen
error: invalid conversion from 'FARPROC {aka int (__attribute__((__stdcall__)) *)()}' to 'void*' [-fpermissive]

According to http://stackoverflow.com/questions/13958081/, msvc does the fixup

MozReview-Commit-ID: HTghe9uL0EP

--HG--
extra : rebase_source : b083b9247aa07ba58c23b3b3a2e5b19c7393dafb
2018-01-23 09:15:44 -06:00
Tom Ritter 7ae3c27af4 Bug 1432239 Declare operator new [](size_t, sandbox::AllocationType, void*) r=bobowen
MozReview-Commit-ID: GCKj5Ao2Y2n

--HG--
extra : rebase_source : d3f9b5cf14f60ba4c51375931b3de5b71b8312cc
2017-03-08 19:16:46 +00:00