Commit Graph

628 Commits

Author SHA1 Message Date
Alexandre Lissy
ffdd6fb20f Bug 1785278 - Reading AutoConfig from /etc/firefox when running under Snap r=mkaply,xpcom-reviewers,barret
Differential Revision: https://phabricator.services.mozilla.com/D159059
2022-10-18 21:06:43 +00:00
Cristian Tuns
1f31783a03 Backed out changeset db19647e9065 (bug 1791814) for causing failures on browser_sanitization_events.js CLOSED TREE 2022-10-12 14:57:49 -04:00
Tom Ritter
1259dc6df9 Bug 1791814: Address two preferences showing up in telemetry r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D158989
2022-10-12 14:22:28 +00:00
Tom Ritter
9e21ef394c Bug 1782444: Re-enable pref sanitization in Nightly in report-only mode r=ckerschb
We enable the sanitizing, which will omit the value in the
content process and trigger event telemetry - but we won't
crash the process.

Differential Revision: https://phabricator.services.mozilla.com/D153318
2022-09-19 19:41:14 +00:00
Tom Ritter
8f4eb43705 Bug 1782544: Add event telemetry for blocklisted pref access r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D155621
2022-09-09 14:58:54 +00:00
Andrew Osmond
a40634c132 Bug 1783299 - Add support for threadsafe mirrored StaticPref strings. r=KrisWright
Prior to this patch, one would need to manually instantiate a copy of a
string from a preference on the main thread in order to access it in a
threadsafe manner on another thread.

This patch adds support for a `DataMutexString` threadsafe type for
mirror: always type StaticPrefs, and works similarly to the existing
atomic types.

Differential Revision: https://phabricator.services.mozilla.com/D153829
2022-08-16 01:00:21 +00:00
Tom Ritter
10cae02ba1 Bug 1780403: Allowlist a few browser preferences r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D152811
2022-07-27 14:02:45 +00:00
Tom Ritter
747b2a1965 Bug 1780403: Allowlist capability.policy.policynames r=mkaply
Differential Revision: https://phabricator.services.mozilla.com/D152517
2022-07-22 13:44:25 +00:00
Butkovits Atila
eb8fdedc0d Merge mozilla-central to autoland. CLOSED TREE 2022-07-22 00:52:02 +03:00
Andreea Pavel
152bc15ac8 Merge autoland to mozilla-central a=merge 2022-07-22 00:20:52 +03:00
Tom Ritter
baf704fd92 Bug 1780403: Allowlist the undocumented pdfjs.defaultZoomValue pref r=calixte
Differential Revision: https://phabricator.services.mozilla.com/D152294
2022-07-21 17:27:25 +00:00
Tom Ritter
4605234a60 Bug 1780403: Allowlist some more preferences to avoid crashes r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D152418
2022-07-21 15:06:14 +00:00
Tom Ritter
6dd911e755 Bug 1780403: Allowlist the entire gfx.blacklist pref tree r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D152377
2022-07-21 14:51:56 +00:00
Tom Ritter
3e5a47c02f Bug 1780403: Allowlist browser.uitour.testingOrigins r=agibson
Differential Revision: https://phabricator.services.mozilla.com/D152376
2022-07-21 14:51:56 +00:00
Tom Ritter
954c3997ab Bug 1780403: Allowlist the ui. pref branch r=emilio
There's a large list of dynamic preferences in the ui. tree
but none of them should contain personally identifiable data.

Differential Revision: https://phabricator.services.mozilla.com/D152340
2022-07-21 11:30:42 +00:00
Tom Ritter
5126534536 Bug 1780403: Remove browser.region.update.updated from the blocklist r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D152339
2022-07-21 02:31:04 +00:00
Tom Ritter
367217e702 Bug 1780403: Allowlist media.decoder-doctor. r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D152279
2022-07-20 14:23:58 +00:00
Tom Ritter
195f74ca6d Bug 1772345: Allowlist a few more dynamic preferences r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D152111
2022-07-19 18:58:29 +00:00
Cristian Tuns
6ce3b62c21 Backed out 2 changesets (bug 1772345) for causing mochitest failures on test_font_whitelist.html CLOSED TREE
Backed out changeset bb7898587a0f (bug 1772345)
Backed out changeset e41e26ded66e (bug 1772345)
2022-07-19 13:28:28 -04:00
Tom Ritter
574a0d0acf Bug 1772345: Allowlist a few more dynamic preferences r=freddyb
Depends on D148127

Differential Revision: https://phabricator.services.mozilla.com/D152111
2022-07-19 13:28:04 +00:00
Jonathan Watt
6bec4dcdbc Bug 1749598 p2 - Stop synchronizing the print_printer preference to content processes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D150099
2022-07-18 14:34:27 +00:00
Tom Ritter
38a60b2ada Bug 1778747: Allowlist the other, very similar, printer preference tree r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D151527
2022-07-12 14:14:29 +00:00
Tom Ritter
31bd73ffa8 Bug 1778505: Remove the temporary pref sanitization prefs r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D151289
2022-07-07 18:40:59 +00:00
Andi-Bogdan Postelnicu
32fec8c1e0 Bug 1519636 - Reformat recent changes to the Google coding style. r=marco
Updated with clang-format version 14.0.5 (taskcluster-YlgDNB2QSm-6a2LDw3kj6A)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D150093
2022-06-23 09:27:12 +00:00
Tom Ritter
ddfae64603 Bug 1772599 - Use a temporary pref for a few weeks while we vette the behavior r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D149395
2022-06-22 15:05:44 +00:00
Tom Ritter
2076a9067e Bug 1772599 - Do not treat init-once prefs as sanitizable r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D149294
2022-06-22 15:05:44 +00:00
Tom Ritter
eed1791698 Bug 1772599 - Add prefs to the dynamic override list r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D149293
2022-06-22 15:05:43 +00:00
Tom Ritter
25dec5273d Bug 1772599 - Do not start checking prefs until they've been initialized r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D148316
2022-06-22 15:05:43 +00:00
Tom Ritter
165e7ebc1f Bug 1772599 - Move crashes further up the stack to handle NoneType prefs in the content process r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D148313
2022-06-22 15:05:43 +00:00
Tom Ritter
51974431f5 Bug 1772599 - Ensure that sanitized prefs make it into the hashtable in the content processes r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D148312
2022-06-22 15:05:42 +00:00
Tom Ritter
0bd9300be2 Bug 1772599 - Set pref sanitizations prefs in the content process r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D148311
2022-06-22 15:05:42 +00:00
Michael Kohler
ed86715b9c Bug 1704740 - Removed expired telemetry probe preferences.created_new_user_prefs_file r=chutten,KrisWright DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D148381
2022-06-16 09:43:25 +00:00
Tom Ritter
d633084074 Bug 1766866: Restricting other preferences we don't want in the content process r=bholley
This list contains items that contain actual user data like
their device name or their downloads path, items that contain
UUIDs that could be used to track users across different
origins, sessions, or private browsing, and values that
either change occassionally or don't have enough entropy to
serve as a long-lived UUID, but do have enough entropy to be
used as a short-term correlatable identified to e.g.
de-anonymize someone use the VPN feature of containers.

Depends on D145259

Differential Revision: https://phabricator.services.mozilla.com/D145260
2022-05-03 13:42:57 +00:00
Tom Ritter
91ac0448b1 Bug 1766866: Improve assertions for Static Preferences r=KrisWright
During testing I started hitting these cases that were not
well-documented for the person hitting the crash, so let's
improve them.

Differential Revision: https://phabricator.services.mozilla.com/D145259
2022-05-03 13:42:57 +00:00
Tom Ritter
89cae8624c Bug 1752332: Suppress Hazard warnings due to hash table function pointers r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D144437
2022-04-27 12:57:40 +00:00
Tom Ritter
95271c98ae Bug 1752332: Sanitize preferences in the shared memory region r=KrisWright
Before we would stick all prefs into an immutable shared memory
region and clear our HashMap.

Now we will stick all non-sanitized prefs into the immutable
shared memory region, save the sanitized prefs in a list
temporarily, clear the hashmap, and then repopulate the hashmap
with the sanitized prefs.

As a bit of underlying complexity, to do this we must do some
tricks with the Pref Name Arena which is a chunk of memory
dedicated to storing pref names. That goes away (and we want to
wipe it to save space) - so we just need to move the sanitized
pref names to a new arena.

Depends on D141421

Differential Revision: https://phabricator.services.mozilla.com/D141422
2022-04-27 12:57:39 +00:00
Tom Ritter
260f7f810d Bug 1752332: Optimize the crash checks in Check*Value functions r=KrisWright
We busted browser_preferences_usage.js by looking up a
preference too many times.

The reason we are now exceeding the pref-reading limit for
this pref is that inside ShouldSanitizePreference all of
our calls to Preferences::Something(pref_name) are causing
pref lookups.  _Most_ of the time when we are in
ShouldSanitizePreference, we got there from a place that has
the actual pref object; so change the function to take in a
Pref object.

Unfortunately, there is a place we do need to look it up
by name, and that's in Static Pref getters, so we need to
keep that function around (and expose it in Preferences.h)

To minimize code duplication (i.e. not having the exact same
code for ShouldSanitizePreference(Pref) and
ShouldSanitizePreference(PrefWrapper) we do some templating
tricks because even though they expose the same API, they are
not in a class hierarchy where we could just make one function
for a base class.

Depends on D141420

Differential Revision: https://phabricator.services.mozilla.com/D141421
2022-04-27 12:57:39 +00:00
Tom Ritter
a4973e44f2 Bug 1752332: Remove the shouldSanitizeFunction member r=KrisWright
In the following patch we are going to change the signature of
ShouldSanitizePreference to take a Pref object.  Pref is only
known to the Preferences compilation unit; so to keep this member
(whose signature will change) we would need to expose the Pref
class. However it will only be a forward declaration, one could
not construct a Pref object in e.g. the gtest.

It is simpler to just remove the member entirely and call
ShouldSanitizePreference unconditionally - the member was only
used for the gtest, and while the gtest will be less robust
because of this change, it will still do some testing.

Depends on D141419

Differential Revision: https://phabricator.services.mozilla.com/D141420
2022-04-27 12:57:38 +00:00
Tom Ritter
d4c61ba8d1 Bug 1752332: Add preferences that control whether we send user data and/or crash r=KrisWright
Depends on D141418

Differential Revision: https://phabricator.services.mozilla.com/D141419
2022-04-27 12:57:38 +00:00
Tom Ritter
6204d0bf02 Bug 1752332: Crash if a pref is accessed that shouldn't be r=KrisWright
Depends on D141417

Differential Revision: https://phabricator.services.mozilla.com/D141418
2022-04-27 12:57:37 +00:00
Tom Ritter
fc372815ef Bug 1752332: Improve the blocklisting behavior r=KrisWright
For all subprocesses, if a preference is in the blocklist,
sanitize it.  (This preserves the IPC optimization behavior,
kind of.  We now generate IPC traffic when we didn't before,
but we omit the value. Values were previously capped at 4 KiB
now they're 0 bytes.)

For Web Content processes, we sanitize a preference if it is
in the blocklist, or if does not have a Default value (i.e.
it is dynamically named). There is an exception list for
dynamically named preferences we know we need though.

In subprocesses, we know if a preference was sanitized
by checking its Sanitized bit.

Depends on D141416

Differential Revision: https://phabricator.services.mozilla.com/D141417
2022-04-27 12:57:37 +00:00
Tom Ritter
4d077a8b48 Bug 1752332: Make SerializePreferences correctly sanitize preferences r=KrisWright,necko-reviewers,dragana
To do the correct thing in Preferences::SerializePreferences
(which is used during subprocess startup) we need to know if
the destination process is a web content process or not.
We add parameters to
SharedPreferenceSerializer::SerializeToSharedMemory that let
us figure that out.

In Preferences::SerializePreferences we fix the call to
aShouldSanitizeFn to pass the correct destination.

Depends on D141415

Differential Revision: https://phabricator.services.mozilla.com/D141416
2022-04-27 12:57:37 +00:00
Tom Ritter
dd1972098d Bug 1752332: Remove some prefs from the blocklist r=KrisWright
Depends on D141413

Differential Revision: https://phabricator.services.mozilla.com/D141414
2022-04-27 12:57:36 +00:00
Tom Ritter
64a1e28735 Bug 1752332: Correctly populate the sanitized bit for PreferenceUpdate r=KrisWright
PreferenceUpdate is the IPC message notifying a child process
that a preference has been updated. To correctly decide whether
or not a value should be sanitized in it, we need to know
what type of destination process it is; we add parameters to
Preferences::GetPreference indicating that.

Inside of ToDomPref we call ShouldSanitizePreference to
correctly populate the sanitized bit.

Depends on D141412

Differential Revision: https://phabricator.services.mozilla.com/D141413
2022-04-27 12:57:36 +00:00
Tom Ritter
0d49156bd8 Bug 1752332: Rename ShouldSyncPreference to ShouldSanitizePreference r=KrisWright
This simplifies the number of negations needed,
and makes things easy to understand. I think
anyway; I know that without renaming it I made
several annoying-to-diagnose negation errors...

Depends on D141411

Differential Revision: https://phabricator.services.mozilla.com/D141412
2022-04-27 12:57:35 +00:00
Tom Ritter
02bbd35a77 Bug 1752332: Tell ShouldSyncPreference if the destination is a web content process r=KrisWright
A couple places where it might be a web content process
still pass 'false' - this will be corrected in a later
patch.

Depends on D141410

Differential Revision: https://phabricator.services.mozilla.com/D141411
2022-04-27 12:57:35 +00:00
Tom Ritter
baa1f4da1f Bug 1752332: Move ShouldSyncPreferences to Preferences module r=KrisWright
Depends on D141409

Differential Revision: https://phabricator.services.mozilla.com/D141410
2022-04-27 12:57:34 +00:00
Tom Ritter
c01cc2c7e3 Bug 1752332: Add a sanitized property to prefs r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D141408
2022-04-27 12:57:34 +00:00
Butkovits Atila
9d9191e364 Backed out 17 changesets (bug 1752332) for causing crashes at JS::AutoAssertNoGC::AutoAssertNoGC(JSContext*). CLOSED TREE
Backed out changeset eaa4213b9e08 (bug 1752332)
Backed out changeset 2d794b61fbf7 (bug 1752332)
Backed out changeset 69cbec3e9a11 (bug 1752332)
Backed out changeset 022a68e8d603 (bug 1752332)
Backed out changeset 1ff8656b362d (bug 1752332)
Backed out changeset 46ea5b4f9ad3 (bug 1752332)
Backed out changeset e1dcb4c7cb88 (bug 1752332)
Backed out changeset f9d6bc72406f (bug 1752332)
Backed out changeset dd02b8ef0219 (bug 1752332)
Backed out changeset 3e60b77153a3 (bug 1752332)
Backed out changeset ce93b08837d2 (bug 1752332)
Backed out changeset d165042105ea (bug 1752332)
Backed out changeset 22b910308ecd (bug 1752332)
Backed out changeset d2e748ccd01c (bug 1752332)
Backed out changeset a89203990075 (bug 1752332)
Backed out changeset b580c2a3bac0 (bug 1752332)
Backed out changeset a2d5880b528f (bug 1752332)
2022-04-25 17:55:17 +03:00
Tom Ritter
32a0501284 Bug 1752332: Suppress Hazard warnings due to hash table function pointers r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D144437
2022-04-25 13:54:05 +00:00