Closed Bug 1272305 Opened 8 years ago Closed 8 years ago

Convert nsJSProtocolHandler to use asyncOpen2()

Categories

(Core :: DOM: Security, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1182569

People

(Reporter: ckerschb, Assigned: ckerschb)

References

Details

(Whiteboard: [domsecurity-active])

It seems that channel is never openen anyway [1].

[1] https://hg.mozilla.org/mozilla-central/rev/37b591f54363#l2.12
Assignee: nobody → ckerschb
Blocks: 1182535
Status: NEW → ASSIGNED
Whiteboard: [domsecurity-active]
doContentSecurityCheck {
  channelURI: javascript:"<script>parent.passJSUrl%20=%20true</script>"
  loadingPrincipal: http://mochi.test:8888/tests/dom/jsurl/test/test_bug351633-3.html
  triggeringPrincipal: http://mochi.test:8888/tests/dom/jsurl/test/test_bug351633-3.html
  contentPolicyType: 29
  securityMode:
  initalSecurityChecksDone: no
  enforceSecurity: no
}
Assertion failure: false (need one securityflag from nsILoadInfo to perform security checks), at /home/ckerschb/moz/mc/dom/security/nsContentSecurityManager.cpp:25
#01: ValidateSecurityFlags (/home/ckerschb/moz/mc/dom/security/nsContentSecurityManager.cpp:25)
#02: nsContentSecurityManager::doContentSecurityCheck(nsIChannel*, nsCOMPtr<nsIStreamListener>&) (/home/ckerschb/moz/mc/dom/security/nsContentSecurityManager.cpp:483 (discriminator 3))
#03: nsBaseChannel::AsyncOpen2(nsIStreamListener*) (/home/ckerschb/moz/mc/netwerk/base/nsBaseChannel.cpp:700)
#04: nsJSChannel::EvaluateScript() (/home/ckerschb/moz/mc/dom/jsurl/nsJSProtocolHandler.cpp:772)
#05: decltype (((*{parm#1}).*{parm#2})()) nsRunnableMethodArguments<>::applyImpl<nsJSChannel, void (nsJSChannel::*)()>(nsJSChannel*, void (nsJSChannel::*)(), mozilla::Tuple<>&, mozilla::IndexSequence<>) (/home/ckerschb/moz/mc-obj-ff-dbg/dist/include/nsThreadUtils.h:708 (discriminator 3))
#06: decltype (applyImpl({parm#1}, {parm#2}, (*this).mArguments, (mozilla::IndexSequence<>)())) nsRunnableMethodArguments<>::apply<nsJSChannel, void (nsJSChannel::*)()>(nsJSChannel*, void (nsJSChannel::*)()) (/home/ckerschb/moz/mc-obj-ff-dbg/dist/include/nsThreadUtils.h:715)
#07: nsRunnableMethodImpl<void (nsJSChannel::*)(), true, false>::Run() (/home/ckerschb/moz/mc-obj-ff-dbg/dist/include/nsThreadUtils.h:743)
#08: nsThread::ProcessNextEvent(bool, bool*) (/home/ckerschb/moz/mc/xpcom/threads/nsThread.cpp:992 (discriminator 1))
#09: NS_ProcessNextEvent(nsIThread*, bool) (/home/ckerschb/moz/mc/xpcom/glue/nsThreadUtils.cpp:290)
#10: mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) (/home/ckerschb/moz/mc/ipc/glue/MessagePump.cpp:98)
#11: MessageLoop::RunInternal() (/home/ckerschb/moz/mc/ipc/chromium/src/base/message_loop.cc:234)
#12: MessageLoop::RunHandler() (/home/ckerschb/moz/mc/ipc/chromium/src/base/message_loop.cc:227)
#13: MessageLoop::Run() (/home/ckerschb/moz/mc/ipc/chromium/src/base/message_loop.cc:206)
#14: nsBaseAppShell::Run() (/home/ckerschb/moz/mc/widget/nsBaseAppShell.cpp:158)
#15: nsAppStartup::Run() (/home/ckerschb/moz/mc/toolkit/components/startup/nsAppStartup.cpp:284)
#16: XREMain::XRE_mainRun() (/home/ckerschb/moz/mc/toolkit/xre/nsAppRunner.cpp:4368)
#17: XREMain::XRE_main(int, char**, nsXREAppData const*) (/home/ckerschb/moz/mc/toolkit/xre/nsAppRunner.cpp:4472)
#18: XRE_main (/home/ckerschb/moz/mc/toolkit/xre/nsAppRunner.cpp:4580)
#19: do_main (/home/ckerschb/moz/mc/browser/app/nsBrowserApp.cpp:220)
#20: main (/home/ckerschb/moz/mc/browser/app/nsBrowserApp.cpp:360)
#21: __libc_start_main (/build/eglibc-3GlaMS/eglibc-2.19/csu/libc-start.c:321)
#22: _start (/home/ckerschb/moz/mc-obj-ff-dbg/dist/bin/firefox)
Problem is:

Assertion failure: false, at /home/ckerschb/moz/mc/dom/jsurl/nsJSProtocolHandler.cpp:932
#01: nsJSChannel::SetLoadInfo(nsILoadInfo*) (/home/ckerschb/moz/mc/dom/jsurl/nsJSProtocolHandler.cpp:932)
#02: nsJSProtocolHandler::NewChannel2(nsIURI*, nsILoadInfo*, nsIChannel**) (/home/ckerschb/moz/mc/dom/jsurl/nsJSProtocolHandler.cpp:1246)
#03: nsIOService::NewChannelFromURIWithProxyFlagsInternal(nsIURI*, nsIURI*, unsigned int, nsILoadInfo*, nsIChannel**) (/home/ckerschb/moz/mc/netwerk/base/nsIOService.cpp:795)
#04: nsIOService::NewChannelFromURIWithLoadInfo(nsIURI*, nsILoadInfo*, nsIChannel**) (/home/ckerschb/moz/mc/netwerk/base/nsIOService.cpp:719)
#05: NS_NewChannelInternal(nsIChannel**, nsIURI*, nsILoadInfo*, nsILoadGroup*, nsIInterfaceRequestor*, unsigned int, nsIIOService*) (/home/ckerschb/moz/mc/netwerk/base/nsNetUtilInlines.h:226)
#06: nsDocShell::DoURILoad(nsIURI*, nsIURI*, bool, nsIURI*, bool, unsigned int, nsISupports*, char const*, nsAString_internal const&, nsIInputStream*, nsIInputStream*, bool, nsIDocShell**, nsIRequest**, bool, bool, bool, nsAString_internal const&, nsIURI*, unsigned int) (/home/ckerschb/moz/mc/docshell/base/nsDocShell.cpp:10727)
#07: nsDocShell::InternalLoad(nsIURI*, nsIURI*, bool, nsIURI*, unsigned int, nsISupports*, unsigned int, char16_t const*, char const*, nsAString_internal const&, nsIInputStream*, nsIInputStream*, unsigned int, nsISHEntry*, bool, nsAString_internal const&, nsIDocShell*, nsIURI*, nsIDocShell**, nsIRequest**) (/home/ckerschb/moz/mc/docshell/base/nsDocShell.cpp:10466)
#08: nsDocShell::LoadURI(nsIURI*, nsIDocShellLoadInfo*, unsigned int, bool) (/home/ckerschb/moz/mc/docshell/base/nsDocShell.cpp:1561)
#09: nsLocation::SetURI(nsIURI*, bool) (/home/ckerschb/moz/mc/dom/base/nsLocation.cpp:273)
#10: nsLocation::SetHrefWithBase(nsAString_internal const&, nsIURI*, bool) (/home/ckerschb/moz/mc/dom/base/nsLocation.cpp:539 (discriminator 4))
#11: nsLocation::SetHrefWithContext(JSContext*, nsAString_internal const&, bool) (/home/ckerschb/moz/mc/dom/base/nsLocation.cpp:492)
#12: nsLocation::SetHref(nsAString_internal const&) (/home/ckerschb/moz/mc/dom/base/nsLocation.cpp:461)
#13: nsLocation::SetHref(nsAString_internal const&, mozilla::ErrorResult&) (/home/ckerschb/moz/mc/dom/base/nsLocation.h:76)
#14: set_href (/home/ckerschb/moz/mc-obj-ff-dbg/dom/bindings/LocationBinding.cpp:78)
#15: genericCrossOriginSetter (/home/ckerschb/moz/mc-obj-ff-dbg/dom/bindings/LocationBinding.cpp:825)
#16: js::CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), JS::CallArgs const&) (/home/ckerschb/moz/mc/js/src/jscntxtinlines.h:235)
#17: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:480)
#18: InternalCall (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:526)
#19: js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:544)
#20: js::CallSetter(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::Handle<JS::Value>) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:669)
#21: js::SetPropertyIgnoringNamedGetter(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::Handle<JS::PropertyDescriptor>, JS::ObjectOpResult&) (/home/ckerschb/moz/mc/js/src/proxy/BaseProxyHandler.cpp:245)
#22: mozilla::dom::DOMProxyHandler::set(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) const (/home/ckerschb/moz/mc/dom/bindings/DOMJSProxyHandler.cpp:218)
#23: js::Proxy::set(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) (/home/ckerschb/moz/mc/js/src/proxy/Proxy.cpp:332)
#24: js::proxy_SetProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) (/home/ckerschb/moz/mc/js/src/proxy/Proxy.cpp:588)
#25: JSObject::nonNativeSetProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) (/home/ckerschb/moz/mc/js/src/jsobj.cpp:1051)
#26: js::SetProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) (/home/ckerschb/moz/mc/js/src/vm/NativeObject.h:1524)
#27: js::Wrapper::set(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) const (/home/ckerschb/moz/mc/js/src/proxy/Wrapper.cpp:150)
#28: js::CrossCompartmentWrapper::set(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) const (/home/ckerschb/moz/mc/js/src/proxy/CrossCompartmentWrapper.cpp:197 (discriminator 1))
#29: js::Proxy::set(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) (/home/ckerschb/moz/mc/js/src/proxy/Proxy.cpp:332)
#30: js::proxy_SetProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) (/home/ckerschb/moz/mc/js/src/proxy/Proxy.cpp:588)
#31: JSObject::nonNativeSetProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) (/home/ckerschb/moz/mc/js/src/jsobj.cpp:1051)
#32: js::SetProperty(JSContext*, JS::Handle<JSObject*>, JS::Handle<jsid>, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::ObjectOpResult&) (/home/ckerschb/moz/mc/js/src/vm/NativeObject.h:1524)
#33: SetPropertyOperation (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:284)
#34: Interpret (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:2624)
#35: js::RunScript(JSContext*, js::RunState&) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:426)
#36: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:498)
#37: InternalCall (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:526)
#38: js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:544)
#39: js::fun_apply(JSContext*, unsigned int, JS::Value*) (/home/ckerschb/moz/mc/js/src/jsfun.cpp:1261)
#40: js::CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), JS::CallArgs const&) (/home/ckerschb/moz/mc/js/src/jscntxtinlines.h:235)
#41: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:480)
#42: InternalCall (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:526)
#43: js::CallFromStack(JSContext*, JS::CallArgs const&) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:532)
#44: Interpret (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:2831)
#45: js::RunScript(JSContext*, js::RunState&) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:426)
#46: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:498)
#47: InternalCall (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:526)
#48: js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>) (/home/ckerschb/moz/mc/js/src/vm/Interpreter.cpp:544)
#49: JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) (/home/ckerschb/moz/mc/js/src/jsapi.cpp:2926)
#50: mozilla::dom::EventHandlerNonNull::Call(JSContext*, JS::Handle<JS::Value>, mozilla::dom::Event&, JS::MutableHandle<JS::Value>, mozilla::ErrorResult&) (/home/ckerschb/moz/mc-obj-ff-dbg/dom/bindings/EventHandlerBinding.cpp:260 (discriminator 1))
#51: void mozilla::dom::EventHandlerNonNull::Call<nsISupports*>(nsISupports* const&, mozilla::dom::Event&, JS::MutableHandle<JS::Value>, mozilla::ErrorResult&, char const*, mozilla::dom::CallbackObject::ExceptionHandling, JSCompartment*) (/home/ckerschb/moz/mc-obj-ff-dbg/dist/include/mozilla/dom/EventHandlerBinding.h:351)
#52: mozilla::JSEventHandler::HandleEvent(nsIDOMEvent*) (/home/ckerschb/moz/mc/dom/events/JSEventHandler.cpp:215)
#53: mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, nsIDOMEvent*, mozilla::dom::EventTarget*) (/home/ckerschb/moz/mc/dom/events/EventListenerManager.cpp:1111)
#54: mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent**, mozilla::dom::EventTarget*, nsEventStatus*) (/home/ckerschb/moz/mc/dom/events/EventListenerManager.cpp:1282)
#55: mozilla::EventListenerManager::HandleEvent(nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent**, mozilla::dom::EventTarget*, nsEventStatus*) (/home/ckerschb/moz/mc-obj-ff-dbg/dist/include/mozilla/EventListenerManager.h:352)
#56: mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) (/home/ckerschb/moz/mc/dom/events/EventDispatcher.cpp:278)
#57: mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) (/home/ckerschb/moz/mc/dom/events/EventDispatcher.cpp:381)
#58: mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) (/home/ckerschb/moz/mc/dom/events/EventDispatcher.cpp:713)
#59: nsDocumentViewer::LoadComplete(nsresult) (/home/ckerschb/moz/mc/layout/base/nsDocumentViewer.cpp:1000)
#60: nsDocShell::EndPageLoad(nsIWebProgress*, nsIChannel*, nsresult) (/home/ckerschb/moz/mc/docshell/base/nsDocShell.cpp:7518)
#61: nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) (/home/ckerschb/moz/mc/docshell/base/nsDocShell.cpp:7331)
#62: nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, nsresult) (/home/ckerschb/moz/mc/uriloader/base/nsDocLoader.cpp:1250 (discriminator 1))
#63: nsDocLoader::doStopDocumentLoad(nsIRequest*, nsresult) (/home/ckerschb/moz/mc/uriloader/base/nsDocLoader.cpp:833 (discriminator 2))
#64: nsDocLoader::DocLoaderIsEmpty(bool) (/home/ckerschb/moz/mc/uriloader/base/nsDocLoader.cpp:726)
#65: nsDocLoader::ChildDoneWithOnload(nsIDocumentLoader*) (/home/ckerschb/moz/mc/uriloader/base/nsDocLoader.h:202)
#66: nsDocLoader::DocLoaderIsEmpty(bool) (/home/ckerschb/moz/mc/uriloader/base/nsDocLoader.cpp:714 (discriminator 2))
#67: nsDocLoader::OnStopRequest(nsIRequest*, nsISupports*, nsresult) (/home/ckerschb/moz/mc/uriloader/base/nsDocLoader.cpp:608 (discriminator 1))
#68: nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, nsresult) (/home/ckerschb/moz/mc/netwerk/base/nsLoadGroup.cpp:633)
#69: nsDocument::DoUnblockOnload() (/home/ckerschb/moz/mc/dom/base/nsDocument.cpp:9193 (discriminator 1))
#70: nsDocument::UnblockOnload(bool) (/home/ckerschb/moz/mc/dom/base/nsDocument.cpp:9120)
#71: nsDocument::DispatchContentLoadedEvents() (/home/ckerschb/moz/mc/dom/base/nsDocument.cpp:5202)
#72: decltype (((*{parm#1}).*{parm#2})()) nsRunnableMethodArguments<>::applyImpl<nsDocument, void (nsDocument::*)()>(nsDocument*, void (nsDocument::*)(), mozilla::Tuple<>&, mozilla::IndexSequence<>) (/home/ckerschb/moz/mc-obj-ff-dbg/dist/include/nsThreadUtils.h:708 (discriminator 3))
#73: decltype (applyImpl({parm#1}, {parm#2}, (*this).mArguments, (mozilla::IndexSequence<>)())) nsRunnableMethodArguments<>::apply<nsDocument, void (nsDocument::*)()>(nsDocument*, void (nsDocument::*)()) (/home/ckerschb/moz/mc-obj-ff-dbg/dist/include/nsThreadUtils.h:715)
#74: nsRunnableMethodImpl<void (nsDocument::*)(), true, false>::Run() (/home/ckerschb/moz/mc-obj-ff-dbg/dist/include/nsThreadUtils.h:743)
#75: nsThread::ProcessNextEvent(bool, bool*) (/home/ckerschb/moz/mc/xpcom/threads/nsThread.cpp:992 (discriminator 1))
#76: NS_ProcessNextEvent(nsIThread*, bool) (/home/ckerschb/moz/mc/xpcom/glue/nsThreadUtils.cpp:290)
#77: mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) (/home/ckerschb/moz/mc/ipc/glue/MessagePump.cpp:98)
#78: MessageLoop::RunInternal() (/home/ckerschb/moz/mc/ipc/chromium/src/base/message_loop.cc:234)
#79: MessageLoop::RunHandler() (/home/ckerschb/moz/mc/ipc/chromium/src/base/message_loop.cc:227)
#80: MessageLoop::Run() (/home/ckerschb/moz/mc/ipc/chromium/src/base/message_loop.cc:206)
#81: nsBaseAppShell::Run() (/home/ckerschb/moz/mc/widget/nsBaseAppShell.cpp:158)
#82: nsAppStartup::Run() (/home/ckerschb/moz/mc/toolkit/components/startup/nsAppStartup.cpp:284)
#83: XREMain::XRE_mainRun() (/home/ckerschb/moz/mc/toolkit/xre/nsAppRunner.cpp:4368)
#84: XREMain::XRE_main(int, char**, nsXREAppData const*) (/home/ckerschb/moz/mc/toolkit/xre/nsAppRunner.cpp:4472)
#85: XRE_main (/home/ckerschb/moz/mc/toolkit/xre/nsAppRunner.cpp:4580)
#86: do_main (/home/ckerschb/moz/mc/browser/app/nsBrowserApp.cpp:220)
#87: main (/home/ckerschb/moz/mc/browser/app/nsBrowserApp.cpp:360)
#88: __libc_start_main (/build/eglibc-3GlaMS/eglibc-2.19/csu/libc-start.c:321)
So we actually can't convert nsJSProtocolHandler to use asyncOpen2() before we have converted docshell to set the right loadInfo args.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.