Commit Graph

782 Commits

Author SHA1 Message Date
Nicholas Nethercote
f1364a75ea Bug 1374580 (part 3) - Remove ns{,C}Substring typedefs. r=froydnj.
All the instances are converted as follows.

- nsSubstring  --> nsAString
- nsCSubstring --> nsACString

--HG--
extra : rebase_source : cfd2238c52e3cb4d13e3bd5ddb80ba6584ab6d91
2017-06-20 19:19:52 +10:00
Florian Quèze
66f6d259bc Bug 1374282 - script generated patch to remove Task.jsm calls, r=Mossop. 2017-06-22 12:51:42 +02:00
Alex Gaynor
1141573ee9 Bug 1374660 - Removed redundant declarations from macOS content sandbox policy; r=haik
MozReview-Commit-ID: Gw6AnH8r9sL

--HG--
extra : rebase_source : 62bb4dc335ab3f38a42543a488d07129a8d92a33
2017-06-20 10:27:18 -04:00
Bob Owen
caa7e3c377 Bug 1368600: Add telemetry with the error code for when a Windows sandboxed child process fails to start. r=jimm, data-review=francois 2017-06-13 08:54:41 +01:00
Randell Jesup
b0a3a49ce8 Bug 1361703: enable NR_epoll_create/create1 in linux sandbox r=jld
Enables creating new libevent epoll queues on Linux
2017-06-13 01:54:20 -04:00
Jed Davis
da2db41a9c Bug 1362601 - Don't crash on sandbox violation if known-problem injected libs are present. r=gcp
MozReview-Commit-ID: HCbavpMUxYm

--HG--
extra : rebase_source : ec0cc9dcbf07831209b438504311b45f5b8990a8
2017-06-07 16:33:11 -06:00
Alex Gaynor
0403c42ccf Bug 1371701 - Fixed sandboxing tests to reflect that we're enabling file content process for all channels r=bobowen
MozReview-Commit-ID: ICXZjEU2n6L

--HG--
extra : rebase_source : f28d5d61f6a0cdfecb2804239c407c730c4fd2ba
2017-06-09 11:24:07 -04:00
Bob Owen
a3df44ccee Bug 1323188: Don't use restricting SIDs in the sandbox access tokens when running from a network drive. r=jimm 2017-06-07 20:20:02 +01:00
Jed Davis
039a1c2b5c Bug 1321134 - Allow access to dconf shared-memory flags. r=gcp,glandium
DConf uses small memory-mapped files for the writer to signal readers
to invalidate cached data; the file is created by the first reader and
readers will write to it to force storage allocation.

If we don't allow opening the file, DConf will still work, but it will
reread the database on every pref access, and it prints messages on
stderr claiming it won't work.  So we should avoid that.

MozReview-Commit-ID: 9xoBIhtu5cu

--HG--
extra : rebase_source : 582b3bc30f2181b6564eefa34082a561f9cc0c28
2017-05-30 07:10:15 -06:00
Alex Gaynor
e43d5d424f Bug 1370540 - Extend the level 3 content sandbox filesystem read blacklist to include /Network and /Users; r=haik
MozReview-Commit-ID: 6RfS5aYRghK

--HG--
extra : rebase_source : c8d084d42dc2b37e4a0642e1a72bdd514a68d465
2017-06-06 10:48:06 -04:00
Daniel Holbert
2a87f6e3c3 Bug 1369837: Add a void cast to silence clang Wcomma build warning, in sandbox's snapshot of chromium header. r=bobowen
The build warning is for "possible misuse of comma operator".

The comma operator is a bit of a footgun becasue its first operand's result
just gets dropped on the floor (in this case, the result of the DCHECK
expression).  It appears that Chromium's use of the comma operator here is
intentional, though -- so we might as well accept clang's suggestion and "cast
expression to void to silence warning".

This is also filed upstream as:
 https://bugs.chromium.org/p/chromium/issues/detail?id=729123

MozReview-Commit-ID: Al2xsYEo3p0

--HG--
extra : rebase_source : 68d01b50ff1f07b68ddc0eeb7280ac412ac92932
2017-06-02 12:45:01 -07:00
Jed Davis
b129f08d7f Bug 1322784 - Gently fail utime(), to deal with GConf/ORBit. r=gcp
MozReview-Commit-ID: B4LmSGR6OEz

--HG--
extra : rebase_source : 613409994c0ba50c34c57537343484f1dc85b7aa
2017-05-30 23:13:37 -06:00
Alex Gaynor
d27dc0ba0b Bug 1358223 - Part 1 - On Windows and macOS hardcode the minimum content sandbox level at 1. r=bobowen,haik,jimm
If the "security.sandbox.content.level" preference is set to a value less than
1, all consumers will automatically treat it as if it were level 1. On Linux and
Nightly builds, setting the sandbox level to 0 is still allowed, for now.

MozReview-Commit-ID: 9QNTCkdbTfm

--HG--
extra : rebase_source : cd5a853c46a5cd334504b339bef8df30a3cabe51
2017-05-12 17:04:42 -04:00
Sebastian Hengst
fd03aa5bc8 Backed out changeset 4e283b54baa6 (bug 1358223) for build bustage on Android at dom/ipc/ContentChild.cpp:21. r=backout 2017-05-31 21:34:13 +02:00
Alex Gaynor
39f34ea898 Bug 1358223 - Part 1 - On Windows and macOS hardcode the minimum content sandbox level at 1. r=bobowen,haik,jimm
If the "security.sandbox.content.level" preference is set to a value less than
1, all consumers will automatically treat it as if it were level 1. On Linux and
Nightly builds, setting the sandbox level to 0 is still allowed, for now.

MozReview-Commit-ID: 9QNTCkdbTfm

--HG--
extra : rebase_source : 1a26ffc5b9f80e6df4c37c23f506e907ba44053a
2017-05-12 17:04:42 -04:00
Alex Gaynor
1532472698 Bug 1368771 - Added a test which verifies that on macOS /Volumes isn't readable at sandbox level 3 r=haik
r?haik

MozReview-Commit-ID: HPW4luz5n0M

--HG--
extra : rebase_source : c224b56de4b705758e2ab7820af02a4ef41d4040
2017-05-30 13:52:57 -04:00
Jed Davis
f6b03fa260 Bug 1355274 - Polyfill SOCK_DGRAM socketpairs with SOCK_SEQPACKET, for libasyncns. r=gcp
MozReview-Commit-ID: 2DeklSGsjUV

--HG--
extra : rebase_source : 8a202c23dc9a3ddede49b08ce1e0792dfb40bdbf
2017-04-11 20:55:34 -06:00
Jed Davis
675bae8c8d Bug 1364533 - Allow madvise huge page hints. r=gcp
MozReview-Commit-ID: 7sNWS2sFJCx

--HG--
extra : rebase_source : c1730d2ac5d352dcaec1889d4f20dd9bc0a838a8
2017-05-12 20:04:07 -06:00
Bob Owen
e6bdfd5594 Bug 1339105 Part 3: Move NPAPI windows process sandbox file rules into SandboxBroker. r=jimm
This also removes a rule that was added for sandboxing the Java plugin,
which we never did and we now only allow Flash anyway.

MozReview-Commit-ID: Jn6pCkLoGNM

--HG--
extra : source : 431267ab28deabef6ed7c791d8dff79e3fe590c1
2017-05-22 20:41:28 +01:00
Bob Owen
035cf9bdc2 Bug 1339105 Part 1: Implement Windows Level 3 content process sandbox policy. r=jimm
MozReview-Commit-ID: L8wcVhdLvFe

--HG--
extra : source : c3fb60fbc32660719c1b8b06dc785abd4559d6c0
2017-05-22 20:41:27 +01:00
Wes Kocher
848c9aa744 Backed out 3 changesets (bug 1339105) for plugin process leaks a=backout
Backed out changeset 431267ab28de (bug 1339105)
Backed out changeset 445875fbf13b (bug 1339105)
Backed out changeset c3fb60fbc326 (bug 1339105)

MozReview-Commit-ID: 4HYUQbHHnox
2017-05-22 15:14:23 -07:00
Bob Owen
16a4871cdf Bug 1339105 Part 3: Move NPAPI windows process sandbox file rules into SandboxBroker. r=jimm
This also removes a rule that was added for sandboxing the Java plugin,
which we never did and we now only allow Flash anyway.
2017-05-22 20:41:28 +01:00
Bob Owen
edf3a239b1 Bug 1339105 Part 1: Implement Windows Level 3 content process sandbox policy. r=jimm
MozReview-Commit-ID: L8wcVhdLvFe
2017-05-22 20:41:27 +01:00
Sebastian Hengst
89e33081c6 Backed out changeset 50bf4c923818 (bug 1339105) for Windows bustage: calling protected constructor of class 'nsAString' at sandboxBroker.cpp(208,11). r=backout on a CLOSED TREE 2017-05-22 16:16:16 +02:00
Sebastian Hengst
2a69fd246c Backed out changeset 367734cc9370 (bug 1339105) 2017-05-22 16:14:27 +02:00
Bob Owen
62c455086d Bug 1339105 Part 3: Move NPAPI windows process sandbox file rules into SandboxBroker. r=jimm
This also removes a rule that was added for sandboxing the Java plugin,
which we never did and we now only allow Flash anyway.
2017-05-22 14:29:06 +01:00
Bob Owen
f24abd4ac3 Bug 1339105 Part 1: Implement Windows Level 3 content process sandbox policy. r=jimm
MozReview-Commit-ID: L8wcVhdLvFe
2017-05-22 14:29:06 +01:00
Christoph Kerschbaumer
e4f38c8d7c Bug 1362993 - Rewrite gBrowser.addTab() to use BrowserTestUtils.addTab(). r=florian 2017-05-15 21:49:50 +02:00
Alex Gaynor
33b7e1fa87 Bug 1363179 - do not allow content processes to read from /Volumes on macOS r=haik
MozReview-Commit-ID: 8osJVQD3myh

--HG--
extra : rebase_source : 8cda32ca1bca80b796458d36099244a45af2f185
2017-05-12 16:18:57 -04:00
Alex Gaynor
9a4c947617 Bug 1363729 - Fixed a small formatting regression in tests. r=haik
MozReview-Commit-ID: 7I6tKS6yoM7

--HG--
extra : rebase_source : 03a652024d30a57ad270338bc6e222281d0e7c78
2017-05-10 10:05:25 -04:00
Hemant Singh Patwal
fd32e8da4a Bug 1359614 - Move the security/manager/.eslintrc.js to security/.eslintrc.js and fix the ESLint issues raised. r=standard8
MozReview-Commit-ID: AlfInBsIPnF

--HG--
rename : security/manager/.eslintrc.js => security/.eslintrc.js
extra : rebase_source : 4dfdd45a4f1e4d3e45e2ef353dd0bb343a3d1adb
2017-05-09 19:48:02 +05:30
Alex Gaynor
445480436b Bug 1361733 - In debug builds, do not allow content sandbox to write to all of /private/var r=haik
This permission was needed for the memory bloat logging, which is used for
leaktest, including logging intentionally crashing processes. Now we restrict
ourselves to only allowing writes to the location needed for this logging,
rather than all of /private/var.

MozReview-Commit-ID: 5AbJEZlDHNV

--HG--
extra : rebase_source : 26936b8d8bca53f2c37a195b5e7c69c151ec18d2
2017-05-02 11:07:10 -04:00
Haik Aftandilian
8c95154f41 Bug 1361304 - Remove /private/var read access from Mac level 3 content sandbox; r=Alex_Gaynor
Removes read access to /private/var and its subdirectories from
the content process under the level 3 Mac sandbox. Still permits
reading of file metadata within the majority of /private/var.

Adds tests to validate the level 3 Mac content sandbox prevents
reading from /private.

MozReview-Commit-ID: FO5dz0F7dl4

--HG--
extra : rebase_source : 226f8de6d4d88f188c272a3e119ed7b8bac292df
2017-05-05 10:48:52 -07:00
Jed Davis
3c4e538953 Bug 1361238 - Re-allow accept4, used by accessibility. r=gcp
MozReview-Commit-ID: 3M3T3bkx4nP

--HG--
extra : rebase_source : b67332889615ae34cc67737da361f21ae545aeb4
2017-05-01 21:51:11 -06:00
Haik Aftandilian
cbffb758e8 Bug 1360356 - [Mac] Remove "/Library/Caches/TemporaryItems" rule from level 3 Content Sandbox; r=Alex_Gaynor
Remove reading of "~/Library/Caches/TemporaryItems" from level 3 and update
sandboxing filesystem test to check ~/Library/Caches/TemporaryItems readability.

MozReview-Commit-ID: 6EMzH7brSnp

--HG--
extra : rebase_source : f97b5625da2abda73decc969fc581c2bf858183f
2017-04-28 11:48:43 -07:00
Jed Davis
7d9acbdace Bug 1358647 - Disallow bind/listen/accept for Linux content processes. r=gcp
MozReview-Commit-ID: Cz9MKxOJnsS

--HG--
extra : rebase_source : d3ab7ff9020066d5fe9ac3121c88c85b9fde6224
2017-04-25 19:29:32 -06:00
David Parks
532fe74f04 Bug 1347710 - Enable sandbox protections for the Windows GPU process. r=bobowen
The sandbox works with levels.  The GPU sandbox level defaults to 1 in all builds.  It is controlled by security.sandbox.gpu.level.
2017-04-24 09:46:09 -07:00
Mike Hommey
34e619d1c1 Bug 1357323 - Remove support for gonk in the build system. r=gps
Everything depending on the widget being gonk can go away, as well as
everything depending on MOZ_AUDIO_CHANNEL_MANAGER, which was only
defined on gonk builds under b2g/ (which goes away in bug 1357326).

--HG--
extra : rebase_source : 9f0aeeb7eea8417fa4e06d662d566d67ecaf2a24
2017-04-18 16:56:09 +09:00
Jed Davis
e6622cfe8a Bug 1355273 - Allow inotify_init alongside inotify_init1. r=Alex_Gaynor,gcp
MozReview-Commit-ID: 5hAapLdbmeh

--HG--
extra : rebase_source : 2646d97dbdbf8803468c7115b50ae9ab91eae1ca
2017-04-14 16:17:39 -06:00
Alex Gaynor
82705afe91 Bug 1354678 - Switch our sandbox policies to use C++ raw strings and put them in a new header file r=haik
r=haik

MozReview-Commit-ID: Fr5liCjcJtg

--HG--
extra : rebase_source : 3e90f7075e4e5b410ba0b8a08b0c6e403eb925f6
2017-04-14 13:12:09 -04:00
Jed Davis
7d599256ca Bug 1354731 - Quietly fail mknod of character devices in content sandbox. r=gcp
MozReview-Commit-ID: 2aehI5V7tQp

--HG--
extra : rebase_source : ea933354e4018542e4dedda63318153c7cfbdd4e
2017-04-11 13:22:26 -06:00
Alex Gaynor
54bd982c43 Bug 1355083 - Switch from using a #define to alter a sandbox policy to a normal param r=haik
r=haik

MozReview-Commit-ID: KqmRra6NqPa

--HG--
extra : rebase_source : 02bf4390738f8a43ecc07c0a236a2553781df223
2017-04-10 09:53:47 -04:00
Wes Kocher
5eabc03c18 Merge m-c to autoland a=merge 2017-04-10 16:55:21 -07:00
Haik Aftandilian
5c4955b4d4 Bug 1354674 - Introduce, but don't enable, a level 3 Mac content sandbox with home directory read access disabled r=Alex_Gaynor
MozReview-Commit-ID: 2LThF6XTsoo

--HG--
extra : rebase_source : 8731aa87bde647cfdbea05cde8376e42f49d9a08
2017-04-07 18:14:01 -07:00
Alex Gaynor
44ae0c536b Bug 1295700 - Don't allow content processes to access the weave director on macOS r=haik
These directories contain sensitive content, and access is not necessary now that we have file content processes.

r=haik

MozReview-Commit-ID: FiRJkMnlYUx

--HG--
extra : rebase_source : 0bcdefcb1ea410fb26c3f8373673488e2a5fdd75
2017-04-06 15:20:23 -04:00
Bob Owen
48b2af658f Bug 1329294 Part 2: Enable content temp file test on Windows. r=haik 2017-04-10 14:39:58 +01:00
Phil Ringnalda
5da888bcd4 Merge m-c to autoland 2017-04-05 21:34:29 -07:00
Phil Ringnalda
4c78879252 Backed out 2 changesets (bug 1329294) for Win8 debug bustage in test_refresh_firefox.py TestFirefoxRefresh.testReset, a=merged-around-permaorange
Backed out changeset 08e2719fe7be (bug 1329294)
Backed out changeset 3b1bbf6392f4 (bug 1329294)
2017-04-05 21:32:08 -07:00
Bob Owen
f84f44fbfa Bug 1329294 Part 2: Enable content temp file test on Windows. r=haik 2017-04-05 16:34:36 +01:00
Alex Gaynor
beb64a1329 Bug 1353040 - Switch from sandbox_init to sandbox_init_with_parameters. r=haik
This API produces much more readable code (though slightly more verbose). While this is not a publicly documented API on macOS, it is used by both WebKit and Chrome.

MozReview-Commit-ID: LVxYT4wBLck

--HG--
extra : rebase_source : 9688981ea0bb4e71f084afc404af705fa68f84a3
2017-04-04 13:40:36 -04:00
Wes Kocher
264adb55c2 Merge m-c to autoland, a=merge 2017-04-05 14:20:01 -07:00
Alex Gaynor
49d40030b6 Bug 1348269 - When SpawnTarget fails during Windows sandboxed process creation, log more information r=bobowen
r=bobowen

MozReview-Commit-ID: HTLPYg870rt

--HG--
extra : rebase_source : 5c7fc4045324d442ff372ec700b57c12c4d10080
2017-04-04 10:54:14 -04:00
Bob Owen
22ff7c4117 Bug 1337331 Part 7: Re-apply - Allow a special all paths rule in the Windows process sandbox when using semantics FILES_ALLOW_READONLY. r=jimm
This also changes the read only related status checks in filesystem_interception.cc to include STATUS_NETWORK_OPEN_RESTRICTION (0xC0000201), which gets returned in some cases and fails because we never ask the broker.

Carrying r=jimm from original changeset:
https://hg.mozilla.org/mozilla-central/rev/1755a454e2de

MozReview-Commit-ID: 4tfygPiKG9Z
2017-03-28 08:36:16 +01:00
Bob Owen
6a5727b408 Bug 1337331 Part 6: Re-apply - Change USER_NON_ADMIN access token level from whitelist to blacklist containing Admin SIDs. r=jimm
Carrying r=jimm from original changeset:
https://hg.mozilla.org/mozilla-central/rev/0e6bf137521e

MozReview-Commit-ID: ExTtkUIPXH8
2017-03-29 14:23:17 +01:00
Bob Owen
927986bc20 Bug 1337331 Part 5: Re-apply - Add KEY_WOW64_64Key and KEY_WOW64_32KEY to the Chromium sandbox allowed registry read flags. r=aklotz
Carrying r=aklotz from previous changset:
https://hg.mozilla.org/mozilla-central/rev/d24db55deb85
2016-12-22 11:11:07 +00:00
Bob Owen
00ab6f4bb3 Bug 1337331 Part 4: Re-apply - Change to allow network drives in sandbox rules with non-file device fix. r=aklotz
Carrying r=aklotz from previous changeset:
https://hg.mozilla.org/mozilla-central/rev/c70d06fa5302
2016-02-01 08:59:00 +00:00
Gian-Carlo Pascutto
028f459d39 Bug 1337331 Part 3: Re-apply - Update chromium's list of linux-x86-32 syscalls. r=jld
Carrying r=jld from previous changset:
https://hg.mozilla.org/mozilla-central/rev/e834e810a3fa

MozReview-Commit-ID: KnrK8HisHiX
2016-06-08 20:36:04 +02:00
Bob Owen
1492af2edd Bug 1337331 Part 2: Re-apply - Logging changes to the Chromium interception code. r=tabraldes
Carrying r=tabraldes from previous changset:
https://hg.mozilla.org/mozilla-central/rev/a05726163a79
2014-11-29 17:12:18 +00:00
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
Bob Owen
2a12392590 Bug 1344453 Part 2: Add FILES_ALLOW_READONLY rule to all paths when Windows child process should have full read access. r=jimm 2017-03-28 08:36:16 +01:00
Bob Owen
0ee38abf35 Bug 1344453 Part 1: Allow a special all paths rule in the Windows process sandbox when using semantics FILES_ALLOW_READONLY. r=jimm
This also changes the read only related status checks in filesystem_interception.cc to include STATUS_NETWORK_OPEN_RESTRICTION (0xC0000201), which gets returned in some cases and fails because we never ask the broker.
2017-03-28 08:36:16 +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
Carsten "Tomcat" Book
50ef4d1d1b Backed out changeset 226c893c5d62 (bug 1337331) 2017-03-24 11:23:42 +01:00
Carsten "Tomcat" Book
3a931395eb Backed out changeset 438b6307c802 (bug 1337331) 2017-03-24 11:23:40 +01:00
Carsten "Tomcat" Book
8dd606e5ce Backed out changeset c4aa6b85411d (bug 1337331) 2017-03-24 11:23:37 +01:00
Carsten "Tomcat" Book
a69a0cc262 Backed out changeset 5cd2e692ee0c (bug 1337331) 2017-03-24 11:23:35 +01:00
Carsten "Tomcat" Book
ed6b3bc409 Backed out changeset 0dd9bae0b6b1 (bug 1337331) 2017-03-24 11:23:33 +01:00
Bob Owen
b99c6e7ae0 Bug 1337331 Part 6: Re-apply - Change USER_NON_ADMIN access token level from whitelist to blacklist containing Admin SIDs. r=jimm
Carrying r=jimm from original changeset:
https://hg.mozilla.org/mozilla-central/rev/0e6bf137521e

MozReview-Commit-ID: ExTtkUIPXH8
2017-03-23 10:29:05 +00:00
Bob Owen
b2f5aa5c23 Bug 1337331 Part 5: Re-apply - Add KEY_WOW64_64Key and KEY_WOW64_32KEY to the Chromium sandbox allowed registry read flags. r=aklotz
Carrying r=aklotz from previous changset:
https://hg.mozilla.org/mozilla-central/rev/d24db55deb85
2016-12-22 11:11:07 +00:00
Bob Owen
d3f4202804 Bug 1337331 Part 4: Re-apply - Change to allow network drives in sandbox rules with non-file device fix. r=aklotz
Carrying r=aklotz from previous changeset:
https://hg.mozilla.org/mozilla-central/rev/c70d06fa5302
2016-02-01 08:59:00 +00:00
Gian-Carlo Pascutto
3775b02a92 Bug 1337331 Part 3: Re-apply - Update chromium's list of linux-x86-32 syscalls. r=jld
Carrying r=jld from previous changset:
https://hg.mozilla.org/mozilla-central/rev/e834e810a3fa

MozReview-Commit-ID: KnrK8HisHiX
2016-06-08 20:36:04 +02:00
Bob Owen
d0866c1ee4 Bug 1337331 Part 2: Re-apply - Logging changes to the Chromium interception code. r=tabraldes
Carrying r=tabraldes from previous changset:
https://hg.mozilla.org/mozilla-central/rev/a05726163a79
2014-11-29 17:12:18 +00: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
Jonathan Kew
17d57d21e1 Bug 1340351 - Allow sandboxed content process on macOS to access fonts synced by Adobe Creative Cloud. r=haik 2017-03-16 22:26:43 +00:00
Florian Quèze
37bbced84d Bug 1344711 - hand cleanup of remaining useless try blocks around get*Pref calls identified by eslint, r=jaws.
--HG--
extra : rebase_source : 18c027010838faba91f0ac699f9bde07f85500e7
2017-03-07 15:29:48 +01:00
Honza Bambas
654b5c9af9 Bug 1320458 - Make logging by sandboxed child processes to a file work on Windows, r=aklotz
MozReview-Commit-ID: 7eiW3Lo6q8Z
2017-03-06 17:42:31 +01:00
Haik Aftandilian
8f8a9f5255 Bug 1344106 - Remove Linux todos() now that Linux sandboxing is riding the trains. r=haik
MozReview-Commit-ID: 9tI2S6fEYkD

--HG--
extra : rebase_source : 0a5d00f8498861e7ea281e527b2be6b2c4e472d6
2017-03-03 09:50:29 +01:00
Bob Owen
d30aee57bf Bug 1339729: Remove wow_helper from Windows process sandboxing. r=glandium 2017-03-01 10:41:07 +00:00
David Parks
672079f03f Bug 1329328 - Permit sandboxed processes to access Flash temporary files. r=bobowen
Allows the creation/use of temp files when the user has already green-lit
the use of a file for write purposes in that folder.
2017-02-27 14:15:52 -08:00
Benjamin Bouvier
bcd3dcc6b3 Bug 1342385: Allow mremap on linux32 for wasm; r=jld
MozReview-Commit-ID: 82f8ryvd57S

--HG--
extra : rebase_source : 0e74611052853f149eb0fefe8fef849a8f8978b0
extra : amend_source : ff91bb31d45ca4783da391e519f10e3613f0f890
2017-02-24 13:18:57 +01:00
David Parks
7f64ae96ea Bug 1284897 - Add mechanism to libsandbox_s to track names of files that have been given special sandbox access permissions (PermissionsService). r=bobowen
Hook this into the browser via the XREAppData. This patch contains only the changes to Chromium source code.

--HG--
extra : rebase_source : f1ddd3bdfb52cef0a2dc8bfbae4ba5c78e7fd7eb
2017-01-20 08:27:57 -08:00
David Parks
26437f4ecd Bug 1284897 - Add mechanism to libsandbox_s to track names of files that have been given special sandbox access permissions (PermissionsService). r=bobowen, r=glandium
Hook this into the browser via the XREAppData. This patch does not include the changes to Chromium source code.

--HG--
extra : rebase_source : 4d5637bcdbeae605b0b99e9192598d48f371b698
2017-02-14 15:08:40 -08:00
Sebastian Hengst
68e7240c0c Backed out changeset 71b9ac06a60a (bug 1284897) 2017-02-21 23:13:29 +01:00
Sebastian Hengst
0155610268 Backed out changeset 0740284125d3 (bug 1284897) 2017-02-21 23:13:24 +01:00
David Parks
5b871d6f30 Bug 1284897 - Add mechanism to libsandbox_s to track names of files that have been given special sandbox access permissions (PermissionsService). r=bobowen
Hook this into the browser via the XREAppData. This patch contains only the changes to Chromium source code.

--HG--
extra : rebase_source : 309715aa2449d53456934495b1f5e854df599bfb
extra : histedit_source : 26761a6a33e4e5b2bb559caf3b3eb51c249f2bcd
2017-01-20 08:27:57 -08:00
David Parks
82eb0f3fdd Bug 1284897 - Add mechanism to libsandbox_s to track names of files that have been given special sandbox access permissions (PermissionsService). r=bobowen, r=glandium
Hook this into the browser via the XREAppData. This patch does not include the changes to Chromium source code.

--HG--
extra : rebase_source : e34e8b50101cc40ded26e80791052123b24c8243
extra : histedit_source : 69c9b2dc91546adbfdad03b5d43842809191ffb9
2017-02-14 15:08:40 -08:00
Jed Davis
a01b0b45dd Bug 1286865 - Step 4: Report rejected syscall info in Telemetry. r=gcp r=francois
MozReview-Commit-ID: 7R755WT1Ftu

--HG--
extra : rebase_source : 77356e29da9a02a3a4392be3de0e9e88ed9e131e
extra : histedit_source : 813980d967009d4270143ce3a503836c7337941f
2017-02-20 19:55:56 +01: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
eb0d19601a Bug 1286865 - Step 0: Turn off crash-on-seccomp-fail by default on non-nightly. r=gcp
MozReview-Commit-ID: 1It6HNizbAc

--HG--
extra : rebase_source : 1e96f11904abf2c38c5b4e50de7609ddc86cdd8a
2017-01-27 14:25:50 -07:00
Phil Ringnalda
87ae1a50e4 Backed out 5 changesets (bug 1284897) for mozilla::SandboxPermissions::RemovePermissionsForProcess crashes
Backed out changeset 19b2fcee13a9 (bug 1284897)
Backed out changeset a5171791437f (bug 1284897)
Backed out changeset 3ea8b8a18515 (bug 1284897)
Backed out changeset 21497a4e3bde (bug 1284897)
Backed out changeset 12e17d5f0fa9 (bug 1284897)
2017-02-16 22:14:15 -08:00
David Parks
3fd846f6a8 Bug 1284897 - Add mechanism to libsandbox_s to track names of files that have been given special sandbox access permissions (PermissionsService). r=bobowen
Hook this into the browser via the XREAppData. This patch contains only the changes to Chromium source code.
2017-01-20 08:27:57 -08:00
David Parks
e9bcaf4cbe Bug 1284897 - Add mechanism to libsandbox_s to track names of files that have been given special sandbox access permissions (PermissionsService). r=bobowen, r=glandium
Hook this into the browser via the XREAppData. This patch does not include the changes to Chromium source code.
2017-02-14 15:08:40 -08:00
Wes Kocher
017c515285 Merge inbound to m-c a=merge
MozReview-Commit-ID: IKI0zVtF1n9
2017-02-15 16:18:13 -08:00
Bob Owen
209be0e8ce Bug 1339389: Remove legacy build config from Windows SandboxBroker moz.build. r=glandium
MozReview-Commit-ID: KA3dCxrCZRo
2017-02-15 08:31:14 +00:00
Matt Woodrow
0686551eab Bug 1325227 - Part 3: Allow child process to share semaphore handles with the parent/gpu processes. r=bobowen 2017-02-04 23:19:03 +13:00
Sylvestre Ledru
455bdf24fe Bug 1338086 - Remove useless else blocks in order to reduce complexity in security/sandbox/linux/ r=gcp
MozReview-Commit-ID: 5UWtAe6THd6

--HG--
extra : rebase_source : 17af6640439f209cb37e91552cf0f97043bd9e91
2017-02-09 10:56:05 +01:00
Sylvestre Ledru
26605e4a7d Bug 1337358 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in security/sandbox/ r=gcp
MozReview-Commit-ID: Iwj7i07LkJ0

--HG--
extra : rebase_source : 88a71d78dd6d3e4cf603047a5714631b4ae4542b
2017-02-08 11:59:38 +01:00
Carsten "Tomcat" Book
775c0b6d2b Merge mozilla-central to mozilla-inbound 2017-02-07 14:14:38 +01:00
Haik Aftandilian
fe1e99cceb Bug 1333681 - Part 2 - Adds tests for reading of the profile dir; r=bobowen,gcp
Adds additional tests that try to read files and get directory listings from
both a web content process and a file content process.

Tests include attempting to read the profile directory and cookies file from
a web content process and validating that this is prevented by the sandbox
when the sandbox level (security.sandbox.content.level) is set high enough.
Only Mac (for now) uses a level that includes read access blocking of the
profile directory.

Tests also attempt to read the profile and cookies file from a file content
process which should be allowed.

MozReview-Commit-ID: KfyT9ohsuuG

--HG--
extra : rebase_source : f1c5aa2fef58a6bb859623072770ea918f8f4df1
2017-02-01 21:26:23 -08:00
Bob Owen
0b173d4f36 Bug 1321724: Change USER_NON_ADMIN access token level from whitelist to blacklist containing Admin SIDs. r=jimm
MozReview-Commit-ID: 9cx2R6kMUwa
2017-02-07 10:59:43 +00:00
Carsten "Tomcat" Book
ac8a2fb906 Backed out changeset a608c5cc4ff8 (bug 1321725) for landing with wrong bug number
--HG--
extra : rebase_source : 1d7b5b836c1e67507c6592c11d1bfe50623eee84
2017-02-07 11:50:54 +01:00
Bob Owen
2ca65ce116 Bug 1321725: Change USER_NON_ADMIN access token level from whitelist to blacklist containing Admin SIDs. r=jimm
MozReview-Commit-ID: 9cx2R6kMUwa
2017-02-07 10:38:24 +00:00
Jed Davis
467786d86a Bug 1335329 - Improve handling of mkdir() on preexisting directories in Linux sandbox file broker. r=gcp
If the path given doesn't have write+create permissions in the broker
policy, but does have MAY_ACCESS (i.e., if checking for its existence
with lstat() or access() would be allowed), then check for its existence
and fail with EEXIST the way the the real mkdir() would.

Note that mkdir() fails with EEXIST even the existing file isn't a
directory, including if it's a broken symlink.

MozReview-Commit-ID: 13Cwnq1nRrw

--HG--
extra : rebase_source : c37caa091583fa85a0a72ed62fa9f12a3523e8f4
2017-02-02 11:56:21 -07:00
Olli Pettay
5de2e3d5f6 Bug 1335323 - Move vector include to sandbox header to fix bustage. r=bustage-fix a=bustage-fix 2017-01-31 13:06:22 +01:00
Gian-Carlo Pascutto
aa1bdaad34 Bug 1330326 - Make sandboxing policy more configurable via preferences. r=jld
MozReview-Commit-ID: 9P0bSLLKRWp

--HG--
extra : rebase_source : e1d2f34e5d0901614d88a583beecb704369ce478
2017-01-26 19:59:50 +01:00
Haik Aftandilian
9086ac87fb Bug 1332522 - Part 2 - Remove read restrictions from level 2 policy for file content processes; r=gcp
Update MacSandboxInfo struct to include file system read flag and remove
filesytem read restrictions from the file content process sandbox.

MozReview-Commit-ID: B9LPocvb0W3

--HG--
extra : rebase_source : 7c80335c28dbdb7146d2ad0b447959db5e06cf0f
2017-01-24 15:20:08 -08:00
Sebastian Hengst
e1d5db133e Backed out changeset e87ae43ca443 (bug 1330326) 2017-01-27 20:59:55 +01:00
Gian-Carlo Pascutto
0d2bf66dfd Bug 1330326 - Make sandboxing policy more configurable via preferences. r=jld
MozReview-Commit-ID: 9P0bSLLKRWp

--HG--
extra : rebase_source : ab7d7da81459bd08c6aec7d7c89949ca7207471f
2017-01-26 19:59:50 +01:00
David Parks
990402c301 Bug 1317735 - Consolidate env vars for logging. r=jimm
Assigns the preference security.sandbox.logging.enabled and the environment variable MOZ_SANDBOX_LOGGING to control whether or not sandbox violations are logged.  The pref defaults to true.  On Linux, only the environment variable is considered.

--HG--
extra : rebase_source : f67870a74795228548b290aec32d08552c068874
2017-01-23 12:46:49 -08:00
David Parks
033c45c4ef Bug 1306239 - Add pref to toggle OS X sandbox violation debugging, default on. r=haik
Turns on sandbox denial logging if security.sandbox.logging.enabled is true.

Removes most sandbox violation messages but some related messages generated
by other processes will still get through.

--HG--
extra : rebase_source : 4f06e70d53b0f500cc85a869c5bd7f8ea20d8341
2017-01-17 15:47:13 -08:00
Chris Peterson
4d95c4db20 Bug 1330496 - Part 1: Remove MOZ_WIN_INHERIT_STD_HANDLES_PRE_VISTA support for inheriting stdout/stderr handles on XP. r=bobowen
MozReview-Commit-ID: B7qJdK2sjv5

--HG--
extra : rebase_source : 4053054009359c0a775dae5ad5e24ba74b4c7c7b
extra : amend_source : 3231886a86fd03ac52f3717e22f33a7b4dc41f54
extra : histedit_source : 4533b894f9894bf5c883943bc53b260faa2ae8b1
2017-01-10 23:50:16 -08:00
Eric Rahm
87cfbc1b65 Bug 1322735 - Remove MOZ_STACKWALKING define. r=glandium
With frame pointer omission disabled we should always have usable stacks on Windows. This allows us to remove the MOZ_STACKWALKING define as it will always be enabled.

MozReview-Commit-ID: 54xs3Hf1r4P

--HG--
extra : rebase_source : dfaf13fb4c2185985f4f074c338ccf1fef8f3c94
2016-12-20 15:11:36 -08:00
Haik Aftandilian
d144ed6ded Bug 1309394 - automated tests to validate content process sandboxing works as intended; r=bobowen,gcp
Adds security/sandbox/test/browser_content_sandbox_fs.js for validating content
sandbox file I/O restrictions.

Adds security/sandbox/test/browser_content_sandbox_syscalls.js for validating
OS-level calls are sandboxed as intended. Uses js-ctypes to invoke native
library routines. Windows tests yet to be added here.

Adds security/sandbox/test/browser_content_sandbox_utils.js with some
shared utility functions.

MozReview-Commit-ID: 5zfCLctfuN5

--HG--
extra : rebase_source : 4edd14220bcd18b15a3c522e44d7223547a79f43
2017-01-10 22:01:03 -08:00
Phil Ringnalda
1c2d0d367f Backed out 3 changesets (bug 1322735) for ASan leaks and xpcshell/selftest.py failures
CLOSED TREE

Backed out changeset 01cfc71ce542 (bug 1322735)
Backed out changeset 84c729c41230 (bug 1322735)
Backed out changeset b419aaefae95 (bug 1322735)
2017-01-10 20:17:34 -08:00
Eric Rahm
2e195de610 Bug 1322735 - Remove MOZ_STACKWALKING define. r=glandium
With frame pointer omission disabled we should always have usable stacks on Windows. This allows us to remove the MOZ_STACKWALKING define as it will always be enabled.

MozReview-Commit-ID: 54xs3Hf1r4P

--HG--
extra : rebase_source : 5fe27cdeeb464d81fbedc8c02ac187658bd759e7
2016-12-20 15:11:36 -08:00
Haik Aftandilian
ae26e69231 Bug 1324610 - Some printing permissions still needed by content processes; r=gcp
MozReview-Commit-ID: B7nPgf5Xc9x

--HG--
extra : rebase_source : ac689b4b264bef73266baec3e284f2eb6575da86
2017-01-03 14:33:14 -08:00
Haik Aftandilian
7e7b9330e3 Bug 1322716 - Remove /private/var regex from GMP sandbox rules. r=jesup, r=cpearce, r=gcp
MozReview-Commit-ID: I1Y2MOum5T3
2016-12-19 18:16:31 -08:00
Haik Aftandilian
05755370a0 Bug 1322370 - Disable camera access in the Mac content sandbox; r=jimm
MozReview-Commit-ID: CSEXN1B0Al8

--HG--
extra : rebase_source : cb83c181b11229587f6381ebf2f348d1ab4a6d9b
2016-12-06 12:34:15 -10:00
Bob Owen
badd6bf1b0 Bug 1273372 Part 4: Add AppLocker rules to GMP sandbox policy. r=aklotz 2016-12-22 11:11:07 +00:00
Bob Owen
01b653ad07 Bug 1273372 Part 3: Add KEY_WOW64_64Key and KEY_WOW64_32KEY to the Chromium sandbox allowed registry read flags. r=aklotz 2016-12-22 11:11:07 +00:00
Bob Owen
9d42290e8c Bug 1273372 Part 2: Re-apply change to allow network drives in sandbox rules with non-file device fix. r=aklotz 2016-02-01 08:59:00 +00:00
Bob Owen
fe98a5b119 Bug 1273372 Part 1: Backout change to allow network drives in sandbox rules. r=backout 2016-12-22 11:11:06 +00:00
Bob Owen
c7db6e3961 Bug 1321256: Use a USER_UNPROTECTED initial token when the delayed token is not restricted. r=jimm 2016-12-14 14:43:06 +00:00
Carsten "Tomcat" Book
b54e4ad90d Merge mozilla-central to autoland 2016-12-07 11:40:35 +01:00
Jed Davis
416e1ecb8f Bug 1257361 - Simplify detecting threads that already have seccomp-bpf applied. r=tedd r=gcp 2016-12-06 12:38:22 -10:00
Gian-Carlo Pascutto
c028a5f875 Bug 1309098 - Add ALSA devices to filesystem policy whitelist. r=glandium
MozReview-Commit-ID: F2GmQEj9XEN

--HG--
extra : rebase_source : 8444d905acd3bf62668c30f04cbfd9669de96d0b
2016-10-11 16:35:39 +02:00
Jed Davis
2f25df5d1e Bug 1320085 - Allow the getrlimit-equivalent subset of prlimit64. r=tedd
This applies only to content processes, where we already allow getrlimit
(but not setrlimit).  The rule added here does not allow using prlimit64
to set any resource limits or interact with any other process.

MozReview-Commit-ID: nMry3t6QPj

--HG--
extra : rebase_source : ecf792077a672ab1f2c5edf9fbeb915a0d8dd30e
2016-11-28 12:05:28 -07:00
Bob Owen
8865218aa3 Bug 1147911 Part 9: Ensure file read permissions for file content process on Windows. r=jimm, r=jld 2016-11-24 15:08:32 +00:00
Sebastian Hengst
c7964131c3 Backed out changeset 11a036eafea2 (bug 1147911) 2016-11-23 18:32:42 +01:00
Bob Owen
ca93c43645 Bug 1147911 Part 9: Ensure file read permissions for file content process on Windows. r=jimm, r=jld 2016-11-23 13:36:59 +00:00
Carsten "Tomcat" Book
59bb309e38 merge mozilla-inbound to mozilla-central a=merge 2016-11-21 15:44:20 +01:00
Julian Seward
8358f9ad56 Bug 1318012 - SandboxBrokerCommon::SendWithFd sends uninitialised stack-allocated data out of process. r=jld@mozilla.com. 2016-11-21 07:33:19 +01:00
Wei-Cheng Pan
8c8c3ceae9 Bug 1046166 - Add sandbox white list for userContent.css on MacOSX. r=haik,pbro
MozReview-Commit-ID: BVnGjaSSkEh

--HG--
extra : rebase_source : 6ba3386be877f72bbbde8e5fb61b31a88d9d63a2
2016-11-17 11:56:10 +08:00
Sebastian Hengst
a0103a13ec Backed out changeset a5c68edf3788 (bug 1147911) 2016-11-18 00:58:51 +01:00
Bob Owen
87b58c6a19 Bug 1147911 Part 9: Ensure file read permissions for file content process on Windows. r=jimm, r=jld 2016-11-17 15:48:53 +00: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
Phil Ringnalda
c9fdc270b6 Merge m-c to autoland
--HG--
rename : dom/media/webaudio/compiledtest/TestAudioEventTimeline.cpp => dom/media/webaudio/gtest/TestAudioEventTimeline.cpp
2016-11-03 20:02:24 -07:00
Gian-Carlo Pascutto
35af45b5fe Bug 1312678 - Whitelist DRI drivers in the content sandbox, for WebGL. r=jld
MozReview-Commit-ID: 82nCmXqnCbp

--HG--
extra : rebase_source : 8a94e2754a13bd82a007c087dd5b97c4e5c13e7a
2016-11-02 20:02:42 +01: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
Phil Ringnalda
16acd6fa33 Merge m-c to autoland 2016-10-27 20:40:39 -07:00
Gian-Carlo Pascutto
8b0d2992cb Bug 1310116 - Allow waitpid but warn on creating processes in content. r=jld
MozReview-Commit-ID: JjNfA6wUe3T

--HG--
extra : rebase_source : ad565d238e7554a951d2f6b4e076918bdfd7a450
extra : histedit_source : 127ff408e498f7c687cf6e7f8f7b4e2fbb8c5ae8
2016-10-25 20:43:42 +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
Jed Davis
13fea0b617 Bug 1268733 - Move sandbox telemetry / crash annotation code from mozsandbox to libxul. r=haik 2016-10-26 16:57:10 -06:00
Haik Aftandilian
0ebb0c2d3e Bug 1306508 - Whitelist /private/var/folders/ in DEBUG and reduce content process write access further; r=gcp
Removes global write access from the content process (instead of
just blocking write access to $HOME) for level 1 and 2 Mac content
sandboxes. Allows writes to /private/var/folders/[0-9][0-9]/ in
DEBUG mode so that leaktest can continue to work.

MozReview-Commit-ID: 635o7Nj9oW1

--HG--
extra : rebase_source : 7e23612f56a31de83307057c1e6d0eaadb937614
2016-10-12 11:53:38 -07:00
Haik Aftandilian
10dcc223b4 Bug 1312273 - Twitter videos can't play in recent nightlies on OS X 10.9; r=gcp
MozReview-Commit-ID: JidUYCkR8Lp

--HG--
extra : rebase_source : cda86dd86ed1359c979176513cd06a79fa2ab3c8
2016-10-24 10:37:54 -07:00
Andi-Bogdan Postelnicu
c7be178cd3 Bug 1309133 - null terminate pathBuf2 in SandboxBroker::ThreadMain. r=gcp
MozReview-Commit-ID: 8iA4Yzwj8nv

--HG--
extra : rebase_source : 81af49ea741957a3a79c91dd5503196a0a28a9ef
2016-10-11 15:42:39 +03:00
Haik Aftandilian
871aa1294d Bug 1307573 - Remove unused system.sb mach-lookups from OS X content sandbox; r=jimm
MozReview-Commit-ID: JDnLDbYs2IV

--HG--
extra : rebase_source : cba1eb50169fdb6d50ad8c900c98c8855cc71793
2016-10-03 17:11:01 -07:00
Gian-Carlo Pascutto
f0dece11a4 Bug 1308564 - Tie logging to MOZ_SANDBOX_VERBOSE instead of DEBUG. r=jld
MozReview-Commit-ID: JHIzIvbjA0Q

--HG--
extra : rebase_source : bb5652209a3fdb9e5cccb6c3cc4058fd74173fd1
2016-10-07 21:33:12 +02:00
Gian-Carlo Pascutto
f255eedb86 Bug 1308851 - Open up devices for NVIDIA proprietary driver in the sandbox. r=jld
MozReview-Commit-ID: 5OMRNSPBbe1

--HG--
extra : rebase_source : bb554a1f72a9e6bbde9250542989f5c34dfe7267
2016-10-10 20:51:21 +02:00
Haik Aftandilian
4f170e903e Bug 1307282 - Remove redundant read-metadata rights from the content sandbox; r=gcp
MozReview-Commit-ID: CILCWk4nINs

--HG--
extra : rebase_source : b3d738365a978505fdbc5ba0a94de62a8824e2f2
2016-09-30 11:59:48 -07:00
Haik Aftandilian
bef74339e5 Bug 1307282 - Remove unused sandbox ruleset macros; r=gcp
MozReview-Commit-ID: A7x55tDN4b9

--HG--
extra : rebase_source : 52ef8da1bf9df868c3f9cc0cbdfdee2147425454
2016-09-28 16:37:52 -07:00
Gian-Carlo Pascutto
5810afce39 Bug 1308568 - Add missing filesystem calls to Allow in case broker is disabled. r=haik
MozReview-Commit-ID: 6AdKbBH0NMh

--HG--
extra : rebase_source : aaf58affb124719b3d65dc819d98e7227abff8ec
2016-10-07 22:09:57 +02:00
Gian-Carlo Pascutto
bbcb394669 Bug 1289718 - Clean up stat/stat64 wrapper. Deal with non-default TMPDIR. r=jld
MozReview-Commit-ID: DW63be9qd3z

--HG--
extra : rebase_source : 0a1860c70a631b24bcafecb4946c044148536004
2016-10-06 13:25:13 +02:00
Gian-Carlo Pascutto
f3a1ed7502 Bug 1289718 - Extend sandbox file broker to handle paths, support more syscalls. r=jld,tedd
MozReview-Commit-ID: DW415ABoaeN
MozReview-Commit-ID: cXrlXNlEwh
MozReview-Commit-ID: CIX6d7td6Bc
MozReview-Commit-ID: DCQ9DGBBjm4
MozReview-Commit-ID: BOYSSof3t7
MozReview-Commit-ID: LmsTqv0GzC2
MozReview-Commit-ID: HOWR0HEHmMg
MozReview-Commit-ID: 6IzqdrUP7lD
MozReview-Commit-ID: 6r6sqOVekVu
MozReview-Commit-ID: 5FL2WkhIxFx
MozReview-Commit-ID: CcTyHn76p46
MozReview-Commit-ID: F8erB4Tvn2V
MozReview-Commit-ID: D9m10t0Rodc
MozReview-Commit-ID: I1llpEBgDP6

--HG--
extra : rebase_source : 1d50d5b7a9936c76decdf268a4e66e34ee7b200c
2016-09-27 17:25:06 +02:00
Bob Owen
61b439db23 Bug 1307375: Add the use of MOZ_LOG to windows sandbox logging. r=jimm 2016-10-05 08:10:46 +01:00
Tom Schuster
774a8bf34d Bug 1302163 - Change code to use SprintfLiteral instead of snprintf. r=ehsan 2016-10-04 17:57:51 +02:00
Bob Owen
7c28b45840 Bug 1102853: Remove PGO exception for sharedmem_ipc_client.cc. r=glandium
MozReview-Commit-ID: Qx44MNtns8
2016-10-04 09:18:27 +01:00
Haik Aftandilian
c7963e7731 Bug 1284588 - OS X: Disable content process write access to user files in the home directory; r=gcp
Changes the semantics of the security.sandbox.content.level pref on OS X with
respect to file access to the user's home directory. With the fix, Nightly
defaults to 2 while other releases will default to 1. The level values now
have the following meaning.

*) security.sandbox.content.level=0 disables content process sandboxing.
No change here.

*) security.sandbox.content.level=1 blocks write access to the majority of the
home directory.

*) security.sandbox.content.level=2 includes the write access blocking in
level 1, but also blocks both read and write access to ~/Library and $PROFILE
excluding the extensions and weave subdirectories.

Prior to this fix, Nightly defaulted to a value of 1 while all other releases
used 0. The value of 1 meant that read/write access to ~/Library and the
$PROFILE dir (excluding $PROFILE/{extensions,weave}) was prevented.

The strength of a level=1 sandbox is reduced by this with fix,
but level=1 becomes the first ride-the-trains content sandbox candidate,
Nightly changes to level=2, and higher levels still indicate a more
restrictive sandbox.

MozReview-Commit-ID: 7NJAe24T4pU

--HG--
extra : rebase_source : 8cb5ea82004ad631fe688bafffa9dc9979568679
2016-09-26 11:30:08 -07:00
David Parks
1748bfae57 Bug 1269114 - [x86_64] Last picked directory not saved when using Flash Player uploader. r=jimm
Adds a couple of registry paths to the broker's ALLOW policy.
2016-09-24 02:54:12 -07:00
Jed Davis
75b81d566f Bug 1303813 - Allow media plugins to call madvise with MADV_FREE. r=gcp
--HG--
extra : rebase_source : 42fa66774311cc1dcf2c18643c7118483acff89d
2016-09-26 16:10:00 -04:00
Jed Davis
cb2e7d319f Bug 1304220 - Allow media plugins to use the times(2) syscall. r=gcp
--HG--
extra : rebase_source : 595bf264b48968ec25d02c82866ef02ef87a59fa
2016-09-26 16:32:00 -04:00
Haik Aftandilian
497d8e9b73 Bug 1299329 - Remove printing-related privileges from content process sandbox; r=gcp
MozReview-Commit-ID: 9fnfkKvjpGx

--HG--
extra : rebase_source : bc1361b350171920ae8e19747c77287ea82f6f8f
2016-09-16 16:09:51 -07:00
Bob Owen
fe5ccaf977 Bug 1303325: Revert changes to policy_target.cc that cause issue with CoInitializeSecurity. r=aklotz
This also reverts the Bug 1287426 Part 8 patch that turned the USER_NON_ADMIN loken into a restricted token.

MozReview-Commit-ID: 9fNeyhAHw55

--HG--
extra : rebase_source : adbe59260d512b5d17b6e3ea6c1fe484c06eb555
2016-09-16 13:49:53 +01:00
Haik Aftandilian
9de1898bc2 Bug 1290619 - Content sandbox rules should use actual profile directory, not Profiles/*/ regex's; r=jimm
Passes the profile dir to the content process as a -profile CLI
option so that the correct profile dir can be used in the OS X content
sandbox rules.  Only enabled on OS X for now.

On Nightly, profile directories will now be read/write protected
from the content process (apart from a few profile subdirectories) even
when they don't reside in ~/Library.

xpcshell tests invoke the content process without providing a
profile directory. In that case, we don't need to add filesystem
profile dir. read/write exclusion rules to the sandbox.

This patch adds two new macros to the content sandbox rule set:
|profileDir| holds the path to the profile or the emptry string;
|hasProfileDir| is a boolean (1 or 0) that indicates whether or
not the profile directory rules should be added. If |hasProfileDir|
is 0, profile directory exclusion rules don't need to be added
and |profileDir| is not used.

MozReview-Commit-ID: rrTcQwTNdT

--HG--
extra : rebase_source : 3d5b612c8eb3a1d0da028eba277cd9d6f0c9ac00
2016-08-30 13:32:21 -07:00
Bob Owen
182a56ac2a Bug 1301034: Log when non-static file policy AddRule calls fail in Windows SandboxBroker. r=jimm
MozReview-Commit-ID: DA5NizLfFfA

--HG--
extra : rebase_source : 23ea76054c98ab071b0d03e5fc0d7e57d1668244
2016-09-12 11:11:22 +01:00
Bob Owen
83f2f5e72f Bug 1287426 Part 8: Change the USER_NON_ADMIN token to be a restricted token with the same access. r=aklotz
This is to work around an issue where the call to CoInitializeSecurity in MainThreadRuntime::InitializeSecurity causes the impersonation token, used to give the pre-lockdown permissions, to be replaced with one with no rights.
This only seems to happen when the lockdown token is USER_NON_ADMIN, which is not a restricted token.

MozReview-Commit-ID: 6HFuDFmWLTf
2016-09-06 08:57:22 +01:00
Gian-Carlo Pascutto
03bf07111a Bug 1287426 Part 7: Re-apply - Update chromium's list of linux-x86-32 syscalls. r=jld
Originally landed as changset:
https://hg.mozilla.org/mozilla-central/rev/adb1d2a92e0d

MozReview-Commit-ID: KpjitH5GQEq
2016-06-08 20:36:04 +02:00
Bob Owen
9f75777f5c Bug 1287426 Part 6: Re-apply - Change Chromium sandbox to allow rules for files on network drives to be added. r=aklotz
Originally landed as changset:
https://hg.mozilla.org/mozilla-central/rev/afa4f68de47c

MozReview-Commit-ID: A18C0KcEqvP
2016-02-01 08:59:00 +00:00
Bob Owen
a2ede75e08 Bug 1287426 Part 5: Re-apply - Logging changes to the Chromium interception code. r=tabraldes
Originally landed as changset:
https://hg.mozilla.org/mozilla-central/rev/0f763c186855

MozReview-Commit-ID: DtuHfDoB1Dx
2014-11-29 17:12:18 +00:00
Bob Owen
0a63c4cbc2 Bug 1287426 Part 4: Re-apply pre-vista stdout/err process inheritance change to Chromium code after merge. r=tabraldes
Originally landed as changset:
https://hg.mozilla.org/mozilla-central/rev/f94a07671389

MozReview-Commit-ID: 2dpjBXkzlze
2014-11-18 15:11:47 +00: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
Wes Kocher
81db6ce036 Merge m-c to autoland, a=merge 2016-08-30 18:15:33 -07:00
Gian-Carlo Pascutto
dd0d72c51a Bug 1295190 - Add sys_flock to seccomp whitelist. r=jld
MozReview-Commit-ID: 2GxNWzwfh3u

--HG--
extra : rebase_source : e64bb3d7e499f97dd77721c230bb849e0654ca05
2016-08-22 15:51:05 +02:00
Gian-Carlo Pascutto
7cb06880d3 Bug 1296309 - Return umask (PulseAudio) and wait4 (threads) to the whitelist. r=tedd
MozReview-Commit-ID: 72RrNf57FQQ

--HG--
extra : rebase_source : 875e95ee560ff35e81fb38e8459dfe7256c24735
2016-08-30 16:59:39 +02:00
Wes Kocher
ecea29f6a3 Backed out changeset 0f53bc1a9aea (bug 1290619) a=merge 2016-08-29 17:40:59 -07:00
Haik Aftandilian
3c44a5f111 Bug 1290619 - Content sandbox rules should use actual profile directory, not Profiles/*/ regexes. r=jimm
Passes the profile dir to the content process as a -profile CLI option so
that the correct profile dir can be used in the OS X content sandbox rules.
Only enabled on OS X for now.

On Nightly, profile directories will now be read/write protected from the
content process (apart from a few profile subdirectories) even when they
don't reside in ~/Library.

MozReview-Commit-ID: rrTcQwTNdT

--HG--
extra : rebase_source : d91d8939cabb0eed36b640766756548a790a301c
2016-08-25 15:19:52 -07:00
Wes Kocher
3343f6c576 Backed out changeset b357fab2feb4 (bug 1290619) for osx e10s crashes a=backout CLOSED TREE 2016-08-24 10:59:04 -07:00
Haik Aftandilian
d1e8cf113e Bug 1290619 - Content sandbox rules should use actual profile directory, not Profiles/*/ regex's. r=jimm
Passes the profile dir to the content process as a -profile CLI option so
that the correct profile dir can be used in the OS X content sandbox rules.
Only enabled on OS X for now.

On Nightly, profile directories will now be read/write protected from the
content process (apart from a few profile subdirectories) even when they
don't reside in ~/Library.

--HG--
extra : rebase_source : 7bf426f14f31b35c8b541e6d21183226db9836c7
2016-08-22 11:58:18 -07:00
Kan-Ru Chen
b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
Gian-Carlo Pascutto
e2d263a0f4 Bug 1296309 - Remove unused syscalls from the seccomp whitelist. r=tedd
MozReview-Commit-ID: BUDRwsuAu0W

--HG--
extra : rebase_source : 9fa3cf044d67ed09e9a6a4cd8c5d5b0023d8077d
2016-08-18 16:56:12 +02:00
Haik Aftandilian
f796c32cc7 Bug 1286480 - [10.12] Widevine CDM always crashes on Amazon since upgrade to macOS Sierra. r=gcp
Allow /System/Library/PrivateFrameworks/ to be read from the from the plugin sandbox.

--HG--
extra : rebase_source : 8b71b7daed4792d8ce67131819c90acb2f5891ea
2016-08-11 00:57:52 -07:00
Jed Davis
10843a73b7 Bug 1290896 - Allow readlink() in desktop Linux content processes. r=gps
Making readlink() always fail with EINVAL (the result of applying it
to a non-symlink) worked on B2G, but this is not the case on desktop.
(Note: originally the idea for the B2G file broker was that it would
ignore symlinks and map lstat to stat, so that behavior for readlink
would have been consistent, but as eventually implemented it does do
lstat as actual lstat.)

In particular, this seems to be causing something in the graphics
library stack to change what GL renderer it uses (?), and on some
systems the presence of the readlink->EINVAL rule causes it to load a
version of the llvmpipe software renderer with a crash bug, instead of
(we assume) some other driver that works.
2016-08-08 14:59:19 -07:00
Gian-Carlo Pascutto
c53a105dc7 Bug 1288410 - Basic implementation of AddDir and recursive Lookup. r=tedd
MozReview-Commit-ID: 36jAPfm29LO

--HG--
extra : rebase_source : 5eb2a9b02ad3c40375b9a4d9b3f38d75932e29b1
2016-08-10 15:09:58 +02:00
Carsten "Tomcat" Book
389a3e0817 merge mozilla-inbound to mozilla-central a=merge
--HG--
rename : mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java
rename : mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
rename : mobile/android/base/java/org/mozilla/gecko/gfx/LayerRenderer.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/LayerRenderer.java
rename : mobile/android/base/java/org/mozilla/gecko/gfx/PanningPerfAPI.java => mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/PanningPerfAPI.java
2016-08-04 15:55:50 +02:00
Alexandre Lissy
0af5b943b6 Bug 1284674 - Remove NUWA r=cyu
MozReview-Commit-ID: GyMRNzOBKw6

--HG--
extra : rebase_source : 293af1cd55f2035ce6a99f4ebf144059c32a2b8f
2016-08-02 14:54:00 +02:00
Jed Davis
5fc855cf94 Bug 1290343 - Fix Linux GMP sandbox policy's geteuid rule for 32-bit. r=tedd 2016-08-01 13:10:00 +02:00
Jed Davis
6f2404e02a Bug 1290633 - Soft-fail unexpected open() in GMP processes to avoid recursive crash. r=gcp 2016-08-01 15:47:00 +02:00
Jed Davis
938691d027 Bug 1290618 - Allow PR_SET_PTRACER in Linux sandbox policies to avoid recursive crash. r=tedd 2016-08-01 15:44:00 +02:00
L. David Baron
3e30ec6687 Bug 1290761 - Allow running jprof with sandbox enabled. r=jhector
jprof is an in-tree profiling tool that runs on Linux.

This fixes the error:

Sandbox: seccomp sandbox violation: pid 29698, syscall 38, args 0 140731305513136 0 830 22509600 1.  Killing process.
Sandbox: crash reporter is disabled (or failed); trying stack trace:
Sandbox: frame #01: __GI_setitimer (/build/glibc-GKVZIf/glibc-2.23/time/../sysdeps/unix/syscall-template.S:84)
Sandbox: frame #02: startSignalCounter(unsigned long) (.../mozilla-central/mozilla/tools/jprof/stub/libmalloc.cpp:464)

which occurs during shutdown when running with jprof enabled via the
JPROF_FLAGS environment variable containing JP_DEFER without actually
sending the signal to start jprof.  It presumably occurs sooner if jprof
is actually used either via JP_START or by senging a SIGPROF/SIGALRM.

With the patch, these steps run to completion.

MozReview-Commit-ID: Fx4tzEyqIj2

--HG--
extra : transplant_source : %2AU%15F%8A%C5%E6%1D%03%20%1B%F6W%E9%EB%DA%8F%E7f%5D
2016-08-01 08:49:48 +01:00
Julian Seward
a3b23bd33c Bug 1288726 - Seccomp sandbox doesn't play well with Valgrind. r=julian.r.hector. 2016-07-29 17:42:55 +02:00
Haik Aftandilian
4350d1fefd Bug 1288774 - Remove the OSX rule added in bug 1190032 for nsPluginHost::GetPluginTempDir. r=jimm 2016-07-25 14:43:00 -04:00
Julian Hector
6c0d578d0e Bug 1287008 - Add sys_fadvise64_64 to seccomp whitelist. r=gcp 2016-07-27 15:45:02 +02:00
Fabrice Desré
c23a54d9ec Bug 1289381 - Don't fail to build sandboxing with --disable-crashreporter r=gcp 2016-07-26 04:35:43 -07:00
Bob Owen
22830b7f8f Bug 1287984: Add rule to allow content process to duplicate handles to other non-broker processes. r=jimm
MozReview-Commit-ID: A79P9G9t7Ax

--HG--
extra : transplant_source : %C2%0A-%FB%7E%AF%99%95%C7%AF%A6%21%BC%18%D4a%9C%24z%8C
2016-07-20 14:41:18 +01:00
Julian Hector
3236586a67 Bug 1285769 - Add sys_get_mempolicy to seccomp whitelist. r=gcp 2016-07-25 19:37:58 +02:00
Julian Hector
1ab18ae903 Bug 1285770 - Add sys_fallocate to seccomp whitelist. r=gcp 2016-07-23 17:13:52 +02:00
Haik Aftandilian
8f7ffc84b7 Bug 1274540 - Record sandboxing status in crash reports; r=gcp
Adds content sandbox metadata to parent and child crash reports:
Includes the value of pref security.sandbox.content.level,
whether or not the system is capable of sandboxing, if the
sandbox was successfully turned on, and (on Linux systems)
the sandbox capabilities flags.

New crash report keys:
"ContentSandboxLevel" in parent and content
"ContentSandboxCapable" in parent
"ContentSandboxEnabled" in content
"ContentSandboxCapabilities" in content on Linux
2016-07-25 13:21:00 +02:00
Wei-Cheng Pan
fd87664d8e Bug 1264566 - Part 2: Refactor all usage of FileDescriptor. r=valentin
Callers should use a UniquePtr to hold the platform handle.

MozReview-Commit-ID: 6BWnyAf4b3a

--HG--
extra : transplant_source : %26%CA%0D%28%08%9BT%97Z%A1%3Dq%CD%21%A1_%EFE%83%0E
extra : histedit_source : 77f8ed3d0fdec6cce0c95469130ade0fb547bb91
2016-05-27 16:12:51 +08:00