Closed Bug 582100 Opened 14 years ago Closed 14 years ago

__exposedProps__ causes NS_ERROR_XPC_SECURITY_MANAGER_VETO

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+
fennec 2.0a1+ ---

People

(Reporter: azakai, Assigned: mrbkap)

References

Details

Attachments

(1 file)

Using __exposedProps__ in an object causes NS_ERROR_XPC_SECURITY_MANAGER_VETO errors in seemingly-unrelated jsreftests, namely

REFTEST TEST-UNEXPECTED-FAIL | file:///scratchbox/users/alon/home/alon/mozilla-central/js/src/tests/jsreftest.html?test=js1_5/extensions/regress-369696-02.js | Unknown :0: uncaught exception: [Exception... "Security Manager vetoed action"  nsresult: "0x80570027 (NS_ERROR_XPC_SECURITY_MANAGER_VETO)"  location: "JS frame :: file:///scratchbox/users/alon/home/alon/mozilla-central/js/src/tests/js1_5/extensions/regress-369696-02.js :: test :: line 67"  data: no] item 1

REFTEST TEST-UNEXPECTED-FAIL | file:///scratchbox/users/alon/home/alon/mozilla-central/js/src/tests/jsreftest.html?test=js1_6/extensions/regress-312385-01.js | Array.concat(null) == Array.prototype.concat.apply(null, []) Type mismatch, expected type boolean, actual type string Expected value 'true', Actual value '[Exception... "Security Manager vetoed action"  nsresult: "0x80570027 (NS_ERROR_XPC_SECURITY_MANAGER_VETO)"  location: "JS frame :: file:///scratchbox/users/alon/home/alon/mozilla-central/js/src/tests/js1_6/extensions/regress-312385-01.js :: comparelr :: line 150"  data: no]'  item 45

REFTEST TEST-UNEXPECTED-FAIL | file:///scratchbox/users/alon/home/alon/mozilla-central/js/src/tests/jsreftest.html?test=js1_6/extensions/regress-312385-01.js | Array.concat(undefined) == Array.prototype.concat.apply(undefined, []) Type mismatch, expected type boolean, actual type string Expected value 'true', Actual value '[Exception... "Security Manager vetoed action"  nsresult: "0x80570027 (NS_ERROR_XPC_SECURITY_MANAGER_VETO)"  location: "JS frame :: file:///scratchbox/users/alon/home/alon/mozilla-central/js/src/tests/js1_6/extensions/regress-312385-01.js :: comparelr :: line 150"  data: no]'  item 46

For code that causes this, see https://bug550936.bugzilla.mozilla.org/attachment.cgi?id=459695 . Removing __exposedProps__ from that patch lets it pass all jsreftests properly (but it is no longer secure).
I forgot an additional failure,

REFTEST TEST-UNEXPECTED-FAIL | file:///home/cltbld/talos-slave/tryserver-fedora-opt-u-jsreftest/build/jsreftest/tests/jsreftest.html?test=js1_5/Regress/regress-417893.js | Unknown :0: uncaught exception: [Exception... "Security Manager vetoed action"  nsresult: "0x80570027 (NS_ERROR_XPC_SECURITY_MANAGER_VETO)"  location: "JS frame :: file:///home/cltbld/talos-slave/tryserver-fedora-opt-u-jsreftest/build/jsreftest/tests/js1_5/Regress/regress-417893.js :: anonymous :: line 56"  data: no] item 1
blocking2.0: --- → ?
tracking-fennec: --- → ?
tracking-fennec: ? → 2.0a1+
blocking2.0: ? → betaN+
jst: you moved this to betaN+ but it blocks a beta3+ blocker; can we just disable this test in the meantime?
Attached patch FixSplinter Review
We should only enumerate the exposed properties.
Attachment #462294 - Flags: review?(gal)
Attachment #462294 - Flags: review?(gal) → review+
Note that there is one more reason for failure here: azakai's object ends up in a global object that participates in an Array.prototype.toSource. This calls toSource on all of the global object's properties. If one of those properties contains a COW that doesn't expose toSource, then we'll throw. The easiest way to fix that failure is to simply allow toSource to be exposed. azakai was going to try that out.
http://hg.mozilla.org/mozilla-central/rev/ecc2ca05ae47
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
The patch to bug 550936 still fails on 2 of the 4 errors mentioned here:

REFTEST TEST-UNEXPECTED-FAIL | file:///home/cltbld/talos-slave/mozilla-central-fedora-opt-u-jsreftest/build/jsreftest/tests/jsreftest.html?test=js1_5/extensions/regress-369696-02.js | Unknown :0: uncaught exception: [Exception... "Security Manager vetoed action"  nsresult: "0x80570027 (NS_ERROR_XPC_SECURITY_MANAGER_VETO)"  location: "JS frame :: file:///home/cltbld/talos-slave/mozilla-central-fedora-opt-u-jsreftest/build/jsreftest/tests/js1_5/extensions/regress-369696-02.js :: test :: line 67"  data: no] item 1

REFTEST TEST-UNEXPECTED-FAIL | file:///home/cltbld/talos-slave/mozilla-central-fedora-opt-u-jsreftest/build/jsreftest/tests/jsreftest.html?test=js1_5/Regress/regress-417893.js | Unknown :0: uncaught exception: [Exception... "Security Manager vetoed action"  nsresult: "0x80570027 (NS_ERROR_XPC_SECURITY_MANAGER_VETO)"  location: "JS frame :: file:///home/cltbld/talos-slave/mozilla-central-fedora-opt-u-jsreftest/build/jsreftest/tests/js1_5/Regress/regress-417893.js :: anonymous :: line 56"  data: no] item 1
Ah, I guess I misunderstood. This patch *combined* with the workaround in comment 4 is enough to pass the jsreftests. I thought this patch fixed all the errors, and that comment 4 was a temporary fix until it lands.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: