Commit Graph

289 Commits

Author SHA1 Message Date
Bob Owen
f9cb6a4fda 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
48cca4b17d 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
e59798bc11 Bug 1186709 - Remove MOZ_IMPLICIT from security/sandbox/chromium. r=bobowen 2015-07-23 08:28:00 -04:00
Jed Davis
dc4e9622a9 Bug 1157864 - Record chromium patch applied in previous commit. r=me 2015-07-22 15:48:49 -07:00
Felix Janda
cb817362ed Bug 1157864 - chromium sandbox: Fix compilation for systems without <sys/cdefs.h>. r=jld 2015-02-05 22:41:38 +01:00
Jed Davis
4f7c3a8066 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
bad4183e1d 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
3ce60d2f05 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
2f2012818b 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
db8c6b5327 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
21d73728f3 Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-07-03 18:29:00 -07:00
Bob Owen
863b811c3b 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
55b2086097 Backed out changeset 8b4e4083639e (bug 1171931) for B2G debug emulator bustage. 2015-06-25 19:48:42 -04:00
Juan Gomez
98461fc4a4 Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-06-24 14:11:00 -04:00
Bob Owen
7551c6fd42 Bug 1172388: Use a USER_RESTRICTED access level token on Windows 10. r=cpearce 2015-06-19 23:35:43 +01:00
Jed Davis
5ef6b7bea8 Bug 1176085 - Fix second/nanosecond confusion in Linux sandbox start error case. r=kang 2015-06-19 14:26:44 -07:00
Benoit Girard
fa09f0548c Bug 1172216 - Move nsStackwalk to mozglue. r=glandium 2015-06-10 16:32:45 -04:00
Bob Owen
c04ebe0b83 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
98cf948a01 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
3bde26970c 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
9baf0005f4 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
06da80b656 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
e417ad7bcb Bug 1166669: Enable process-level mitigations for the Windows content process sandbox. r=tabraldes 2015-06-03 09:13:00 +01:00
Bob Owen
4eddb939fd 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
2c863b9fe4 Bug 991983 - Define SOURCES as SourcePath. r=gps 2015-05-28 07:34:15 +09:00
Jed Davis
22bcabd0af Bug 1162965 - Use /dev/shm instead of /tmp for sandbox chroot if possible. r=kang 2015-05-14 16:19:08 -07:00
David Major
68b0dee7c5 Bug 1149718: Fix wow_helper lib path for VS2015. r=glandium 2015-05-12 18:20:28 -04:00
Bob Owen
6bab3a7af4 Bug 1146874 Part 1: Check that Windows sandboxed process starts correctly. r=tabraldes 2015-05-11 08:24:39 +01:00
Bob Owen
46c30cdbd5 Bug 1158773: Use the same initial and delayed integrity level for Windows content sandbox level 0. r=tabraldes 2015-05-06 10:11:56 +01:00
Bob Owen
0693a1dc83 Bug 1150515: Set the subsystem to WINDOWS,5.02 for wow_helper so that it runs on WinXP 64-bit. r=glandium 2015-04-30 09:48:03 +01:00
Jed Davis
8f10995d7b Bug 1154184 - Don't use Linux sandbox gtest dir if not building tests. r=gps 2015-04-24 17:36:08 -07:00
Steven Michaud
2bb57bcd7a Bug 1153809 - Loosen Mac content process sandbox rules for NVidia and Intel HD 3000 graphics hardware. r=areinald 2015-04-22 14:56:09 -05:00
Ehsan Akhgari
d278570d19 Bug 1153348 - Add an analysis to prohibit operator bools which aren't marked as either explicit or MOZ_IMPLICIT; r=jrmuizel
This is the counterpart to the existing analysis to catch
constructors which aren't marked as either explicit or
MOZ_IMPLICIT.
2015-04-21 21:40:49 -04:00
André Reinald
12017521df Bug 1150765 - Add sandbox rules to allow hardware rendering of OpenGL on Mac. r=smichaud 2015-04-21 11:17:16 +02:00
Jed Davis
bd4374a0cc 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
a25b210578 Bug 1151607 - Step 1.5: Avoid unlikely false positives in Linux SandboxInfo feature detection. r=kang
Using the equivalent of release assertions in the patch after this one
is easier to justify if I can't come up with vaguely legitimate reasons
why they might fail; this detects the ones I thought of.
2015-04-10 18:05:19 -07:00
Jed Davis
4bcdc2879f 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
Jed Davis
08099f9875 Bug 1151607 - Step 0: sort includes to make the following patches cleaner. r=kang 2015-04-10 18:05:19 -07:00
Bob Owen
72b3de6331 Bug 1149483: Change content sandbox level 1 to a working low integrity sandbox. r=tabraldes, r=billm 2015-04-05 14:01:38 +01:00
Steven Michaud
aa2d63ddad Bug 1110911 - Move Mac sandboxing code into plugin-container. r=cpearce,areinald,jld 2015-04-03 11:51:41 -05:00
Bob Owen
666e96adb9 Bug 1119878 Part 2: Change IPC code to hold ProcessID instead of ProcessHandle. r=billm, r=dvander, r=aklotz, r=cpearce 2015-04-01 09:40:35 +01:00
Bob Owen
8e1e75d04b Bug 1119878 Part 1: Change SandboxTarget to hold sandbox target services to provide functions. r=aklotz, r=glandium, r=cpearce 2015-04-01 09:40:35 +01:00
Bob Owen
1eda62eb8d Bug 1147446: Chromium patch to fix memory leak in Windows sandbox sharedmem_ipc_server.cc. r=aklotz 2015-03-26 08:06:04 +00:00
Wes Kocher
0d9c0798af Merge m-c to inbound a=merge CLOSED TREE 2015-03-23 16:51:22 -07:00
Edwin Flores
31eadf18b7 Bug 1146192 - Whitelist sched_yield syscall in GMP sandbox on Linux DONTBUILD CLOSED TREE - r=jld 2015-03-24 10:56:49 +13:00
Edwin Flores
13fe1731fe Bug 1146192 - Backed out changeset d2918bcf0d90 for missing bug number - r=me 2015-03-24 10:53:10 +13:00
Jed Davis
0f3b12d8c5 Bug 1144514 - Whitelist pread64 in content seccomp-bpf policy. r=kang 2015-03-19 11:57:00 -04:00
Ehsan Akhgari
33bb32f549 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Edwin Flores
7a76516d84 Bug 1XXXXXX - Whitelist sched_yield syscall in GMP sandbox on Linux - r=jld 2015-03-24 09:55:36 +13:00
Bob Owen
9438a86ad1 Bug 1145432: Add the policy for the client side of the crash server pipe to the GMP Windows sandbox. r=aklotz 2015-03-20 07:53:37 +00:00