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

2087 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky 1a285c6f35 Bug 1601377 part 1. Make it clear that nsContentUtils::PrincipalAllowsL10n never takes a null nsIPrincipal. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D56216

--HG--
extra : moz-landing-system : lando
2019-12-09 15:10:32 +00:00
Noemi Erli 82d41a33b2 Backed out 9 changesets (bug 1596918) for causing multiple browser-chrome failures
Backed out changeset 415007efd8c9 (bug 1596918)
Backed out changeset 011eb5ce927b (bug 1596918)
Backed out changeset e5fd3ee22ea1 (bug 1596918)
Backed out changeset 0bca4de31d40 (bug 1596918)
Backed out changeset 11ec4393f23d (bug 1596918)
Backed out changeset c5404a7c286d (bug 1596918)
Backed out changeset 7e9304405a46 (bug 1596918)
Backed out changeset fa0f0aeabf99 (bug 1596918)
Backed out changeset de196b077000 (bug 1596918)
2019-12-07 22:26:43 +02:00
Kris Maglione 910eab35d2 Bug 1596918: Part 3a - Scripted rewrite of most ContentTask.spawn calls to SpecialPowers.spawn calls. r=mccr8,remote-protocol-reviewers,ato
This is generally pretty straightforward, and rewrites nearly all calls. It
skips the ones that it can detect using frame script globals like
`sendAsyncMessage`, though.

Differential Revision: https://phabricator.services.mozilla.com/D53740

--HG--
extra : moz-landing-system : lando
2019-12-07 19:11:58 +00:00
Daniel Varga 84a601a6d4 Backed out 17 changesets (bug 1596918) for multiple browser-chrome and dev-tools failures. On a CLOSED TREE
Backed out changeset ab87d2c1afae (bug 1596918)
Backed out changeset 775f3b06a687 (bug 1596918)
Backed out changeset 67cc63ef5d7f (bug 1596918)
Backed out changeset 7d290bcd2067 (bug 1596918)
Backed out changeset 048db9f4db7c (bug 1596918)
Backed out changeset 96a79d2ba614 (bug 1596918)
Backed out changeset be770d112dd8 (bug 1596918)
Backed out changeset 302c8ab8391c (bug 1596918)
Backed out changeset 44ef8f20732e (bug 1596918)
Backed out changeset 38c11ebfb8ff (bug 1596918)
Backed out changeset b586fc081374 (bug 1596918)
Backed out changeset 12283166716f (bug 1596918)
Backed out changeset 99b0421015d8 (bug 1596918)
Backed out changeset 97ec49dbbbf3 (bug 1596918)
Backed out changeset ec79478f58f1 (bug 1596918)
Backed out changeset c6d356833bb8 (bug 1596918)
Backed out changeset 5ef6026806c8 (bug 1596918)
2019-12-07 03:12:07 +02:00
Kris Maglione 20da940e14 Bug 1596918: Part 3a - Scripted rewrite of most ContentTask.spawn calls to SpecialPowers.spawn calls. r=mccr8,remote-protocol-reviewers,ato
This is generally pretty straightforward, and rewrites nearly all calls. It
skips the ones that it can detect using frame script globals like
`sendAsyncMessage`, though.

Differential Revision: https://phabricator.services.mozilla.com/D53740

--HG--
extra : moz-landing-system : lando
2019-12-06 22:14:14 +00:00
Sebastian Streich ef70bebbdc Bug 1600051 - Refactor GetURI usage in ReferrerInfo.cpp r=ckerschb
***

Differential Revision: https://phabricator.services.mozilla.com/D55120

--HG--
extra : moz-landing-system : lando
2019-12-06 12:32:27 +00:00
Gabriele Svelto 69790bc62e Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55443

--HG--
extra : moz-landing-system : lando
2019-12-06 09:16:44 +00:00
Sebastian Streich 7809758d00 Bug 1597704 - Move is OriginPotentially Trustworthy into Principal r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53830

--HG--
extra : moz-landing-system : lando
2019-12-05 16:04:53 +00:00
Boris Zbarsky 75124bdd98 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067

--HG--
extra : moz-landing-system : lando
2019-12-05 04:44:32 +00:00
Emma Malysz a1ae71dcf8 Bug 1601095, rename the test files in /cap from .xul to .xhtml r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D55832

--HG--
rename : caps/tests/mochitest/test_bug995943.xul => caps/tests/mochitest/test_bug995943.xhtml
rename : caps/tests/mochitest/test_disableScript.xul => caps/tests/mochitest/test_disableScript.xhtml
extra : moz-landing-system : lando
2019-12-04 20:24:47 +00:00
Liang-Heng Chen 78474bf392 Bug 1534339 - make OriginAttributes deserializable; r=baku
`CreateSuffix` is irreversible by `PopulateFromSuffix` because it uses a multi-to-one mapping.
Since only ':' will happen in a IPv6 format, we can make it a 1-to-1 mapping so that the `firstPartyDomain` is consistent after `CreateSuffix` and `PopulateFromSuffix`.

Differential Revision: https://phabricator.services.mozilla.com/D47910

--HG--
extra : moz-landing-system : lando
2019-12-04 09:46:51 +00:00
Nathan Froyd c4d5bb1a19 Bug 1600963 - remove some duplicate includes from ContentPrincipal.cpp; r=mccr8
Depends on D55689

Differential Revision: https://phabricator.services.mozilla.com/D55690

--HG--
extra : moz-landing-system : lando
2019-12-03 17:30:26 +00:00
Nathan Froyd 655d31fb03 Bug 1600963 - build fields directly in the returned array; r=mccr8
This change means fewer temporary objects, particularly `nsCString` objects.

Depends on D55688

Differential Revision: https://phabricator.services.mozilla.com/D55689

--HG--
extra : moz-landing-system : lando
2019-12-03 17:37:43 +00:00
Nathan Froyd 03bf239fb9 Bug 1600963 - don't lookup keys twice in the serialized JSON; r=mccr8
Depends on D55687

Differential Revision: https://phabricator.services.mozilla.com/D55688

--HG--
extra : moz-landing-system : lando
2019-12-03 17:52:40 +00:00
Nathan Froyd feb4f82205 Bug 1600963 - reduce size of principal KeyVals; r=mccr8
By declaring the individual enum types to fit in a `uint8_t`, and
rearranging the templated `KeyValT` struct, we can pack `KeyValT`
to save a word of storage.

Differential Revision: https://phabricator.services.mozilla.com/D55687

--HG--
extra : moz-landing-system : lando
2019-12-03 22:20:03 +00:00
Nathan Froyd 3c6e6ca1c9 Bug 1600963 - reduce boilerplate for serialized keys in principals; r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D55686

--HG--
extra : moz-landing-system : lando
2019-12-03 17:30:09 +00:00
shindli f3f1c30ea4 Backed out changeset 68ff34ec8e96 (bug 1597704) for causing perma bc3 failures in browser/extensions/formautofill/test/browser/browser_autocomplete_footer.js CLOSED TREE 2019-11-28 16:12:45 +02:00
Sebastian Streich e00f41deb2 Bug 1597704 - Move is OriginPotentially Trustworthy into Principal r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53830

--HG--
extra : moz-landing-system : lando
2019-11-28 12:44:29 +00:00
Sebastian Streich a79df87bcc Bug 1589690 : Add isOnion API r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D49751

--HG--
extra : moz-landing-system : lando
2019-11-28 09:22:17 +00:00
Andrew McCreight 139398a824 Bug 1599569 - Make nsScriptSecurityManager::ClearJSCallbacks into a static method. r=kmag
XPConnect calls this method during shutdown after the pointer to the
singleton nsScriptSecurityManager has been cleared, so it is actually
calling it with a null |this|. Nobody noticed this because it isn't
actually using |this|. This patch turns it into a static method to
make the sanitizers happy.

Differential Revision: https://phabricator.services.mozilla.com/D54846

--HG--
extra : moz-landing-system : lando
2019-11-27 20:57:43 +00:00
Andrew McCreight 817696d634 Bug 1599801 - NullPrincipal::Init is infallible. r=bzbarsky
I also cleaned up the comment a bit.

Differential Revision: https://phabricator.services.mozilla.com/D54970

--HG--
extra : moz-landing-system : lando
2019-11-27 20:17:46 +00:00
Andrew McCreight b7a0475f37 Bug 1599470, part 2 - Inline the now-infallible NullPrincipalURI::Create(). r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D54818

--HG--
extra : moz-landing-system : lando
2019-11-27 16:08:28 +00:00
Andrew McCreight b0c1237a6f Bug 1599470, part 1 - Inline the infallible NullPrincipalURI::Init. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D54817

--HG--
extra : moz-landing-system : lando
2019-11-27 04:41:07 +00:00
Gurzau Raul 865834687b Backed out changeset 74162d71ef4d (bug 1597704) for failing at browser_insecurePasswordConsoleWarning.js on a CLOSED TREE. 2019-11-26 19:30:19 +02:00
Sebastian Streich a22a53ebb2 Bug 1597704 - Move is OriginPotentially Trustworthy into Principal r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53830

--HG--
extra : moz-landing-system : lando
2019-11-26 16:00:49 +00:00
Jan de Mooij 83d309574b Bug 1579367 - Initialize XPCJSContext explicitly, after loading user prefs. r=kmag
This way we get the correct values for start-up prefs in the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D51061

--HG--
extra : moz-landing-system : lando
2019-11-22 12:40:17 +00:00
Razvan Maries c5d796f8ad Backed out changeset 4082b974a1e6 (bug 1597704) test_isOriginPotentiallyTrustworthy.js. CLOSED TREE 2019-11-22 13:35:36 +02:00
Sebastian Streich 309ac043a0 Bug 1597704 - Move is OriginPotentially Trustworthy into Principal r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53830

--HG--
extra : moz-landing-system : lando
2019-11-21 16:29:13 +00:00
Andreea Pavel f12302bb4f Backed out changeset 4757e1fd407f (bug 1594781) for failing wpt at iframe_sandbox_popups_escaping-1.html on a CLOSED TREE 2019-11-20 07:26:52 +02:00
Sebastian Streich c1543aa8e0 Bug 1594781 -- Refactor nsGlobalWindowOuter r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D52186

--HG--
extra : moz-landing-system : lando
2019-11-19 15:14:43 +00:00
Mihai Alexandru Michis 33799b6110 Backed out changeset 14d6dd504f86 (bug 1534339) for causing Bug 1595179. CLOSED TREE
--HG--
extra : rebase_source : 101262411debddee38453d05fdfb7327fe03438e
extra : histedit_source : 1ddb09ebad301dfc19bccf12386e7d0beb43cb1a
2019-11-14 14:59:16 +02:00
Sebastian Streich b4ebe9b54a Bug 1592701 - Remove usage of GetURI in nsGlobalWindowInner r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D51258

--HG--
extra : moz-landing-system : lando
2019-11-07 13:42:37 +00:00
Dorel Luca a0370f2bc4 Backed out changeset 955256297d6d (bug 1579367) for causing a top crash in Bug 1594404. a=backout 2019-11-06 23:19:09 +02:00
Jan de Mooij 96cc0b5247 Bug 1579367 - Initialize XPCJSContext explicitly, after loading user prefs. r=kmag
This way we get the correct values for start-up prefs in the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D51061

--HG--
extra : moz-landing-system : lando
2019-11-05 06:29:13 +00:00
Nicholas Nethercote a518709339 Bug 1587162 - Fix UBSAN complaints about pref callbacks. r=erahm
Lots of these callbacks have a non-`void*` final parameter, which UBSAN
complains about. This commit changes them to have a `void*` parameter.

This requires undoing the machinery added in the first two commits of bug
1473631: `TypePrefChangeFunc` and `PREF_CHANGE_METHOD`. The resulting code is
simpler (which is good) and more boilerplate-y (which is bad) but avoids the
undefined behaviour (which is good).

Differential Revision: https://phabricator.services.mozilla.com/D50901

--HG--
extra : moz-landing-system : lando
2019-11-01 02:57:20 +00:00
Shane Caraveo 4c305ddd57 Bug 1587939 enforce addon content script CSP in eval r=ckerschb,robwu
Differential Revision: https://phabricator.services.mozilla.com/D48924

--HG--
extra : moz-landing-system : lando
2019-11-01 06:03:35 +00:00
Shane Caraveo f800952de9 Bug 1581611 Part 1: add content_scripts to the extension content_security_policy r=rpl,bzbarsky
This patch adds support for including content_scripts CSP in the extensions
manifest, along with all interfaces necessary to access the CSP value.  This does not
implement actual use of the CSP for content scripts.

Differential Revision: https://phabricator.services.mozilla.com/D46824

--HG--
extra : moz-landing-system : lando
2019-11-01 06:02:45 +00:00
Shane Caraveo 9ca23aa397 Bug 1581609 rename extension contentSecurityPolicy to support multiple V3 CSP values r=rpl,webidl
Differential Revision: https://phabricator.services.mozilla.com/D46818

--HG--
extra : moz-landing-system : lando
2019-11-01 06:02:22 +00:00
Paul Zuehlcke 7b483252bd Bug 1588461 - Added OA StripAttributes flag for privateBrowsingId. r=johannh,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D49174

--HG--
extra : moz-landing-system : lando
2019-10-24 14:18:54 +00:00
Tim Huang 336cd10b0e Bug 1590032 - Propagate the first party domain when creating new browser in Fission. r=smaug
In this patch, we add the propagation of the first party domain through
the tabContext while creating OOP browsers. In the window.open() case,
we will propagate the first party domain from the opener's browser parent.
And in the frame case, we will propagate it from the manager of the
browserBridgeParent of the OOP frame.

Differential Revision: https://phabricator.services.mozilla.com/D49886

--HG--
extra : moz-landing-system : lando
2019-10-24 08:51:06 +00:00
Liang-Heng Chen 489786654f Bug 1534339 - make OriginAttributes deserializable; r=baku
`CreateSuffix` is irreversible by `PopulateFromSuffix` because it uses a multi-to-one mapping.
Since only ':' will happen in a IPv6 format, we can make it a 1-to-1 mapping so that the `firstPartyDomain` is consistent after `CreateSuffix` and `PopulateFromSuffix`.

Differential Revision: https://phabricator.services.mozilla.com/D47910

--HG--
extra : moz-landing-system : lando
2019-10-23 14:10:19 +00:00
Sebastian Streich f4b2f14328 Bug 1585664 - Add GetAsciiSpecForLogging and update callers r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D47909

--HG--
extra : moz-landing-system : lando
2019-10-22 16:03:27 +00:00
Sylvestre Ledru 7c309095ea Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
Please note that it is the first reformat with clang-format 9
I only saw a fix in the .mm file

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D49056

--HG--
extra : moz-landing-system : lando
2019-10-21 14:13:44 +00:00
Sebastian Streich 854f9b5f12 Bug 1585331 - Add nsIPrincipal::GetAboutModuleFlags r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D47775

--HG--
extra : moz-landing-system : lando
2019-10-17 13:54:41 +00:00
Marco Bonardo cff612c7b4 Bug 1586681 - Ensure URIFIxup uses the right engine when there's a separate PB engine. r=Standard8,Gijs
Add a new FIXUP_FLAG_PRIVATE_CONTEXT to nsIURIFixup, make it use the default
private search engine when it's set.
Update consumers to pass the new flag when necessary.

Differential Revision: https://phabricator.services.mozilla.com/D48741

--HG--
extra : moz-landing-system : lando
2019-10-12 12:37:51 +00:00
Tom Ritter 23ba7b6fe3 Bug 1583949 - Add a check for IsEvalAllowed to the worker callpath for eval() r=ckerschb,baku
This patch does several things.  Because Workers aren't on the main thread,
many of the things done are in the name of off main thread access.

1) Changes a parameter in IsEvalAllowed from a nsIPrincipal to a bool.
   We only used the principal to determined if it was the System Principal.
   Principals aren't thread safe and can only be accessed on Main Thread, so
   if we passed a Principal in, we would be in error. Instead only pass in
   the bool which - for workers - comes from a thread-safe location.

2) Separates out the Telemetry Event Recording and sending a message to the
   console into a new function nsContentSecurityUtils::NotifyEvalUsage. (And
   creates a runnable that calls it.)

   We do this because we will need to only call this method on the main thread.

   Telemetry Event Recording has only ever been called on the Main Thread.
   While I possibly-successfully cut it over to happen Off Main Thread (OMT)
   by porting preferences to StaticPrefs, I don't know if there were other
   threading assumptions in the Telemetry Code. So it would be much safer to
   just continue recording Event Telemetry on the main thread.

   Sending a message to the console requires calling GetStringBundleService()
   which requires main thread. I didn't investigate if this could be made
   thread-safe, I just threw it onto the main thread too.

   If, in IsEvalAllowed, we are on the main thread - we call NotifyEvalUsage
   directly. If we are not, we create a runnable which will then call
   NotifyEvalUsage for us on the main thread.

3) Ports allow_eval_with_system_principal and allow_eval_in_parent_process
   from bools to RelaxedAtomicBool - because we now check these prefs OMT.

4) In RuntimeService.cpp, adds the call to IsEvalAllowed.

5) Add resource://gre/modules/workers/require.js to the allowlist of eval
   usage. This was the script that identified this gap in the first place.
   It uses eval (twice) for structural reasons (scope and line number
   massaging.)  The contents of the eval are the result of a request to a
   uri (which may be internal, like resource://). The whole point of this
   is to implement a CommonJS require() api.

   This usage of eval is safe because the only way an attacker can inject
   into it is by either controlling the response of the uri request or
   controlling (or appending to) the argument. If they can do that, they
   are able to inject script into Firefox even if we cut this usage of eval
   over to some other type of safe(r) script loader.

   Bug 1584564 tracks making sure calls to require.js are safe.

6) Adds cld-worker.js to the allowlist. Bug 1584605 is for refactoring that
   eval usage, which is decidedly non-trivial.

7) Does _not_ enforce the eval restrictions for workers. While I've gotten
   try to be green and not throw up any instances of eval-usage by workers,
   it is much safer to deploy this is Telemetry-only mode for Workers for
   a little bit to see if anything pops up from the Nightly population.

   Bug 1584602 is for enforcing the checks.

Differential Revision: https://phabricator.services.mozilla.com/D47480

--HG--
extra : moz-landing-system : lando
2019-10-08 17:31:35 +00:00
Johann Hofmann c9dbb0c14e Bug 1554805 - Never set firstPartyDomain on origin attributes for moz-extension. r=rpl,Ehsan,tjr
Differential Revision: https://phabricator.services.mozilla.com/D47425

--HG--
extra : moz-landing-system : lando
2019-10-06 15:43:39 +00:00
Tom Ritter 117e232bdc Bug 1576254 - Add isSystemOrAddonPrincipal to JSPrincipal and nsJSPrincipals r=luke
Finally, here we add the virtual method isSystemOrAddonPrincipal to the
JSPrincipal object.

We also add it to nsJSPrincipal (where it has an easy implementation), and
to carry classes that are used by JS tests and the shell.

Differential Revision: https://phabricator.services.mozilla.com/D47477

--HG--
extra : moz-landing-system : lando
2019-10-04 17:37:36 +00:00
Sebastian Streich 1aa0b1244d Bug 1583871 Refactor ThirdpartyUtil.cpp r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D47099

--HG--
extra : moz-landing-system : lando
2019-10-02 15:10:40 +00:00
Ehsan Akhgari 7ddd78221e Bug 1577298 - Do not stop at the current document when computing the top-level principal for storage partitioning; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D47339

--HG--
rename : toolkit/components/antitracking/test/browser/browser_subResources.js => toolkit/components/antitracking/test/browser/browser_subResourcesPartitioned.js
extra : moz-landing-system : lando
2019-09-27 14:05:13 +00:00