Commit Graph

49 Commits

Author SHA1 Message Date
Bob Owen
94bf554716 Bug 1337331 Part 1: Update security/sandbox/chromium/ to commit b169b9a1cc402573843e8c952af14c4e43487e91. r=jld, r=aklotz, r=jimm
Also inclues follow-up to remove mitigations that require Windows 10 SDK.

MozReview-Commit-ID: HwqM4noIHmy
2017-03-29 14:23:17 +01:00
Carsten "Tomcat" Book
0a1fc914ce Backed out changeset d9872fdd25f8 (bug 1337331) for causing build problems for others + on request on bob 2017-03-24 11:24:13 +01:00
Bob Owen
8995d28500 Bug 1337331 Part 1: Update security/sandbox/chromium/ to commit b169b9a1cc402573843e8c952af14c4e43487e91. r=jld, r=aklotz 2017-03-23 10:29:05 +00:00
Jed Davis
f0666046d6 Bug 1286865 - Step 2: Add XPCOM bindings for sandbox syscall reporter. r=gcp r=glandium
MozReview-Commit-ID: GERRsOJ7H2w

--HG--
extra : rebase_source : 8ff688150ccf417a266a663ed0973d4850f51e63
2017-01-30 18:50:41 -07:00
Jed Davis
f2fa27edca Bug 1286865 - Step 1: Gather syscall info from SIGSYS handlers into the parent process. r=gcp
MozReview-Commit-ID: 8GfFo4xso65

--HG--
extra : rebase_source : 1596a79d65d30dc72d8b84fc4f1639de377f554a
2017-01-30 18:49:53 -07:00
Jed Davis
a2d3e4e9f2 Bug 1313218 - Preload libmozsandbox.so in child processes on Linux. r=tedd r=billm r=glandium
Preloading libmozsandbox allows the symbol interpositions used by
sandboxing to be defined there instead of statically linked into the
executable; this patch also does that.

MozReview-Commit-ID: FL1QWLSKA0S

--HG--
rename : security/sandbox/linux/interpose/SandboxHooks.cpp => security/sandbox/linux/SandboxHooks.cpp
2016-11-04 18:16:05 -06:00
Jed Davis
76488739a9 Bug 1272062 - Merge security/sandbox/linux/common into its parent directory. r=gcp
Now that SandboxInfo is always part of libmozsandbox, instead of being
in different places depending on widget, it doesn't need to be a
separate directory anymore.

Also updates a few comments that referenced it.

--HG--
rename : security/sandbox/linux/common/LinuxSched.h => security/sandbox/linux/LinuxSched.h
rename : security/sandbox/linux/common/SandboxInfo.cpp => security/sandbox/linux/SandboxInfo.cpp
rename : security/sandbox/linux/common/SandboxInfo.h => security/sandbox/linux/SandboxInfo.h
2016-10-27 22:06:00 +02:00
Jed Davis
67a039045c Bug 1268733 - Move Linux sandboxing code back out to libmozsandbox.so. r=gcp r=glandium 2016-10-26 16:57:24 -06:00
Jed Davis
dce9969411 Bug 1268733 - Move sandbox interposition shims to their own static library. r=gcp r=glandium
This way they'll continue to be at the beginning of the symbol search
path after mozsandbox returns to being a shared library instead of
statically linked into plugin-container.

--HG--
rename : security/sandbox/linux/SandboxHooks.cpp => security/sandbox/linux/interpose/SandboxHooks.cpp
2016-10-26 16:57:18 -06:00
Bob Owen
d453628509 Bug 1287426 Part 3: Update security/sandbox/chromium/ to commit 4ec79b7f2379a60cdc15599e93255c0fa417f1ed. r=aklotz, r=jld
MozReview-Commit-ID: 14eHMsYZznA
2016-09-06 08:57:21 +01:00
Tom Tromey
5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Alexandre Lissy
c6be1d0d13 Bug 1274826 - Bypass building SandboxHooks on Gonk r=jld
MozReview-Commit-ID: 3TVdcY7aXvW

--HG--
extra : rebase_source : b734c54ad4e7b8fff384f399b84014410b4cf719
2016-05-26 01:02:25 +02:00
Chris Peterson
353ee65255 Bug 1272513 - Part 1: Suppress -Wshadow warnings-as-errors in some directories. r=glandium 2016-05-11 00:00:01 -07:00
Julian Hector
3871240519 Bug 1176099 - Add hooks for sigprocmask/pthread_sigmask. r=jld r=glandium 2016-04-21 13:17:50 +00:00
Daniel Holbert
bda0bd02db Bug 1253194: Suppress -Wimplicit-fallthrough clang warning for intentional fallthrough in icu_utf.cc (which is imported code). r=bobowen 2016-03-04 09:00:40 -08:00
Jed Davis
bd859174ac Bug 930258 - Part 1: The file broker, and unit tests for it. r=kang f=froydnj 2015-10-07 22:13:08 -07:00
Nicholas Nethercote
f44287005f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.

--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
2015-08-27 20:44:53 -07:00
Jed Davis
fc9b22c883 Bug 1181704 - Use chromium SafeSPrintf for sandbox logging. r=gdestuynder r=glandium
This gives us a logging macro that's safe to use in async signal context
(cf. bug 1046210, where we needed this and didn't have it).

This patch also changes one of the format strings to work with
SafeSPrintf's format string dialect; upstream would probably take a
patch to handle those letters, but this is easier.
2015-07-09 12:09:00 +02:00
Wes Kocher
c00da5ced5 Backed out 2 changesets (bug 1181704) for static build bustage CLOSED TREE
Backed out changeset fbf7aca43c3a (bug 1181704)
Backed out changeset 8864c0587ced (bug 1181704)
2015-07-13 16:51:17 -07:00
Jed Davis
60984b0ab1 Bug 1181704 - Use chromium SafeSPrintf for sandbox logging. r=kang r=glandium
This gives us a logging macro that's safe to use in async signal context
(cf. bug 1046210, where we needed this and didn't have it).

This patch also changes one of the format strings to work with
SafeSPrintf's format string dialect; upstream would probably take a
patch to handle those letters, but this is easier.
2015-07-13 16:17:58 -07:00
Jed Davis
5e4e0f9184 Bug 1055310 - Step 2: Move SIGSYS handling to Chromium TrapRegistry. r=kang
This is more complicated than I'd like it to be, because we don't have
a good way to combine a specific trap function's knowledge that we want
to get a crash dump with the SIGSYS handler's copy of the unprocessed
signal info (which breakpad wants).  The bpf_dsl interface requires a
specific trap function type (via the TrapRegistry superclass), so even
if we implement our own registry we can't change what's passed to it.
Normally we could use thread-local storage to get around that, but it's
not async signal safe.

As a result there is an imperfect compromise: the trap function returns
a failure with ENOSYS, Chromium's SIGSYS handler writes it into the
context, our SIGSYS handler reads it back out and uses a copy of
the original signal context for the crash dump.  Other error codes
(and returning ENOSYS via the seccomp-bpf policy itself) are handled
normally.
2015-06-05 15:17:35 -07:00
Jed Davis
3bd337c32c Bug 1055310 - Step 1: Convert seccomp-bpf policies to Chromium PolicyCompiler. r=kang
This completely rewrites SandboxFilter.cpp and removes SandboxAssembler.
System calls are now loosely grouped by what they do, now that order
doesn't matter, and most of the intersection the content and media
plugin whitelists is moved into a common superclass.  Hopefully this
improves the readability and comprehensibility of the syscall policies.

Also, the macros that take the syscall name are gone, because a plain
case label usually suffices now (the CASES_FOR_thing macros are a little
unsightly, but they're relatively simple), and at one point we saw
strange macro expansion issues with system header files that #define'd
some syscall names.

The signal handling is not migrated yet, so Trap() actions can't be used
yet; the next patch will take care of that, and to keep the intermediate
state working there's a minimal shim.

Bonus fix: non-const global variables use the "g" prefix; "s" is for
static class members and static variables in a function (where the
default is to allocate a separate copy per instance/activation).
2015-06-05 15:17:32 -07:00
Jed Davis
89c80effa2 Bug 1154184 - Don't use Linux sandbox gtest dir if not building tests. r=gps 2015-04-24 17:36:08 -07:00
Jed Davis
ba1cc023b7 Bug 1151607 - Step 2: Apply net/ipc namespace separation and chroot to media plugins. r=kang
This needs more unit tests for the various pieces of what's going on
here (LinuxCapabilities, SandboxChroot, UnshareUserNamespace()) but
that's nontrivial due to needing a single-threaded process -- and
currently they can't be run on Mozilla's CI anyway due to needing user
namespaces, and local testing can just try using GMP and manually
inspecting the child process.  So that will be a followup.
2015-04-10 18:05:19 -07:00
Jed Davis
32cb9ee32d Bug 1151607 - Step 1: Add Linux sandboxing hook for when child processes are still single-threaded. r=kang r=bent
This means that B2G plugin-container must (dynamically) link against
libmozsandbox in order to call into it before initializing Binder.
(Desktop Linux plugin-container already contains the sandbox code.)
2015-04-10 18:05:19 -07:00
Bob Owen
a887f0edbd Bug 1102195 Part 1: Update Chromium sandbox code to commit df7cc6c04725630dd4460f29d858a77507343b24. r=aklotz, r=jld 2015-02-11 08:22:02 +00:00
Bob Owen
d1e58e9137 Bug 1102215: Move security/sandbox/chromium/base/shim/ to new directory security/sandbox/chromium-shim/ r=ted
--HG--
rename : security/sandbox/chromium/base/shim/base/gtest_prod_util.h => security/sandbox/chromium-shim/base/gtest_prod_util.h
rename : security/sandbox/chromium/base/shim/base/logging.cpp => security/sandbox/chromium-shim/base/logging.cpp
rename : security/sandbox/chromium/base/shim/base/strings/string_piece.h => security/sandbox/chromium-shim/base/strings/string_piece.h
rename : security/sandbox/chromium/base/shim/base/third_party/nspr/prtime.h => security/sandbox/chromium-shim/base/third_party/nspr/prtime.h
rename : security/sandbox/chromium/base/shim/base/third_party/nspr/prtypes.h => security/sandbox/chromium-shim/base/third_party/nspr/prtypes.h
rename : security/sandbox/chromium/base/shim/base/threading/thread_local_storage.h => security/sandbox/chromium-shim/base/threading/thread_local_storage.h
rename : security/sandbox/chromium/base/shim/base/tracked_objects.h => security/sandbox/chromium-shim/base/tracked_objects.h
rename : security/sandbox/chromium/base/shim/base/win/registry.h => security/sandbox/chromium-shim/base/win/registry.h
rename : security/sandbox/chromium/base/shim/sdkdecls.h => security/sandbox/chromium-shim/base/win/sdkdecls.h
rename : security/sandbox/win/src/logging/loggingCallbacks.h => security/sandbox/chromium-shim/sandbox/win/loggingCallbacks.h
rename : security/sandbox/win/src/logging/loggingTypes.h => security/sandbox/chromium-shim/sandbox/win/loggingTypes.h
rename : security/sandbox/win/src/logging/sandboxLogging.cpp => security/sandbox/chromium-shim/sandbox/win/sandboxLogging.cpp
rename : security/sandbox/win/src/logging/sandboxLogging.h => security/sandbox/chromium-shim/sandbox/win/sandboxLogging.h
2015-01-22 08:37:30 +00:00
Bob Owen
a7e3f06626 Bug 1102211: Move security/sandbox/build/ into security/sandbox/chromium/ r=ted
--HG--
rename : security/sandbox/build/build_config.h => security/sandbox/chromium/build/build_config.h
rename : security/sandbox/chromium-commit-status.txt => security/sandbox/moz-chromium-commit-status.txt
2015-01-22 08:37:30 +00:00
Carsten "Tomcat" Book
0db90d7550 Backed out changeset 4ccaf5ae9ced (bug 1102211) for bustage on a CLOSED TREE
--HG--
rename : security/sandbox/chromium/build/build_config.h => security/sandbox/build/build_config.h
rename : security/sandbox/moz-chromium-commit-status.txt => security/sandbox/chromium-commit-status.txt
2015-01-22 10:25:39 +01:00
Carsten "Tomcat" Book
8347439402 Backed out changeset 43f1f9eef449 (bug 1102215)
--HG--
rename : security/sandbox/chromium-shim/base/gtest_prod_util.h => security/sandbox/chromium/base/shim/base/gtest_prod_util.h
rename : security/sandbox/chromium-shim/base/logging.cpp => security/sandbox/chromium/base/shim/base/logging.cpp
rename : security/sandbox/chromium-shim/base/strings/string_piece.h => security/sandbox/chromium/base/shim/base/strings/string_piece.h
rename : security/sandbox/chromium-shim/base/third_party/nspr/prtime.h => security/sandbox/chromium/base/shim/base/third_party/nspr/prtime.h
rename : security/sandbox/chromium-shim/base/third_party/nspr/prtypes.h => security/sandbox/chromium/base/shim/base/third_party/nspr/prtypes.h
rename : security/sandbox/chromium-shim/base/threading/thread_local_storage.h => security/sandbox/chromium/base/shim/base/threading/thread_local_storage.h
rename : security/sandbox/chromium-shim/base/tracked_objects.h => security/sandbox/chromium/base/shim/base/tracked_objects.h
rename : security/sandbox/chromium-shim/base/win/registry.h => security/sandbox/chromium/base/shim/base/win/registry.h
rename : security/sandbox/chromium-shim/base/win/sdkdecls.h => security/sandbox/chromium/base/shim/sdkdecls.h
rename : security/sandbox/chromium-shim/sandbox/win/loggingCallbacks.h => security/sandbox/win/src/logging/loggingCallbacks.h
rename : security/sandbox/chromium-shim/sandbox/win/loggingTypes.h => security/sandbox/win/src/logging/loggingTypes.h
rename : security/sandbox/chromium-shim/sandbox/win/sandboxLogging.cpp => security/sandbox/win/src/logging/sandboxLogging.cpp
rename : security/sandbox/chromium-shim/sandbox/win/sandboxLogging.h => security/sandbox/win/src/logging/sandboxLogging.h
2015-01-22 10:25:03 +01:00
Bob Owen
ec569fff70 Bug 1102215: Move security/sandbox/chromium/base/shim/ to new directory security/sandbox/chromium-shim/ r=ted
--HG--
rename : security/sandbox/chromium/base/shim/base/gtest_prod_util.h => security/sandbox/chromium-shim/base/gtest_prod_util.h
rename : security/sandbox/chromium/base/shim/base/logging.cpp => security/sandbox/chromium-shim/base/logging.cpp
rename : security/sandbox/chromium/base/shim/base/strings/string_piece.h => security/sandbox/chromium-shim/base/strings/string_piece.h
rename : security/sandbox/chromium/base/shim/base/third_party/nspr/prtime.h => security/sandbox/chromium-shim/base/third_party/nspr/prtime.h
rename : security/sandbox/chromium/base/shim/base/third_party/nspr/prtypes.h => security/sandbox/chromium-shim/base/third_party/nspr/prtypes.h
rename : security/sandbox/chromium/base/shim/base/threading/thread_local_storage.h => security/sandbox/chromium-shim/base/threading/thread_local_storage.h
rename : security/sandbox/chromium/base/shim/base/tracked_objects.h => security/sandbox/chromium-shim/base/tracked_objects.h
rename : security/sandbox/chromium/base/shim/base/win/registry.h => security/sandbox/chromium-shim/base/win/registry.h
rename : security/sandbox/chromium/base/shim/sdkdecls.h => security/sandbox/chromium-shim/base/win/sdkdecls.h
rename : security/sandbox/win/src/logging/loggingCallbacks.h => security/sandbox/chromium-shim/sandbox/win/loggingCallbacks.h
rename : security/sandbox/win/src/logging/loggingTypes.h => security/sandbox/chromium-shim/sandbox/win/loggingTypes.h
rename : security/sandbox/win/src/logging/sandboxLogging.cpp => security/sandbox/chromium-shim/sandbox/win/sandboxLogging.cpp
rename : security/sandbox/win/src/logging/sandboxLogging.h => security/sandbox/chromium-shim/sandbox/win/sandboxLogging.h
2015-01-22 08:37:30 +00:00
Bob Owen
2b11d85b9b Bug 1102211: Move security/sandbox/build/ into security/sandbox/chromium/ r=ted
--HG--
rename : security/sandbox/build/build_config.h => security/sandbox/chromium/build/build_config.h
rename : security/sandbox/chromium-commit-status.txt => security/sandbox/moz-chromium-commit-status.txt
2015-01-22 08:37:30 +00:00
Jed Davis
114cf4fb41 Bug 1108759 - Fix B2G no-optimization builds. r=glandium 2014-12-10 16:17:47 -08:00
Jed Davis
1b16fc180f Bug 1101170 - Move Linux sandbox code into plugin-container on desktop. r=kang r=glandium
Specifically:
* SandboxCrash() uses internal Gecko interfaces, so stays in libxul.
* SandboxInfo moves to libxul from libmozsandbox, which no longer exists.
* Where libxul calls Set*Sandbox(), it uses weak symbols.
* Everything remains as it was on mobile.
2014-11-24 15:22:13 -08:00
Jed Davis
2fdd7150c1 Bug 1101170 - Move sandbox status info into a separate module. r=kang r=glandium
This changes the interface so that the code which determines the flags
can live in one place, but checking the flags doesn't need to call into
another library.

Also removes the no-op wrappers for Set*Sandbox when disabled at build
time; nothing used them, one of them was unusable due to having the wrong
type, and all they really accomplish is allowing sloppiness with ifdefs
(which could hide actual mistakes).
2014-11-24 15:22:13 -08:00
Trevor Saunders
4728b78382 bug 1062567 - prevent gcc lto builds from dropping SyscallAsm on the floor r=froydnj 2014-09-15 19:46:14 -04:00
Jed Davis
af04cea2d8 Bug 1059038 - Move mozilla::unused from xpcom/glue to mfbt. r=Waldo
--HG--
rename : xpcom/glue/unused.cpp => mfbt/unused.cpp
rename : xpcom/glue/unused.h => mfbt/unused.h
2014-08-29 10:11:00 +02:00
Mike Hommey
4b99580194 Bug 1059113 - Use templates for shared libraries and frameworks. r=gps
Also force to use the existing template for XPCOM components.
2014-09-04 09:04:45 +09:00
Mike Hommey
ed70c5f377 Bug 1041941 - Use templates for programs, simple programs, libraries and C++ unit tests. r=gps 2014-09-03 14:10:54 +09:00
Jed Davis
3f1e2a85b6 Bug 1041886 - Fix no-opt-only build bustage caused by mozilla::unused. r=glandium
See also bug 1059038.
2014-08-26 19:23:44 -07:00
Jed Davis
3ae6c90876 Bug 1054616 - Clean up logging-related shims for Linux sandboxing. r=kang 2014-08-26 13:54:16 -07:00
Jed Davis
23c21aa709 Bug 1041886 - Separate Linux sandbox code into its own shared library. r=kang r=glandium
This creates libmozsandbox.so on builds that use sandboxing
(MOZ_CONTENT_SANDBOX or MOZ_GMP_SANDBOX).

The unavoidably libxul-dependent parts, for invoking the crash reporter
and printing the JS context, are separated into glue/SandboxCrash.cpp
and invoked via a callback.
2014-08-26 13:54:09 -07:00
Jed Davis
ebb89f61f4 Bug 920372 - Use Chromium seccomp-bpf compiler to dynamically build sandbox program. r=kang 2014-05-20 18:37:53 -07:00
Jed Davis
5ddfd55b71 Bug 985227 - Part 1: Move the seccomp filter into its own translation unit. r=kang
--HG--
rename : security/sandbox/linux/seccomp_filter.h => security/sandbox/linux/SandboxFilter.cpp
2014-03-20 10:19:42 -04:00
Mike Hommey
2812d11fce Bug 939632 - Remove LIBRARY_NAME for leaf libraries. r=gps
Landing on a CLOSED TREE.
2013-11-19 11:50:54 +09:00
Mike Hommey
e06d795c71 Bug 939074 - Remove most LIBXUL_LIBRARY. rs=gps 2013-11-19 11:48:10 +09:00
Mike Hommey
e80e877ab7 Bug 939044 - Remove most definitions of MODULE. r=mshal 2013-11-19 11:47:39 +09:00
Mike Hommey
ffe0380912 Bug 935881 - Use FINAL_LIBRARY for all (fake) libraries that end up linked in a single other library. r=gps 2013-11-19 11:47:14 +09:00
Brian R. Bondy
de45bd4422 Bug 922756 - Build config for Chromium sandbox. r=bsmedberg
--HG--
rename : security/sandbox/LICENSE => security/sandbox/linux/LICENSE
rename : security/sandbox/Makefile.in => security/sandbox/linux/Makefile.in
rename : security/sandbox/Sandbox.cpp => security/sandbox/linux/Sandbox.cpp
rename : security/sandbox/Sandbox.h => security/sandbox/linux/Sandbox.h
rename : security/sandbox/android_arm_ucontext.h => security/sandbox/linux/android_arm_ucontext.h
rename : security/sandbox/android_i386_ucontext.h => security/sandbox/linux/android_i386_ucontext.h
rename : security/sandbox/android_ucontext.h => security/sandbox/linux/android_ucontext.h
rename : security/sandbox/arm_linux_syscalls.h => security/sandbox/linux/arm_linux_syscalls.h
rename : security/sandbox/linux_seccomp.h => security/sandbox/linux/linux_seccomp.h
rename : security/sandbox/linux_syscalls.h => security/sandbox/linux/linux_syscalls.h
rename : security/sandbox/moz.build => security/sandbox/linux/moz.build
rename : security/sandbox/seccomp_filter.h => security/sandbox/linux/seccomp_filter.h
rename : security/sandbox/x86_32_linux_syscalls.h => security/sandbox/linux/x86_32_linux_syscalls.h
rename : security/sandbox/x86_64_linux_syscalls.h => security/sandbox/linux/x86_64_linux_syscalls.h
2013-10-28 14:54:36 -07:00