Consider removing some of the transplanting APIs.
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox152 | --- | fixed |
People
(Reporter: emilio, Assigned: jandem)
References
Details
Attachments
(5 external files)
After bug 2037172 some of the transplanting APIs like JS_CopyOwnPropertiesAndPrivateFields and co become unused except for the JS shell, which seems like it exposes them for fuzzing. Seems they come from bug 1403679. Anba do you know if these are safe to remove?
| Assignee | ||
Comment 1•6 months ago
|
||
That's exciting. I'm actively working on our transplanting code currently so I can look into this.
| Assignee | ||
Comment 2•6 months ago
|
||
I think you just eliminated a major footgun: object transplant/swap involving native objects! The remaining transplant cases involve two proxies and that's easier to reason about. I also think we can simplify some code paths in JS_TransplantObject.
First we should add support for the transplant-WindowProxy case to newGlobal in the JS shell. After that I think we can remove transplantableObject.
Comment 3•6 months ago
|
||
Jan's plan is exactly what I'd have proposed: Support transplantable window proxies in the shell to cover the JS_TransplantObject call in TransplantObjectNukingXrayWaiver and then remove transplantableObject from the shell.
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Comment 4•6 months ago
|
||
Initially the plan was to remove the shell builtin completely. However the WindowProxy
transplanting added in bug 2037348 is only a partial replacement because some operations
unwrap wrappers including window proxies. In the browser, RemoteObjectProxy is a non-wrapper
proxy that can be transplanted.
To ensure we don't lose coverage, this patch simplifies transplantableObject to only support
simple non-DOM proxy objects. This also means we don't have to rewrite some of the shell tests
that use it. Some other tests that only made sense for transplanting native objects were deleted.
| Assignee | ||
Comment 5•6 months ago
|
||
| Assignee | ||
Comment 6•6 months ago
|
||
We no longer support swapping a proxy with a smaller object.
| Assignee | ||
Comment 7•6 months ago
|
||
| Assignee | ||
Comment 8•6 months ago
|
||
Object fuses are only used for native objects and WatchProtoChangeImpl is a no-op
for proxy objects.
| Assignee | ||
Updated•6 months ago
|
Updated•6 months ago
|
Comment 9•6 months ago
|
||
Thank you for your ongoing work to improve testing of our weird DOM transplanting!
Comment 10•6 months ago
|
||
Comment 11•6 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/85ca364372d4
https://hg.mozilla.org/mozilla-central/rev/59d96b3e0392
https://hg.mozilla.org/mozilla-central/rev/614f7207c2eb
https://hg.mozilla.org/mozilla-central/rev/923e17501f0c
https://hg.mozilla.org/mozilla-central/rev/82845daf0008
Updated•5 months ago
|
Description
•