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

366 Коммитов

Автор SHA1 Сообщение Дата
Jed Davis d64e9b800d 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

--HG--
extra : rebase_source : 593ee0b94cf507681a034d22cd06a9050d56b86a
2017-09-19 19:54:41 -06:00
Gian-Carlo Pascutto 38ecd4cad0 Bug 1399392 - Don't hardcode .config, use XDG_* environment vars. r=jld
MozReview-Commit-ID: 30j9VbHUjFn

--HG--
extra : rebase_source : f36d5ff8d54215899862621908d48b57ffa78af3
2017-09-13 15:55:07 +02:00
Jed Davis bb7bbfa321 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

--HG--
extra : rebase_source : b797655dff2eea88c406d83dcee4a859f2a038b7
2017-09-13 12:25:35 -06:00
Gian-Carlo Pascutto bda88cac9f 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

--HG--
extra : rebase_source : 7cf620e020808d01a38f38be1fcf2a841df26367
2017-09-13 13:41:21 +02:00
Jed Davis e6cee20f4d 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

--HG--
extra : rebase_source : 44ef05e9a39a9eea4a649399c63b865f5523d43b
2017-09-07 08:29:02 -06:00
Jed Davis db2eef4339 Bug 1299581 - Fail waitpid et al. with ECHILD in sandboxed content processes. r=gcp
MozReview-Commit-ID: 7Qjcnrd7KqK

--HG--
extra : rebase_source : 98e9bcb247edad657d8e45e30901861a9193f249
2017-09-07 08:27:32 -06:00
Chris Manchester c0a229d4c3 Bug 1386876 - Replace all uses of DISABLE_STL_WRAPPING with a template, remove DISABLE_STL_WRAPPING. r=glandium
MozReview-Commit-ID: FMEtb5PY7iP

--HG--
extra : rebase_source : 3cdee7528846462c758e623d6bcd2e6e17dbabff
2017-09-11 11:33:26 -07:00
Jed Davis d7992cb0de Bug 1383888 - Restrict sandboxed readlinkat() the same as readlink(). r=gcp
MozReview-Commit-ID: 3VLXp7AJePQ

--HG--
extra : rebase_source : f0116599e133d3f7cc079ecdbf0dfaee7168be2d
2017-07-27 17:22:23 -06:00
Gian-Carlo Pascutto 180dfb1325 Bug 1391494 - Enforce use of our own copy of strlcpy. r=jld
MozReview-Commit-ID: GQgGJBj1Hjc

--HG--
extra : rebase_source : ac110f76f199e8739b6eebaf123c7e6b58f77135
2017-08-24 19:12:14 +02:00
Jed Davis 11d8d1c88e 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 a2bdc51dd8 Bug 1384986 - Adjust sandbox policy for dconf's `mkdir -p` behavior. r=gcp
MozReview-Commit-ID: HNvOXNJTc1W

--HG--
extra : rebase_source : 76edd1008731838fc89a5581fee818328d5847e1
2017-08-10 19:02:22 -06:00
Jed Davis 3460ce99ac 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

--HG--
extra : rebase_source : 9e41263bbb1c07b8cde40ec2e72d746f17278fcb
2017-08-10 21:38:25 -06:00
Phil Ringnalda 366675feaa Merge m-c to autoland
MozReview-Commit-ID: GCxEZcmHL2w
2017-08-19 15:34:44 -07:00
Chris Peterson 9ce1ea9579 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

--HG--
extra : rebase_source : 07f6cbcf901a54901cc5ea85b84030ea27a668ba
extra : source : f39f78b1a9851d97c6fd7dcbbd1d7ba93e933e08
2017-08-09 18:45:16 -07:00
Sylvestre Ledru 7b612087c3 Bug 1387569 - Also enable -Wno-implicit-fallthrough for gcc for a chromium file (exists from gcc 7) r=gcp
MozReview-Commit-ID: cuQuFcAnWL

--HG--
extra : rebase_source : d67074f94feabc1b32f64e6e988fa2222db626d7
2017-08-06 19:06:36 +02:00
Phil Ringnalda 1ca83fd296 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 deeb6caa20 Bug 1387569 - Also enable -Wno-implicit-fallthrough for gcc for a chromium file (exists from gcc 7) r=gcp
MozReview-Commit-ID: cuQuFcAnWL

--HG--
extra : rebase_source : 28b30810aa4cf45d1d393bd94815b39ca81f43da
2017-08-06 19:06:36 +02:00
Sebastian Hengst 4a4349b10c Backed out changeset 10660affe7a3 (bug 1387569) 2017-08-19 20:21:55 +02:00
Sylvestre Ledru e15bcf0f43 Bug 1387569 - Also enable -Wno-implicit-fallthrough for gcc for a chromium file (exists from gcc 7) r=gcp
MozReview-Commit-ID: cuQuFcAnWL

--HG--
extra : rebase_source : 37dec684e14b1d02dab04729c718b5da1fcb25a4
2017-08-06 19:06:36 +02:00
Gian-Carlo Pascutto 2254f82025 Bug 1387742 - Whitelist default dynamic linker paths, including /lib64. r=jld
MozReview-Commit-ID: B4HpKZQL8Y0

--HG--
extra : rebase_source : 8303bcc547d5802280c1a1b18fd98c632cc4d387
2017-08-17 17:53:11 +02:00
Gian-Carlo Pascutto 137d2bb87a Bug 1384804 - Allow libnuma to read /proc/self/status, block get_mempolicy. r=jld
MozReview-Commit-ID: EHPVoFQ6jVZ

--HG--
extra : rebase_source : 7945f44a8b95a9e0d9d4dfaabc934aab6e6fd5be
extra : source : 76935696a618b2b6243988595bdd913b5209c200
2017-08-17 16:59:41 +02:00
Jed Davis 898bd21752 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

--HG--
extra : rebase_source : 2108a4f7c7bf5098f2ef63786c3675367bd56e19
2017-08-16 15:09:56 -06:00
Jed Davis a7d1fe2b5f 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

--HG--
extra : rebase_source : dde2015af1d036c32631d185703f1149285b253e
2017-07-20 13:43:59 -06:00
Wes Kocher 9a955fd0b3 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 bcab11446f 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

--HG--
extra : rebase_source : 74fd595c4aea6c9e073ae704b8e59599770300b4
2017-08-11 20:58:35 -06:00
Jed Davis 0bd7dbd987 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

--HG--
extra : rebase_source : 20d986e1430a70ddb534fdd73d1d06e12510292f
2017-07-20 13:43:59 -06:00
Gian-Carlo Pascutto 5577125b26 Bug 1389078 - Remove (unneeded) usage of internal libc header. r=jld
MozReview-Commit-ID: E7oppAtGRfD

--HG--
extra : rebase_source : 8c31af5b1275a6036ff09f062f2b87f3c1e2b300
2017-08-10 16:55:01 +02:00
Jed Davis 677499eb59 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

--HG--
extra : rebase_source : 6ae54c4c25e1389fa3af75b0bdf727323448294a
2017-08-08 18:02:31 -06:00
Jed Davis 2a133d756a 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 60d25346d1 Bug 1386558 - Check sandboxing level 2 after permissions are available. r=jld
MozReview-Commit-ID: 9Pqwk45pJbe

--HG--
extra : rebase_source : 1c21f21d04cddd6c00e5f495c6686c671aa9cac1
2017-08-03 12:31:37 +02:00
Gian-Carlo Pascutto 36784f22aa Bug 1385891 - Whitelist things in the extension dir, not just the dir itself. r=jld
MozReview-Commit-ID: 3DryT8mm1F3

--HG--
extra : rebase_source : 23a8bda22307687884aa73d454221a78a4922791
2017-08-04 09:48:32 +02:00
Gian-Carlo Pascutto 5b6073d494 Bug 1385715 - Add support for WebGL on NVIDIA PRIME. r=jld
MozReview-Commit-ID: 6hXLXgNdVti

--HG--
extra : rebase_source : 14917cd11f97f41f46c6d6b42cea2ecb4162293a
2017-08-02 12:02:16 +02:00
Gian-Carlo Pascutto 5bfd2b1cc1 Bug 1385253 - Whitelist main NixOS data store directory. r=jld
MozReview-Commit-ID: 2aDBSAOrbv6

--HG--
extra : rebase_source : fa8e7fee91b2688fcaa94851e1820deca1c21277
2017-08-02 11:51:12 +02:00
Wes Kocher baf6cddc4c Merge inbound to central, a=merge
MozReview-Commit-ID: 9NFjSEt96iT
2017-08-02 17:11:51 -07:00
Gian-Carlo Pascutto 8f357724e0 Bug 1385891 - Whitelist extensions dir in the profile. r=jld
MozReview-Commit-ID: 7wpVmqs6Y1X

--HG--
extra : rebase_source : 8b168e291469efb3afb90754a2833c07dd815e9f
extra : histedit_source : 7c259145efbf7cb21688d3580f74b216bb972e63
2017-07-31 18:19:26 +02:00
Gian-Carlo Pascutto 0d8bd27705 Bug 1384483 - Allow reading userContent.css in the sandbox. r=jld
MozReview-Commit-ID: A43RY1J95VF

--HG--
extra : rebase_source : 0c8355b34e79d8b0f4ec744a6f2b8b4414e0ab5c
extra : histedit_source : 6ddf29193d5a8b26e50a6a5b8e885caeff366033
2017-07-31 17:58:19 +02:00
Nicholas Nethercote 08e54b7c13 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.

--HG--
extra : rebase_source : 111ab7d6426d7be921facc2264f6db86c501d127
2017-07-27 12:46:47 +10:00
Wes Kocher 094c496d8d 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 26e4446a5b Bug 1384986 - Fix PulseAudio breakage caused by read restrictions. r=gcp
MozReview-Commit-ID: 518mslh9xy

--HG--
extra : rebase_source : fe5c8abda549f62f1dc20f6942ad877b0d1ecd75
2017-07-27 12:41:22 -06:00
Jed Davis 34c347eb14 Bug 1384986 - Fix DConf breakage caused by read restrictions. r=gcp
MozReview-Commit-ID: GKTBPtAea5J

--HG--
extra : rebase_source : 9f0a85bddfcfe9a31364ee2e63f768eaddc52ce0
2017-07-27 11:32:09 -06:00
Jed Davis 347f03dad0 Bug 1384306 - Allow SOCK_CLOEXEC in socketpair(). r=gcp
MozReview-Commit-ID: 45LJiUxZeg6

--HG--
extra : rebase_source : 234d542fea3e85ca521f23256dceee7fab6108a3
2017-07-27 15:27:06 -06:00
Nicholas Nethercote 72c884bf74 Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj.
--HG--
extra : rebase_source : d317b25be2ec21d1a60d25da3689e46cdce0b649
2017-07-31 14:28:48 +10:00
Thomas Daede 4d4fefbd12 Bug 1384718 - Add sandbox rules for Mesa 17.1 driver loader. r=gcp 2017-07-29 13:05:55 -04:00
Sebastian Hengst 744a0a216b Backed out changeset ef5feef07bed (bug 1384835) 2017-07-28 10:29:24 +02:00
Nicholas Nethercote 200d8ec18b 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.

--HG--
extra : rebase_source : eba805c3a7b809d5ccd6e853b1c9010db9477667
2017-07-27 16:45:10 +10:00
Jed Davis 709a96c2ee 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 7ee246522d Bug 1308400 - Report failures in file processes too. r=jld
MozReview-Commit-ID: 549WuWKaJeM

--HG--
extra : rebase_source : 22d6348e602f2ceae546502fa0050ab0960ec075
2017-07-10 20:20:49 +02:00
Gian-Carlo Pascutto d791c78487 Bug 1308400 - Symlink handling for read brokering. r=jld
MozReview-Commit-ID: BP1gFdDbqXD

--HG--
extra : rebase_source : 5db26ad21e40ab19228ac8a978215b97cf8b3b28
2017-07-06 15:31:13 +02:00
Gian-Carlo Pascutto 8bc55108f2 Bug 1308400 - Support file process, whitelist path prefs. r=jld
MozReview-Commit-ID: 3eX06AioPZL

--HG--
extra : rebase_source : 56bcfaad3360fe92ce605a0413bb3a9cacb4446d
2017-07-24 16:32:22 +02:00
Sylvestre Ledru 6202d4908b Bug 1383007 - Move the declaration in the #ifdef declaration to silent a warning r=jld
Otherwise, a warning is triggered because the statement will never be executed [-

Found with -Wswitch-unreachable with gcc 7

MozReview-Commit-ID: FVStzyFlhJp

--HG--
extra : rebase_source : 1db87153c3e7dcde8d5a9e0f1f0ff607307c9ca2
2017-07-21 23:28:47 +02:00