Commit Graph
367 Commits
Author SHA1 Message Date
Gian-Carlo Pascutto 95760a086d Bug 1384804 - Allow reading /proc/self/status for libnuma. r=jld
MozReview-Commit-ID: LLwmPVtj0PE
2017-09-28 16:19:02 +02:00
Jed Davis 0b7a4983f6 Bug 1396542 - Let sandboxed content processes read /var/lib/dbus/machine-id. r=gcp
PulseAudio is the only thing that's known to need this.  Note that the
same file often exists as /etc/machine-id, and we currently allow reading
all of /etc (which includes other fingerprinting hazards as well).

MozReview-Commit-ID: FoyKQzhAV6M
2017-09-19 19:54:41 -06:00
Gian-Carlo Pascutto efd975ca23 Bug 1399392 - Don't hardcode .config, use XDG_* environment vars. r=jld
MozReview-Commit-ID: 30j9VbHUjFn
2017-09-13 15:55:07 +02:00
Jed Davis 4aae4d4c85 Bug 1363378 - Set close-on-exec in sandbox-related sockets held by parent process. r=gcp
If these aren't close-on-exec, they can be inherited by the crash
reporter process after the parent process has crashed and exited,
causing child processes to continue running when the IPC I/O thread blocks
in the file broker trying to open a GeckoChildCrash temp file.
(Empirically, the main thread then blocks waiting for the I/O thread.)

Operations that run on dedicated threads, like playing media, may
continue even though the main and IPC threads are locked up, resulting in
videos that keep playing sound even though the browser seems to no longer
exist.

If the broker socket is closed as expected when the parent process
exits, the child will return failure from the brokered file operation
and then go on to get an IPC error due to the parent process's
nonexistence, and will exit as normal.

This patch makes the same change to rejected syscall reporting, even
though that's a one-way asynchronous message with no response to wait
for, just in case something goes wrong enough to fill the entire socket
buffer but not so badly broken that it would wind up in an infinite loop
anyway.

SOCK_CLOEXEC has been present since Linux 2.6.26, and it would be used
only if seccomp-bpf is available, so it should be safe to use
unconditionally.

MozReview-Commit-ID: 7tDPBJILzlj
2017-09-13 12:25:35 -06:00
Gian-Carlo Pascutto 700b926033 Bug 1396733 - Add flatpak font dirs to the sandbox whitelist. r=jld
Also clean up the order of paths a bit.

MozReview-Commit-ID: GM62r4N9wL7
2017-09-13 13:41:21 +02:00
Jed Davis 8db75177d4 Bug 1397753 - Disallow kill() in sandboxed content processes. r=gcp
As a special case to deal with PulseAudio, testing for a process's
existence with kill(pid, 0) quietly fails with EPERM instead.

(I also added some commentary on umask, since I was touching that part of
the code anyway.)

MozReview-Commit-ID: CM0Aqii13j4
2017-09-07 08:29:02 -06:00
Jed Davis f97f42ff84 Bug 1299581 - Fail waitpid et al. with ECHILD in sandboxed content processes. r=gcp
MozReview-Commit-ID: 7Qjcnrd7KqK
2017-09-07 08:27:32 -06:00
Chris Manchester 67a3d90503 Bug 1386876 - Replace all uses of DISABLE_STL_WRAPPING with a template, remove DISABLE_STL_WRAPPING. r=glandium
MozReview-Commit-ID: FMEtb5PY7iP
2017-09-11 11:33:26 -07:00
Jed Davis d3f2cb5ed7 Bug 1383888 - Restrict sandboxed readlinkat() the same as readlink(). r=gcp
MozReview-Commit-ID: 3VLXp7AJePQ
2017-07-27 17:22:23 -06:00
Gian-Carlo Pascutto 1c35af7bba Bug 1391494 - Enforce use of our own copy of strlcpy. r=jld
MozReview-Commit-ID: GQgGJBj1Hjc
2017-08-24 19:12:14 +02:00
Jed Davis 40cab4912d Backed out 3 changesets (bug 1380701, bug 1384804)
Backed out changeset afdd35ed8902 (bug 1384804)
Backed out changeset 9fb892c41a9e (bug 1380701)
Backed out changeset 0d56979a6efa (bug 1380701)
2017-08-24 15:02:48 -06:00
Jed Davis e4ec4e6d70 Bug 1384986 - Adjust sandbox policy for dconf's mkdir -p behavior. r=gcp
MozReview-Commit-ID: HNvOXNJTc1W
2017-08-10 19:02:22 -06:00
Jed Davis 1db6668c32 Bug 1384986 - Prevent sandbox file broker rules from removing rights granted by more general rules. r=gcp
Generally, the intent for the Add* methods is that they always grant
rights in addition to what's already in the policy, not remove them;
this makes subtree rules that overlap single-file rules follow that
principle.

This requires a global analysis because the conflicting rules can be
added in any order.  It does not currently attempt to handle prefix
rules that aren't at a path component boundary, because that's not a
problem we currently have.

MozReview-Commit-ID: 4kv6QoGCBTV
2017-08-10 21:38:25 -06:00
Phil Ringnalda a272f15358 Merge m-c to autoland
MozReview-Commit-ID: GCxEZcmHL2w
2017-08-19 15:34:44 -07:00
Chris Peterson 6b2b011a43 Bug 1389851 - sandbox: Suppress -Wunreachable-code-return warning in third-party Chromium sandbox code. r=jld
security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc:277:12: warning: 'return' will never be executed [-Wunreachable-code-return]

This return statement is unreachable because SANDBOX_DIE() is a noreturn function:

https://searchfox.org/mozilla-central/rev/a887f0edbd9f6b176b64111455ba62bb0cf356a6/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc#270-274

MozReview-Commit-ID: HDxBJe2ZtPN
2017-08-09 18:45:16 -07:00
Sylvestre Ledru fac4ef9004 Bug 1387569 - Also enable -Wno-implicit-fallthrough for gcc for a chromium file (exists from gcc 7) r=gcp
MozReview-Commit-ID: cuQuFcAnWL
2017-08-06 19:06:36 +02:00
Phil Ringnalda fed51070bb Backed out 5 changesets (bug 1387569) for Windows static build bustage
Backed out changeset eeda521ba0ad (bug 1387569)
Backed out changeset 8d23caf2ccc7 (bug 1387569)
Backed out changeset b5f969313f81 (bug 1387569)
Backed out changeset f642bc883aa5 (bug 1387569)
Backed out changeset 20151eabffea (bug 1387569)

MozReview-Commit-ID: IH0XXePvhiL
2017-08-19 12:20:26 -07:00
Sylvestre Ledru 12905f77e2 Bug 1387569 - Also enable -Wno-implicit-fallthrough for gcc for a chromium file (exists from gcc 7) r=gcp
MozReview-Commit-ID: cuQuFcAnWL
2017-08-06 19:06:36 +02:00
Sebastian Hengst 9ef800395b Backed out changeset 10660affe7a3 (bug 1387569) 2017-08-19 20:21:55 +02:00
Sylvestre Ledru 1cafacbf90 Bug 1387569 - Also enable -Wno-implicit-fallthrough for gcc for a chromium file (exists from gcc 7) r=gcp
MozReview-Commit-ID: cuQuFcAnWL
2017-08-06 19:06:36 +02:00
Gian-Carlo Pascutto 04ed2b22ae Bug 1387742 - Whitelist default dynamic linker paths, including /lib64. r=jld
MozReview-Commit-ID: B4HpKZQL8Y0
2017-08-17 17:53:11 +02:00
Gian-Carlo Pascutto bee7a1b184 Bug 1384804 - Allow libnuma to read /proc/self/status, block get_mempolicy. r=jld
MozReview-Commit-ID: EHPVoFQ6jVZ
2017-08-17 16:59:41 +02:00
Jed Davis 300e615e36 Bug 1380701 - Remove the file broker protocol support for two-path operations. r=gcp
Now that all of the operations that took two paths are removed, we can
have less string manipulation running on untrusted inputs in a trusted
context.

Note that the path isn't null-terminated in transit, because we know
the message length and there's no longer any need to delimit anything.
(This is how the protocol worked before the two-path operations were
added.)

MozReview-Commit-ID: 5VHkMoPlWmU
2017-08-16 15:09:56 -06:00
Jed Davis 441fa2c680 Bug 1380701 - Remove brokering for link, unlink, and rename. r=gcp
In testing (local and CI) these seem to no longer be used.

MozReview-Commit-ID: 2D3C8eWoIsB
2017-07-20 13:43:59 -06:00
Wes Kocher 1fa4517ff7 Backed out 2 changesets (bug 1380701) for bustage in SandboxBroker a=backout
Backed out changeset 6cef83dd4d11 (bug 1380701)
Backed out changeset 4456ebfe5657 (bug 1380701)

MozReview-Commit-ID: Cnfj7TZvCbv
2017-08-16 09:46:48 -07:00
Jed Davis 866bf87e7c Bug 1380701 - Remove the file broker protocol support for two-path operations. r=gcp
Now that all of the operations that took two paths are removed, we can
have less string manipulation running on untrusted inputs in a trusted
context.

Note that the path isn't null-terminated in transit, because we know
the message length and there's no longer any need to delimit anything.
(This is how the protocol worked before the two-path operations were
added.)

MozReview-Commit-ID: 5VHkMoPlWmU
2017-08-11 20:58:35 -06:00
Jed Davis 285da0bcb6 Bug 1380701 - Remove brokering for link, unlink, and rename. r=gcp
In testing (local and CI) these seem to no longer be used.

MozReview-Commit-ID: 2D3C8eWoIsB
2017-07-20 13:43:59 -06:00
Gian-Carlo Pascutto be8f76c40d Bug 1389078 - Remove (unneeded) usage of internal libc header. r=jld
MozReview-Commit-ID: E7oppAtGRfD
2017-08-10 16:55:01 +02:00
Jed Davis 8f184f1ad7 Bug 1386279 - Renovate Linux sandbox file broker handling of access(). r=gcp
1. X_OK is now allowed, and is limited only by the MAY_ACCESS permission.

2. The actual access() syscall is now used, if access is granted by the
broker policy.  This fixed bug 1382246, which explains the background.

MozReview-Commit-ID: 926429PlBnL
2017-08-08 18:02:31 -06:00
Jed Davis b0dd877abe Bug 1388545 - Fix PulseAudio breakage caused by read restrictions. r=gcp
MozReview-Commit-ID: 518mslh9xy
2017-08-08 16:17:52 -06:00
Gian-Carlo Pascutto 5279c72837 Bug 1386558 - Check sandboxing level 2 after permissions are available. r=jld
MozReview-Commit-ID: 9Pqwk45pJbe
2017-08-03 12:31:37 +02:00
Gian-Carlo Pascutto 96fd663752 Bug 1385891 - Whitelist things in the extension dir, not just the dir itself. r=jld
MozReview-Commit-ID: 3DryT8mm1F3
2017-08-04 09:48:32 +02:00
Gian-Carlo Pascutto a215f07e37 Bug 1385715 - Add support for WebGL on NVIDIA PRIME. r=jld
MozReview-Commit-ID: 6hXLXgNdVti
2017-08-02 12:02:16 +02:00
Gian-Carlo Pascutto 3253e0f36b Bug 1385253 - Whitelist main NixOS data store directory. r=jld
MozReview-Commit-ID: 2aDBSAOrbv6
2017-08-02 11:51:12 +02:00
Wes Kocher 8ad489263c Merge inbound to central, a=merge
MozReview-Commit-ID: 9NFjSEt96iT
2017-08-02 17:11:51 -07:00
Gian-Carlo Pascutto 16beb8da75 Bug 1385891 - Whitelist extensions dir in the profile. r=jld
MozReview-Commit-ID: 7wpVmqs6Y1X
2017-07-31 18:19:26 +02:00
Gian-Carlo Pascutto bb7f51acc7 Bug 1384483 - Allow reading userContent.css in the sandbox. r=jld
MozReview-Commit-ID: A43RY1J95VF
2017-07-31 17:58:19 +02:00
Nicholas Nethercote c5d67f0fc9 Bug 1384819 (part 1) - Split MozStackWalk(). r=glandium.
MozStackWalk() is different on Windows to the other platforms. It has two extra
arguments, which can be used to walk the stack of a different thread.

This patch makes those differences clearer. Instead of having a single function
and forbidding those two arguments on non-Windows, it removes those arguments
from MozStackWalk, and splits off MozStackWalkThread() which retains them. This
also allows those arguments to have more appropriate types (HANDLE instead of
uintptr_t; CONTEXT* instead of than void*) and names (aContext instead of
aPlatformData).

The patch also removes unnecessary reinterpret_casts for the aClosure argument
at a couple of MozStackWalk() callsites.
2017-07-27 12:46:47 +10:00
Wes Kocher 676d7b64aa Backed out 2 changesets (bug 1384986) for failures in browser_content_sandbox_fs.js a=backout
Backed out changeset 23dae62b5ece (bug 1384986)
Backed out changeset 60408af056d9 (bug 1384986)

MozReview-Commit-ID: gru7nyixFG
2017-08-01 18:17:48 -07:00
Jed Davis f705b69666 Bug 1384986 - Fix PulseAudio breakage caused by read restrictions. r=gcp
MozReview-Commit-ID: 518mslh9xy
2017-07-27 12:41:22 -06:00
Jed Davis d0da91995e Bug 1384986 - Fix DConf breakage caused by read restrictions. r=gcp
MozReview-Commit-ID: GKTBPtAea5J
2017-07-27 11:32:09 -06:00
Jed Davis ab832e9fab Bug 1384306 - Allow SOCK_CLOEXEC in socketpair(). r=gcp
MozReview-Commit-ID: 45LJiUxZeg6
2017-07-27 15:27:06 -06:00
Nicholas Nethercote 09493fcbcf Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj. 2017-07-31 14:28:48 +10:00
Thomas Daede 6e4fd491c0 Bug 1384718 - Add sandbox rules for Mesa 17.1 driver loader. r=gcp 2017-07-29 13:05:55 -04:00
Sebastian Hengst 51534c6b52 Backed out changeset ef5feef07bed (bug 1384835) 2017-07-28 10:29:24 +02:00
Nicholas Nethercote 8846676f01 Bug 1384835 (part 3) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj.
This is similar like the previous patch, but for the 8-bit string variants.
Also, it changes assignment to Adopt() in GetCString() and GetDefaultCString()
to avoid an extra copy.
2017-07-27 16:45:10 +10:00
Jed Davis 0270c347fc Backed out 3 changesets (bug 1383007, bug 1376910)
Backed out changeset 394b3d22db19 (bug 1383007)
Backed out changeset 17e2e2aa8f56 (bug 1376910)
Backed out changeset d11cd5c3fc6f (bug 1376910)
2017-07-26 12:50:28 -06:00
Gian-Carlo Pascutto f3f4d0b85d Bug 1308400 - Report failures in file processes too. r=jld
MozReview-Commit-ID: 549WuWKaJeM
2017-07-10 20:20:49 +02:00
Gian-Carlo Pascutto 2afca2cf60 Bug 1308400 - Symlink handling for read brokering. r=jld
MozReview-Commit-ID: BP1gFdDbqXD
2017-07-06 15:31:13 +02:00
Gian-Carlo Pascutto 6180c454ed Bug 1308400 - Support file process, whitelist path prefs. r=jld
MozReview-Commit-ID: 3eX06AioPZL
2017-07-24 16:32:22 +02:00