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

589 Коммитов

Автор SHA1 Сообщение Дата
Gian-Carlo Pascutto b37cb7e592 Bug 1455498 - Whitelist directories passed in LD_LIBRARY_PATH. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D70554
2020-05-07 15:40:42 +00:00
Jeff Gilbert cb26f272b1 Bug 1623885 - Add "subsystem" to Mesa sandbox policy to fix libdrm-2.4.101+. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D70579

--HG--
extra : moz-landing-system : lando
2020-04-12 21:21:32 +00:00
Jonathan Kew 3ec88e7ea4 Bug 1495900 - Add fontconfig cache directories to content-process sandbox read paths. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D70170

--HG--
extra : moz-landing-system : lando
2020-04-11 02:28:35 +00:00
Gabriele Svelto ab22b90deb Bug 1614933 - Ensure that glibc's lazy initializers run before we enable the content process sandbox on Linux; r=jld
Differential Revision: https://phabricator.services.mozilla.com/D63471

--HG--
extra : moz-landing-system : lando
2020-04-08 06:55:40 +00:00
Michael Froman fce38bc562 Bug 1626385 - allow shmem in linux sandbox for socket process to support profiler. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D69582

--HG--
extra : moz-landing-system : lando
2020-04-03 15:28:55 +00:00
Jed Davis bfc8e3cd04 Bug 1624743 -- Allow intra-process kcmp with KCMP_FILE in Linux content sandbox for amdgpu. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D68669

--HG--
extra : moz-landing-system : lando
2020-03-30 16:13:59 +00:00
Jed Davis c5f7ab0639 Bug 1622728 - Allow file seals in content process sandbox policy, for Wayland. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D68664

--HG--
extra : moz-landing-system : lando
2020-03-30 16:14:17 +00:00
Jed Davis aecdf7eb30 Bug 1604834 - Assign thread names during the sandbox launch process. r=gcp
We've had some bugs where the sandboxed child process and/or the chroot
helper process deadlocks during launch, often reported by end users,
and it's confusing to have the mysterious hanging task inherit the name
of the launching thread; this patch fixes that by giving them more
informative names.

`prctl(PR_SET_NAME, ...)` is used directly, instead of via one of our
wrappers for it, to avoid the possibility of async signal unsafe
operations.

This doesn't name the pre-exec child process in the cases where regular
`fork()` is used, but as far as I know we haven't had any bugs (yet?)
where that would matter.

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

--HG--
extra : moz-landing-system : lando
2020-03-25 14:13:18 +00:00
Brindusan Cristian 4646c1f41f Backed out 2 changesets (bug 1614933) for bc failures at browser_tabicon_after_bg_tab_crash.js.
Backed out changeset 59503d3a702f (bug 1614933)
Backed out changeset 578c8ba9598f (bug 1614933)
2020-03-22 17:30:07 +02:00
Gabriele Svelto 9186cc2ed8 Bug 1614933 - Ensure that glibc's lazy initializers run before we enable the content process sandbox on Linux; r=jld
Differential Revision: https://phabricator.services.mozilla.com/D63471

--HG--
extra : moz-landing-system : lando
2020-03-22 13:03:36 +00:00
Simon Giesecke 92497d5662 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in security. r=rrelyea
Differential Revision: https://phabricator.services.mozilla.com/D65499

--HG--
extra : moz-landing-system : lando
2020-03-16 10:56:56 +00:00
Bogdan Tara c60fd3fdd2 Backed out 4 changesets (bug 1613985) for causing build bustages CLOSED TREE
Backed out changeset fba0caac746c (bug 1613985)
Backed out changeset 8605d7a19107 (bug 1613985)
Backed out changeset 41e858fbf235 (bug 1613985)
Backed out changeset 847433cf1e0a (bug 1613985)
2020-03-16 12:41:41 +02:00
Simon Giesecke 554d54a0be Bug 1613985 - Use default for equivalent-to-default constructors/destructors in security. r=rrelyea
Differential Revision: https://phabricator.services.mozilla.com/D65499

--HG--
extra : moz-landing-system : lando
2020-03-16 09:57:45 +00:00
Jed Davis 14f4c37266 Bug 1621808 - Fix crash messages for seccomp-bpf failures. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D66524

--HG--
extra : moz-landing-system : lando
2020-03-12 08:28:39 +00:00
Jed Davis 07db95a267 Bug 1621686 - Fix socket process sandbox's handling of prctl to prevent crash on kernels before 3.17. r=gcp,mjf
The special handling of PR_SET_NO_NEW_PRIVS can't be overridden with
Allow(); otherwise every thread in the process will repeatedly apply
copies of the policy to itself until it reaches whatever limits the
kernel imposes, and then we crash so we don't continue execution
seemingly unsandboxed.  (See also bug 1257361.)

The prctl policy for the socket process is still allow-all after this
patch; it just prevents crashing the socket process on startup on
kernels before 3.17 (which don't support applying the policy atomically
to all threads).

This patch also adds a comment to try to document this failure mode.

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

--HG--
extra : moz-landing-system : lando
2020-03-12 13:46:46 +00:00
Bogdan Tara fb2b3d4e41 Backed out 2 changesets (bug 1614933) for busages complaining about IdleSchedulerChild.cpp CLOSED TREE
Backed out changeset ff92f800a74e (bug 1614933)
Backed out changeset 5cee8f603ae4 (bug 1614933)
2020-03-10 17:21:55 +02:00
Gabriele Svelto 49040b8671 Bug 1614933 - Ensure that glibc's lazy initializers run before we enable the content process sandbox on Linux; r=jld
Differential Revision: https://phabricator.services.mozilla.com/D63471

--HG--
extra : moz-landing-system : lando
2020-03-10 14:59:22 +00:00
Michael Froman 98301e7475 Bug 1608558 - pt4 - use security.sandbox.socket.process.level for linux socket process sandbox. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D63716

--HG--
extra : moz-landing-system : lando
2020-03-09 14:57:13 +00:00
Michael Froman 5e124284d9 Bug 1608558 - pt3 - add EvaluateSocketCall and missing cases to EvaluateSyscall for Socket process sandbox. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D62445

--HG--
extra : moz-landing-system : lando
2020-03-09 14:56:43 +00:00
Michael Froman 40fb8ff87d Bug 1608558 - pt2 - add SandboxBrokerPolicyFactory::GetSocketProcessPolicy to allow access to certs. r=jld,gcp
Differential Revision: https://phabricator.services.mozilla.com/D62444

--HG--
extra : moz-landing-system : lando
2020-03-09 14:56:24 +00:00
Michael Froman 140e0771d3 Bug 1608558 - pt1 - add linux sandboxing to socket process. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D60014

--HG--
extra : moz-landing-system : lando
2020-03-09 14:56:03 +00:00
Sylvestre Ledru 3c97d64247 Bug 1616780 - Also add __NR_sched_setattr to the list of thread function r=jld
Differential Revision: https://phabricator.services.mozilla.com/D64736

--HG--
extra : moz-landing-system : lando
2020-02-29 04:14:52 +00:00
Sylvestre Ledru a2d5cb90b0 Bug 1616780 - Add __NR_sched_getattr to the list of thread function r=jld
Introduced in:
8aeca4fa64

Shipping in glib 2.63.5 (available in Debian experimental)

Thanks to @padenot for the suggestion!

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

--HG--
extra : moz-landing-system : lando
2020-02-24 22:04:16 +00:00
Emilio Cobos Álvarez 8991187005 Bug 1614535 - Whitelist pread64 in the common policy. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D62468

--HG--
extra : moz-landing-system : lando
2020-02-11 18:20:34 +00:00
Emilio Cobos Álvarez aa1769613f Bug 1613991 - Register FS brokers with the profiler. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D62073

--HG--
extra : moz-landing-system : lando
2020-02-07 21:43:25 +00:00
David Major c8447603c3 Bug 1614003 - Remove unused file mfbt/NullPtr.h r=froydnj
C++14 has a replacement anyway.

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

--HG--
extra : moz-landing-system : lando
2020-02-07 19:08:17 +00:00
Emilio Cobos Álvarez 256c124f94 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez aa3a695712 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:20 +00:00
Sylvestre Ledru c521758c5e Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2020-01-09 21:50:11 +00:00
Emilio Cobos Álvarez 43934482ac Bug 1605291 - Fix non-chrooted processes after bug 1603999. r=gsvelto
Bug 1603999 changed the environment so that whether you can enter the chroot is
passed as the first character in the environment variable. This caused all
content processes that don't enter the chroot to crash. This can happen
trivially with any sandbox level < 4.

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

--HG--
extra : moz-landing-system : lando
2019-12-20 21:19:20 +00:00
Chris Peterson 406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

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

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Thinker Li d5fb470caa Bug 1603999 - Make mozsandbox being preloaded for the fork server. r=gsvelto
- make the fork server use the same sandbox level as content processes to make preloading work correctly.
 - pass |canChroot| through env instead of hard coding.

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

--HG--
extra : moz-landing-system : lando
2019-12-19 15:47:48 +00:00
Emilio Cobos Álvarez 36164b7b54 Bug 1600734 - Fix content sandbox level 1 on linux. r=jld,gcp
Right now we crash on socketpair here:

https://searchfox.org/mozilla-central/rev/04d8e7629354bab9e6a285183e763410860c5006/ipc/chromium/src/chrome/common/ipc_channel_posix.cc#261

As there is no broker.

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

--HG--
extra : moz-landing-system : lando
2019-12-16 22:35:03 +00:00
Gabriele Svelto 5dc21d568c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:17:57 +00:00
Thinker Li e9554bb05d Bug 1470591 - Part 2: Provide methods to recreate a delegated forker. r=gsvelto
With a fork server, the parameters to fork a new content process are
passed through a socket.  This patch does following tasks to adapt
sandbox to work with a fork server,

 - passing a FD of a chroot server,
 - passing flags of SandboxFork, and
 - setting LaunchOptions and its fork_delegate field at a fork server.

Depends on D46878

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

--HG--
extra : moz-landing-system : lando
2019-12-05 00:03:52 +00:00
Bogdan Tara 3732e1f17c Backed out 6 changesets (bug 1470591) for test_punycodeURIs & test_nsIProcess* crashes CLOSED TREE
Backed out changeset 3ca19f8f388e (bug 1470591)
Backed out changeset f80db6e63169 (bug 1470591)
Backed out changeset cbac2d7dfe42 (bug 1470591)
Backed out changeset daad4d736ec0 (bug 1470591)
Backed out changeset ca1b804d404a (bug 1470591)
Backed out changeset a10772f780f7 (bug 1470591)
2019-12-04 00:53:14 +02:00
Thinker Li 105aefb6e5 Bug 1470591 - Part 2: Provide methods to recreate a delegated forker. r=gsvelto
With a fork server, the parameters to fork a new content process are
passed through a socket.  This patch does following tasks to adapt
sandbox to work with a fork server,

 - passing a FD of a chroot server,
 - passing flags of SandboxFork, and
 - setting LaunchOptions and its fork_delegate field at a fork server.

Depends on D46878

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

--HG--
extra : moz-landing-system : lando
2019-12-03 19:20:04 +00:00
Sylvestre Ledru 8d2f0d1b1f Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-11-26 14:35:02 +00:00
Jed Davis 0daa28d9cb Bug 1294286 - Filter clock IDs in clock_getres sandbox rule. r=gcp
The clockid_t type on Linux has a space of values with encode a pid and
refer to various measures of another process's CPU usage; clock_getres
would, thereby, allow probing whether other processes exist.  This is
a relatively small information leak into the sandboxes, but there's no
reason to allow it.

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

--HG--
extra : moz-landing-system : lando
2019-11-21 08:02:06 +00:00
Jed Davis a37e31e914 Bug 1598040 - Filter clock IDs in clock_nanosleep sandbox rule. r=gcp
The `clockid_t` type on Linux has a space of values which encode a pid
and allow measuring the CPU usage of other processes; we don't want to
allow sandboxed processes to do that.

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

--HG--
extra : moz-landing-system : lando
2019-11-21 08:03:17 +00:00
Emilio Cobos Álvarez 54d06f7dfe Bug 1597792 - Allow clock_nanosleep in the sandbox filter. r=gcp
It seems newer glibc versions implement nanosleep() in terms of
clock_nanosleep(), which broke the profiler due to the sandbox rules
whitelisting the former but not the later.

Unfortunate that the profiler will fail in old Firefox versions though... :/

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

--HG--
extra : moz-landing-system : lando
2019-11-20 11:22:11 +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
Gijs Kruitbosch 8af91551b6 Bug 1585732 - use staticprefs for media.cubeb.sandbox, r=haik
Differential Revision: https://phabricator.services.mozilla.com/D50955

--HG--
extra : moz-landing-system : lando
2019-10-29 23:33:45 +00:00
shravanrn@gmail.com bb7e97ff6a Bug 1575985 part 2 - Allow RW access to /dev/null in content sandbox r=gcp
This is needed by lucet to run WASM sandboxed libraries.

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

--HG--
extra : moz-landing-system : lando
2019-09-30 21:57:34 +00:00
Ryan Alderete 2e2b52b880 Bug 1572846 - Update Clearkey to use NSS for decryption instead of OpenAES r=bryce,jld
Clearkey previously relied on OpenAES to do its encryption.  In order to
facilitate future changes and the need for CBC support, switch to NSS, which
should be more flexible and actively maintained.

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

--HG--
extra : moz-landing-system : lando
2019-09-05 19:19:06 +00:00
Gijs Kruitbosch 871832fcf9 Bug 1575564 - avoid non-mainthread use of NS_GetSpecialDirectory in linux sandboxbroker, r=jld,gcp
Differential Revision: https://phabricator.services.mozilla.com/D42951

--HG--
extra : moz-landing-system : lando
2019-08-22 16:37:18 +00:00
Mike Hommey 66d7fe943e Bug 1575420 - Replace MOZ_WIDGET_TOOLKIT value of "gtk3" with "gtk". r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D42765

--HG--
extra : moz-landing-system : lando
2019-08-21 12:25:42 +00:00
Gian-Carlo Pascutto 8b7a11d51c Bug 1573578 - Whitelist brk syscall if jemalloc is disabled. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D41998

--HG--
extra : moz-landing-system : lando
2019-08-14 22:50:51 +00:00
Jed Davis 660156542f Bug 1559368 - When determining sandbox capabilities, check for the specific X11 socket that would be used. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D40915

--HG--
extra : moz-landing-system : lando
2019-08-07 22:34:50 +00:00
Gian-Carlo Pascutto c43f365472 Bug 1565996 - Handle relative paths in linker config parsing. r=jld
Differential Revision: https://phabricator.services.mozilla.com/D38634

--HG--
extra : moz-landing-system : lando
2019-07-26 14:03:53 +00:00