Open Bug 1863778 Opened 1 year ago Updated 3 months ago

Assertion failure: aBrowsingContext->IsInProcess(), at /toolkit/components/antitracking/AntiTrackingUtils.cpp:924

Categories

(Core :: Privacy: Anti-Tracking, defect, P3)

x86_64
Linux
defect

Tracking

()

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: bugmon, testcase, Whiteboard: [bugmon:bisected,confirmed])

Attachments

(1 file)

3.90 KB, application/octet-stream
Details

Testcase found while fuzzing mozilla-central rev 5d6699b34edc (built with: --enable-debug --enable-fuzzing).

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 5d6699b34edc --debug --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.zip
Assertion failure: aBrowsingContext->IsInProcess(), at /toolkit/components/antitracking/AntiTrackingUtils.cpp:924

    ==48253==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f922da8fb96 bp 0x7fffcb47dcb0 sp 0x7fffcb47dc80 T48253)
    ==48253==The signal is caused by a WRITE memory access.
    ==48253==Hint: address points to the zero page.
        #0 0x7f922da8fb96 in mozilla::AntiTrackingUtils::IsThirdPartyContext(mozilla::dom::BrowsingContext*) /toolkit/components/antitracking/AntiTrackingUtils.cpp:924:3
        #1 0x7f922da8f849 in mozilla::AntiTrackingUtils::IsThirdPartyDocument(mozilla::dom::Document*) /toolkit/components/antitracking/AntiTrackingUtils.cpp:912:17
        #2 0x7f922da8f3fc in mozilla::AntiTrackingUtils::IsThirdPartyWindow(nsPIDOMWindowInner*, nsIURI*) /toolkit/components/antitracking/AntiTrackingUtils.cpp:900:10
        #3 0x7f92281e0b1f in nsGlobalWindowOuter::MaybeAllowStorageForOpenedWindow(nsIURI*) /dom/base/nsGlobalWindowOuter.cpp:6932:8
        #4 0x7f92281d410c in nsGlobalWindowOuter::OpenInternal(nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, bool, bool, bool, bool, bool, nsIArray*, nsISupports*, nsDocShellLoadState*, bool, nsGlobalWindowOuter::PrintKind, mozilla::dom::BrowsingContext**) /dom/base/nsGlobalWindowOuter.cpp:6902:5
        #5 0x7f92281d7ef6 in OpenJS /dom/base/nsGlobalWindowOuter.cpp:5535:10
        #6 0x7f92281d7ef6 in nsGlobalWindowOuter::OpenOuter(nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, mozilla::ErrorResult&) /dom/base/nsGlobalWindowOuter.cpp:5499:17
        #7 0x7f922818d4ed in nsGlobalWindowInner::Open(nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, mozilla::ErrorResult&) /dom/base/nsGlobalWindowInner.cpp:4005:3
        #8 0x7f922939d09f in mozilla::dom::Window_Binding::open(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/./WindowBinding.cpp:2800:59
        #9 0x7f9229925322 in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::MaybeCrossOriginObjectThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) /dom/bindings/BindingUtils.cpp:3330:13
        #10 0x7f922e0e9734 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) /js/src/vm/Interpreter.cpp:472:13
        #11 0x7f922e0e904d in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:566:12
        #12 0x7f922e0ea50d in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) /js/src/vm/Interpreter.cpp:665:8
        #13 0x7f922e6a032d in js::ForwardingProxyHandler::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) const /js/src/proxy/Wrapper.cpp:168:10
        #14 0x7f922e67fb3f in js::CrossCompartmentWrapper::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) const /js/src/proxy/CrossCompartmentWrapper.cpp:229:19
        #15 0x7f922e68f1d3 in js::Proxy::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) /js/src/proxy/Proxy.cpp:705:19
        #16 0x7f922e0e9498 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:546:14
        #17 0x7f922e0f9618 in CallFromStack /js/src/vm/Interpreter.cpp:638:10
        #18 0x7f922e0f9618 in js::Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3053:16
        #19 0x7f922e0e85a2 in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:444:13
        #20 0x7f922e0e9069 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:598:13
        #21 0x7f922e0ea50d in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) /js/src/vm/Interpreter.cpp:665:8
        #22 0x7f922e1d12e4 in JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) /js/src/vm/CallAndConstruct.cpp:119:10
        #23 0x7f92296399ec in mozilla::dom::EventListener::HandleEvent(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::dom::Event&, mozilla::ErrorResult&) /builds/worker/workspace/obj-build/dom/bindings/./EventListenerBinding.cpp:62:8
        #24 0x7f9229f956c6 in void mozilla::dom::EventListener::HandleEvent<mozilla::dom::EventTarget*>(mozilla::dom::EventTarget* const&, mozilla::dom::Event&, mozilla::ErrorResult&, char const*, mozilla::dom::CallbackObject::ExceptionHandling, JS::Realm*) /builds/worker/workspace/obj-build/dist/include/mozilla/dom/EventListenerBinding.h:65:12
        #25 0x7f9229f95282 in mozilla::EventListenerManager::HandleEventSingleListener(mozilla::EventListenerManager::Listener*, nsAtom*, mozilla::WidgetEvent*, mozilla::dom::Event*, mozilla::dom::EventTarget*, bool) /dom/events/EventListenerManager.cpp:1342:43
        #26 0x7f9229f963c4 in mozilla::EventListenerManager::HandleEventWithListenerArray(mozilla::EventListenerManager::ListenerArray*, nsAtom*, mozilla::EventMessage, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, bool) /dom/events/EventListenerManager.cpp:1663:12
        #27 0x7f9229f95c39 in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /dom/events/EventListenerManager.cpp:1560:35
        #28 0x7f9229f8922f in HandleEvent /builds/worker/workspace/obj-build/dist/include/mozilla/EventListenerManager.h:465:5
        #29 0x7f9229f8922f in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:364:17
        #30 0x7f9229f887ab in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:611:18
        #31 0x7f9229f8b1e6 in mozilla::EventDispatcher::Dispatch(mozilla::dom::EventTarget*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) /dom/events/EventDispatcher.cpp:1232:11
        #32 0x7f9229f8e576 in mozilla::EventDispatcher::DispatchDOMEvent(mozilla::dom::EventTarget*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsPresContext*, nsEventStatus*) /dom/events/EventDispatcher.cpp
        #33 0x7f92285d4409 in nsINode::DispatchEvent(mozilla::dom::Event&, mozilla::dom::CallerType, mozilla::ErrorResult&) /dom/base/nsINode.cpp:1401:17
        #34 0x7f92280e94dc in nsContentUtils::DispatchEvent(mozilla::dom::Document*, mozilla::dom::EventTarget*, nsTSubstring<char16_t> const&, mozilla::CanBubble, mozilla::Cancelable, mozilla::Composed, mozilla::Trusted, bool*, mozilla::ChromeOnlyDispatch) /dom/base/nsContentUtils.cpp:4635:29
        #35 0x7f92280e9342 in nsContentUtils::DispatchTrustedEvent(mozilla::dom::Document*, mozilla::dom::EventTarget*, nsTSubstring<char16_t> const&, mozilla::CanBubble, mozilla::Cancelable, mozilla::Composed, bool*) /dom/base/nsContentUtils.cpp:4601:10
        #36 0x7f9228333555 in mozilla::dom::Document::DispatchContentLoadedEvents() /dom/base/Document.cpp:8044:3
        #37 0x7f92283e65a9 in operator()<> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1164:18
        #38 0x7f92283e65a9 in __invoke_impl<void, (lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1163:9)> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:60:14
        #39 0x7f92283e65a9 in __invoke<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1163:9)> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/invoke.h:95:14
        #40 0x7f92283e65a9 in __apply_impl<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1163:9), std::tuple<> &> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/tuple:1678:14
        #41 0x7f92283e65a9 in apply<(lambda at /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1163:9), std::tuple<> &> /builds/worker/fetches/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/tuple:1687:14
        #42 0x7f92283e65a9 in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1162:12
        #43 0x7f92283e65a9 in mozilla::detail::RunnableMethodImpl<mozilla::dom::Document*, void (mozilla::dom::Document::*)(), true, (mozilla::RunnableKind)0>::Run() /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1213:13
        #44 0x7f922672abc7 in mozilla::RunnableTask::Run() /xpcom/threads/TaskController.cpp:549:16
        #45 0x7f9226722793 in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:876:26
        #46 0x7f9226720fd7 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:699:15
        #47 0x7f9226721435 in mozilla::TaskController::ProcessPendingMTTask(bool) /xpcom/threads/TaskController.cpp:485:36
        #48 0x7f922672e8d6 in operator() /xpcom/threads/TaskController.cpp:211:37
        #49 0x7f922672e8d6 in mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run() /xpcom/threads/nsThreadUtils.h:548:5
        #50 0x7f9226745432 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1198:16
        #51 0x7f922674c51d in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:480:10
        #52 0x7f9227408845 in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
        #53 0x7f9227322831 in RunHandler /ipc/chromium/src/base/message_loop.cc:363:3
        #54 0x7f9227322831 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:345:3
        #55 0x7f922bc5ed18 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:148:27
        #56 0x7f922deaa82b in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:721:20
        #57 0x7f9227409726 in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:235:9
        #58 0x7f9227322831 in RunHandler /ipc/chromium/src/base/message_loop.cc:363:3
        #59 0x7f9227322831 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:345:3
        #60 0x7f922deaa092 in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:656:34
        #61 0x55ab19884276 in content_process_main /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #62 0x55ab19884276 in main /browser/app/nsBrowserApp.cpp:375:18
        #63 0x7f923bcf5d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
        #64 0x7f923bcf5e3f in __libc_start_main csu/../csu/libc-start.c:392:3
        #65 0x55ab19859fa8 in _start (/home/jkratzer/builds/m-c-20231107214948-fuzzing-debug/firefox-bin+0x58fa8) (BuildId: e85916198980a98c4e9f8fdbf0edfb81a869e8a7)
    
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV /toolkit/components/antitracking/AntiTrackingUtils.cpp:924:3 in mozilla::AntiTrackingUtils::IsThirdPartyContext(mozilla::dom::BrowsingContext*)
    ==48253==ABORTING
Attached file Testcase

Verified bug as reproducible on mozilla-central 20231108211203-f1fb5f0afb58.
Unable to bisect testcase (Testcase reproduces on start build!):

Start: 57d2a9aee4e4d9c167ca813e40f0c926f5aa7dcb (20221110044858)
End: 5d6699b34edce04ffd8886be86de9d604d88a89a (20231107214948)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False, nyx=False)

Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]
Severity: -- → S3
Priority: -- → P3
Flags: needinfo?(amadan)
Assignee: nobody → amadan
Flags: needinfo?(amadan)
Assignee: abhishekmadan2002 → nobody
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: