Closed Bug 1570484 Opened 5 years ago Closed 5 years ago

Nuke Xray waivers for remote outer window proxies

Categories

(Core :: XPConnect, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file)

Remote outer window proxies aren't CCWs, so they can't have Xrays, so they can't have Xray waivers. However, if we do a navigation from a local iframe to a remote iframe, we'll transplant a remote outer window proxy onto a local outer window proxy, which might have an Xray. This can cause some issues, particularly if we later navigate back to a different local window (as in bug 1559489).

To work around this, I think we should nuke Xray waivers on navigation to a remote outer window proxy. This makes Xray waiver behavior inconsistent with the non-Fission behavior, but I think Nika and Kris had some concerns that changing the non-Fission behavior might affect addons, so I'll leave changing that to a future bug that depends on this one.

Blocks: 1570487

Remote outer window proxies aren't CCWs, so they can't have Xrays, so
they can't have Xray waivers that do anything useful. However, if we
do a navigation from a local iframe to a remote iframe, we'll
transplant a remote outer window proxy onto a local outer window
proxy, which might have an Xray. This can cause some issues,
particularly if we later navigate back to a different local window.

To work around this, this patch nukes Xray waivers on navigation to a
remote outer window proxy. This makes Xray waiver behavior
inconsistent with the non-Fission behavior, but it is safer to leave
the non-Fission behavior alone for now, for fear of breaking addons.

(In reply to Andrew McCreight [:mccr8] from comment #1)

This makes Xray waiver behavior
inconsistent with the non-Fission behavior, but it is safer to leave
the non-Fission behavior alone for now, for fear of breaking addons.

Doesn't this just kick the can down the road such that these addons break when we ship fission? I'd think we'd want to ship this (nuking waivers when navigating cross-origin) now to identify any compat fallout.

(In reply to Bobby Holley (:bholley) from comment #2)

Doesn't this just kick the can down the road such that these addons break when we ship fission? I'd think we'd want to ship this (nuking waivers when navigating cross-origin) now to identify any compat fallout.

Yes, it does. I filed bug 1570487 for figuring out what happens if we make the behavior consistent. You are right that we should look into it sooner rather than later, but I didn't want to block fixing some Fission issues on it.

(In reply to Andrew McCreight [:mccr8] from comment #3)

(In reply to Bobby Holley (:bholley) from comment #2)

Doesn't this just kick the can down the road such that these addons break when we ship fission? I'd think we'd want to ship this (nuking waivers when navigating cross-origin) now to identify any compat fallout.

Yes, it does. I filed bug 1570487 for figuring out what happens if we make the behavior consistent. You are right that we should look into it sooner rather than later, but I didn't want to block fixing some Fission issues on it.

Is there any sort of investigative work we might do other than just shipping it and seeing if anything breaks? If so, I think we might as well just try shipping it everywhere now, since it's the same amount of work and we'll otherwise almost certainly forget about this until we're much closer to shipping Fission.

(In reply to Bobby Holley (:bholley) from comment #4)

Is there any sort of investigative work we might do other than just shipping it and seeing if anything breaks? If so, I think we might as well just try shipping it everywhere now, since it's the same amount of work and we'll otherwise almost certainly forget about this until we're much closer to shipping Fission.

Getting this stuff landed now unblocks a lot of other work, so I'd rather not get distracted by potential add-on fallout until we've gotten as far as we can get without dealing with it.

There are also multiple options for dealing with this in add-on scopes, including keeping the dangling waivers alive in some other, inactive form, and reenabling them when we navigate back to the window they originally pointed to. That wouldn't be my first choice (I really don't want people keeping long-term references to X-ray waivers at all), but it's an option.

Either way, I don't think this is the right time to worry about it.

Ok, I'll defer to how y'all want to run it.

I think enabling it for all navigations is just a one line patch (changing the transplant call in SetNewDocument) once this is landed, so I can experiment with that independently of the Fission transplanting work. For investigation, I just mean I haven't even tried to see if the tree is green with it, and I'd want to try uBlock Origin or something to see if anything falls over. By putting it separately, it will be easier to back out if something goes wrong.

(In reply to Andrew McCreight [:mccr8] from comment #7)

I think enabling it for all navigations is just a one line patch (changing the transplant call in SetNewDocument) once this is landed, so I can experiment with that independently of the Fission transplanting work. For investigation, I just mean I haven't even tried to see if the tree is green with it, and I'd want to try uBlock Origin or something to see if anything falls over. By putting it separately, it will be easier to back out if something goes wrong.

If we do decide to flip that switch in the near future, it should probably be nightly-only for at least a couple of cycles.

Pushed by amccreight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/344a525cddbc Nuke Xray waivers for remote outer window proxies. r=bzbarsky,tcampbell,jonco

It looks like the Firefox build is bootlegging WrapperObject.h in a way that the shell build doesn't.

Flags: needinfo?(continuation)

Locally, I moved BaseProxyHandler.cpp to SOURCES and did a Firefox build. Hopefully that's sufficient. I also had to add an include for DeadObjectProxy.h. This base proxy handler doesn't include many files.

Pushed by amccreight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eb8931554abe Nuke Xray waivers for remote outer window proxies. r=bzbarsky,tcampbell,jonco
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: