Commit Graph

314 Commits

Author SHA1 Message Date
Jed Davis
bcb75a21ad Bug 1222500 - Handle unexpected thread creation better on desktop Linux. r=gdestuynder 2015-11-30 18:21:00 +01:00
Bob Owen
744f82da14 Bug 1229804: Use the correct string length in Windows sandbox logging. r=tabraldes 2015-12-03 11:19:14 +00:00
Julian Hector
1abac3c923 Bug 1215303 - Part 2 - automatically enable broker when in permissive mode r=jld 2015-11-13 12:29:47 +00:00
Julian Hector
3e2ba29d41 Bug 1215303 - Part 1 - add permissive mode r=jld 2015-11-13 12:27:45 +00:00
Jed Davis
606dd22647 Bug 1207790 - Fix sandbox build for older Linux distributions. r=gdestuynder 2015-10-30 15:13:00 +01:00
Birunthan Mohanathas
94998cf5fe Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Jed Davis
5e497dda8b Bug 1215734 - Expand GeckoMediaPlugin sandbox policy for Clang 3.7 ASan. r=kang 2015-10-22 11:19:37 -07:00
Bob Owen
5d23b8a689 Bug 1187031: Move back to using USER_LOCKDOWN for the GMP sandbox policy on Windows. r=aklotz
This also removes turning off optimization for the Load function. That was an
attempt to fix the side-by-side loading. It may also have helped with ensuring
that the memsets were not optimized, but that has been fixed by Bug 1208892.
2015-10-21 08:46:57 +01:00
Jed Davis
2647610567 Bug 1201935 - Allow reading from TmpD in OS X content processes. r=smichaud 2015-10-07 13:41:00 +02:00
Jed Davis
23248eb96c Bug 930258 - Part 3: a file broker policy for the B2G emulator. r=kang 2015-10-07 22:13:08 -07:00
Jed Davis
2aafd4430a Bug 930258 - Part 2: seccomp-bpf integration. r=kang 2015-10-07 22:13:08 -07:00
Jed Davis
6a682f52f9 Bug 930258 - Part 1: The file broker, and unit tests for it. r=kang f=froydnj 2015-10-07 22:13:08 -07:00
Jed Davis
cc6ff30c31 Bug 1207401 - Send B2G sandbox logging to both stderr and logcat. r=kang 2015-10-05 09:21:39 -07:00
Bob Owen
147e296bee Bug 1207972: Move to using USER_INTERACTIVE and JOB_INTERACTIVE by default for the Windows content sandbox. r=tabraldes 2015-10-05 11:10:46 +01:00
Steven Michaud
65c33408b6 Bug 1190032 - Sandbox failure in nsPluginHost::GetPluginTempDir, tighten earlier patch. r=areinald 2015-09-10 15:32:42 -05:00
Bob Owen
89cecb0a22 Bug 1200336: Apply fix for Chromium issue 482784 for sandbox bug when built with VS2015. r=tabraldes 2015-09-10 08:25:20 +01:00
Jed Davis
2b175a829d Bug 1199481 - Complain more when entering sandboxing code as root. r=kang 2015-08-28 13:37:00 +02:00
Jed Davis
4e4ab4e9b2 Bug 1199413 - Fix MOZ_DISABLE_GMP_SANDBOX so it disables all the sandboxing. r=kang
Bonus fix: don't start the chroot helper unless we're going to use
it.  For this to matter, you'd need a system with unprivileged user
namespaces but no seccomp-bpf (or fake it with env vars) *and* to set
media.gmp.insecure.allow, so this is more to set a good example for
future changes to this code than for functional reasons.
2015-08-28 12:18:00 +02:00
Bob Owen
e2abf5a65b Bug 1197943: Turn off MITIGATION_STRICT_HANDLE_CHECKS for NPAPI process sandbox for causing hangs. r=aklotz 2015-09-09 08:45:25 +01:00
Bob Owen
6649fdb686 Bug 1201438: Add non-sandboxed Windows content processes as target peers for handle duplication. r=bbondy 2015-09-08 11:18:12 +01:00
Steven Michaud
821cabecb6 Bug 1190032 - Sandbox failure in nsPluginHost::GetPluginTempDir. r=areinald 2015-09-03 19:28:30 -05:00
Nicholas Nethercote
69d088e45f 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.
2015-08-27 20:44:53 -07:00
Makoto Kato
4f11626a2a Bug 1196403 - Apply crbug/522201 to support Windows 10 build 10525. r=bobowen 2015-08-25 19:21:08 +09:00
Jed Davis
aebeff26fc Bug 1004011 - Support SECCOMP_FILTER_FLAG_TSYNC if available. r=kang 2015-08-11 16:30:00 -04:00
Makoto Kato
629ba560a7 Bug 830801 - Part 2. Remove NOMINMAX define from moz.build. r=mshal 2015-08-03 10:07:09 +09:00
Bob Owen
958aa88302 Bug 1171796: Add sandbox rule for child process NSPR log file on Windows. r=bbondy
This also moves the initialization of the sandbox TargetServices to earlier in
plugin-container.cpp content_process_main, because it needs to happen before
xul.dll loads.
2015-07-30 10:04:42 +01:00
Steven Michaud
bd67a15707 Bug 1175881 - about:sync-log can't read files on OS X with e10s on and content process sandbox enabled. r=areinald 2015-07-28 12:09:34 -05:00
Jed Davis
3bfb47f767 Bug 1186709 - Remove MOZ_IMPLICIT from security/sandbox/chromium. r=bobowen 2015-07-23 08:28:00 -04:00
Jed Davis
f9d430459b Bug 1157864 - Record chromium patch applied in previous commit. r=me 2015-07-22 15:48:49 -07:00
Felix Janda
086365c6c3 Bug 1157864 - chromium sandbox: Fix compilation for systems without <sys/cdefs.h>. r=jld 2015-02-05 22:41:38 +01:00
Jed Davis
8c643f1407 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
Jed Davis
db040b39e2 Bug 1181704 - Import chromium SafeSPrintf. r=bobowen
This also imports the unit tests but doesn't arrange to run them.
Including the tests in our xul-gtest is possible but not trivial: there
are logging dependencies, and they use a different #include path for
gtest.h (which we'd need to patch).

Upstream revision: df7cc6c04725630dd4460f29d858a77507343b24.
2015-07-09 12:04:00 +02:00
Wes Kocher
6bea236597 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
267d5e7281 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
6ebf901a46 Bug 1181704 - Import chromium SafeSPrintf. r=bobowen
This does not include the upstream unit tests.  Including the tests
in our xul-gtest is possible but not trivial: there are logging
dependencies, and they use a different #include path for gtest.h (which
we'd need to patch).

Upstream revision: df7cc6c04725630dd4460f29d858a77507343b24.
2015-07-13 16:17:58 -07:00
Juan Gomez
01df2f691b Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-07-03 18:29:00 -07:00
Bob Owen
d4b55fc9ff Bug 1177594: Use a USER_RESTRICTED token level on GMP process when integrity levels are available. r=cpearce 2015-06-26 14:19:12 +01:00
Ryan VanderMeulen
e6131fc8b8 Backed out changeset 8b4e4083639e (bug 1171931) for B2G debug emulator bustage. 2015-06-25 19:48:42 -04:00
Juan Gomez
2128198065 Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-06-24 14:11:00 -04:00
Bob Owen
791d7b4fed Bug 1172388: Use a USER_RESTRICTED access level token on Windows 10. r=cpearce 2015-06-19 23:35:43 +01:00
Jed Davis
48019b0f2f Bug 1176085 - Fix second/nanosecond confusion in Linux sandbox start error case. r=kang 2015-06-19 14:26:44 -07:00
Benoit Girard
9b4532466d Bug 1172216 - Move nsStackwalk to mozglue. r=glandium 2015-06-10 16:32:45 -04:00
Bob Owen
1db067e6c3 Bug 1165895: Add NPAPI sandbox rule for the crash server pipe and x64 Temp dir write access. r=bbondy 2015-06-18 12:01:38 +01:00
Jed Davis
fa57b1cb74 Bug 1168555 - Work around Nuwa not always being single-threaded when a normal content process is. r=kang 2015-06-10 13:38:00 -04:00
Jed Davis
2f1671edf0 Bug 1055310 - Step 3: Move syscall interceptions into SandboxFilter.cpp. r=kang
We can now keep the part of the policy implemented by upcalls to
userspace in the same place as the part of the policy that's handled
entirely in the kernel.  This will become more useful in the future
(e.g., bug 930258).
2015-06-05 15:17:40 -07:00
Jed Davis
64e7f2da49 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
6ded24dd65 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
Bob Owen
eaea331c4f Bug 1166669: Enable process-level mitigations for the Windows content process sandbox. r=tabraldes 2015-06-03 09:13:00 +01:00
Bob Owen
836edcd4aa Bug 1123759: Set low integrity on NPAPI processes for Windows sandboxing policy level >= 2. r=bbondy, r=bsmedberg 2015-05-22 17:05:45 +01:00
Mike Hommey
4245f5c436 Bug 991983 - Define SOURCES as SourcePath. r=gps 2015-05-28 07:34:15 +09:00