Closed Bug 1757757 Opened 3 years ago Closed 2 years ago

[@ mozilla::CanvasUtils::DoDrawImageSecurityCheck | @ mozilla::dom::CanvasGeneralPattern::ForStyle]

Categories

(Core :: Graphics: Canvas2D, defect, P3)

x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1779521
Tracking Status
firefox-esr91 --- unaffected
firefox99 --- wontfix
firefox100 --- wontfix
firefox101 --- wontfix

People

(Reporter: jkratzer, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

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

Crash Data

Attachments

(1 file)

(deleted), application/octet-stream
Details

Testcase found while fuzzing mozilla-central rev 2c2b8330e2a5 (built with: --enable-address-sanitizer --enable-fuzzing).

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework
$ python -m fuzzfetch --build 2c2b8330e2a5 --asan --fuzzing -n firefox
$ python -m grizzly.replay ./firefox/firefox testcase.zip
[@ Is<mozilla::ContentPrincipal>]

    =================================================================
    ==239686==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000070 (pc 0x7fa9caa2bea9 bp 0x7ffd1435a490 sp 0x7ffd1435a490 T0)
    ==239686==The signal is caused by a READ memory access.
    ==239686==Hint: address points to the zero page.
        #0 0x7fa9caa2bea9 in Is<mozilla::ContentPrincipal> /builds/worker/workspace/obj-build/dist/include/mozilla/BasePrincipal.h:95:12
        #1 0x7fa9caa2bea9 in mozilla::BasePrincipal::AddonPolicy() /caps/BasePrincipal.cpp:1099:7
        #2 0x7fa9cde7336b in mozilla::CanvasUtils::DoDrawImageSecurityCheck(mozilla::dom::HTMLCanvasElement*, nsIPrincipal*, bool, bool) /dom/canvas/CanvasUtils.cpp:254:40
        #3 0x7fa9cde48cc8 in mozilla::dom::CanvasGeneralPattern::ForStyle(mozilla::dom::CanvasRenderingContext2D*, mozilla::dom::CanvasRenderingContext2D::Style, mozilla::gfx::DrawTarget*) /dom/canvas/CanvasRenderingContext2D.cpp:305:13
        #4 0x7fa9cde46f9c in mozilla::dom::CanvasRenderingContext2D::FillRect(double, double, double, double) /dom/canvas/CanvasRenderingContext2D.cpp:2696:43
        #5 0x7fa9cce5c842 in mozilla::dom::CanvasRenderingContext2D_Binding::fillRect(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&) /builds/worker/workspace/obj-build/dom/bindings/CanvasRenderingContext2DBinding.cpp:5974:24
        #6 0x7fa9cdca54cd in bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*) /dom/bindings/BindingUtils.cpp:3306:13
        #7 0x7fa9d61ed934 in CallJSNative /js/src/vm/Interpreter.cpp:425:13
        #8 0x7fa9d61ed934 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:512:12
        #9 0x7fa9d61d9e4e in CallFromStack /js/src/vm/Interpreter.cpp:576:10
        #10 0x7fa9d61d9e4e in Interpret(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:3309:16
        #11 0x7fa9d61bec51 in js::RunScript(JSContext*, js::RunState&) /js/src/vm/Interpreter.cpp:394:13
        #12 0x7fa9d61eda6f in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) /js/src/vm/Interpreter.cpp:544:13
        #13 0x7fa9d61efbbb 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:589:8
        #14 0x7fa9d63aa29d in JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) /js/src/vm/CallAndConstruct.cpp:117:10
        #15 0x7fa9cd8d0ea9 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
        #16 0x7fa9ce664354 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
        #17 0x7fa9ce663e10 in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*) /dom/events/EventListenerManager.cpp:1310:43
        #18 0x7fa9ce6654bc in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool) /dom/events/EventListenerManager.cpp:1507:17
        #19 0x7fa9ce6535de in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:348:17
        #20 0x7fa9ce651ded in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&) /dom/events/EventDispatcher.cpp:550:16
        #21 0x7fa9ce656065 in mozilla::EventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event*, nsEventStatus*, mozilla::EventDispatchingCallback*, nsTArray<mozilla::dom::EventTarget*>*) /dom/events/EventDispatcher.cpp:1085:11
        #22 0x7fa9d1704227 in nsDocumentViewer::LoadComplete(nsresult) /layout/base/nsDocumentViewer.cpp:1084:7
        #23 0x7fa9d518ae23 in nsDocShell::EndPageLoad(nsIWebProgress*, nsIChannel*, nsresult) /docshell/base/nsDocShell.cpp:6416:20
        #24 0x7fa9d518a11b in nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) /docshell/base/nsDocShell.cpp:5805:7
        #25 0x7fa9d518c0ef in non-virtual thunk to nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, nsresult) /docshell/base/nsDocShell.cpp
        #26 0x7fa9ca991ad0 in nsDocLoader::DoFireOnStateChange(nsIWebProgress*, nsIRequest*, int&, nsresult) /uriloader/base/nsDocLoader.cpp:1377:3
        #27 0x7fa9ca9903e4 in nsDocLoader::doStopDocumentLoad(nsIRequest*, nsresult) /uriloader/base/nsDocLoader.cpp:975:14
        #28 0x7fa9ca98cc12 in nsDocLoader::DocLoaderIsEmpty(bool, mozilla::Maybe<nsresult> const&) /uriloader/base/nsDocLoader.cpp:794:9
        #29 0x7fa9ca98edd5 in nsDocLoader::OnStopRequest(nsIRequest*, nsresult) /uriloader/base/nsDocLoader.cpp:677:5
        #30 0x7fa9d51c561b in nsDocShell::OnStopRequest(nsIRequest*, nsresult) /docshell/base/nsDocShell.cpp:13792:23
        #31 0x7fa9c90d9ffe in mozilla::net::nsLoadGroup::NotifyRemovalObservers(nsIRequest*, nsresult) /netwerk/base/nsLoadGroup.cpp:614:22
        #32 0x7fa9c90dca43 in mozilla::net::nsLoadGroup::RemoveRequest(nsIRequest*, nsISupports*, nsresult) /netwerk/base/nsLoadGroup.cpp:518:10
        #33 0x7fa9cbda6584 in mozilla::dom::Document::DoUnblockOnload() /dom/base/Document.cpp:11540:18
        #34 0x7fa9cbd534b0 in mozilla::dom::Document::UnblockOnload(bool) /dom/base/Document.cpp:11478:9
        #35 0x7fa9cbd7e4ac in mozilla::dom::Document::DispatchContentLoadedEvents() /dom/base/Document.cpp:8018:3
        #36 0x7fa9cbe71c1d in applyImpl<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1147:12
        #37 0x7fa9cbe71c1d in apply<mozilla::dom::Document, void (mozilla::dom::Document::*)()> /builds/worker/workspace/obj-build/dist/include/nsThreadUtils.h:1153:12
        #38 0x7fa9cbe71c1d 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:1200:13
        #39 0x7fa9c8d3af0f in mozilla::SchedulerGroup::Runnable::Run() /xpcom/threads/SchedulerGroup.cpp:140:20
        #40 0x7fa9c8d89c72 in mozilla::RunnableTask::Run() /xpcom/threads/TaskController.cpp:467:16
        #41 0x7fa9c8d4e19d in mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:770:26
        #42 0x7fa9c8d4b6f8 in mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) /xpcom/threads/TaskController.cpp:606:15
        #43 0x7fa9c8d4be09 in mozilla::TaskController::ProcessPendingMTTask(bool) /xpcom/threads/TaskController.cpp:390:36
        #44 0x7fa9c8d925e1 in operator() /xpcom/threads/TaskController.cpp:124:37
        #45 0x7fa9c8d925e1 in mozilla::detail::RunnableFunction<mozilla::TaskController::InitializeInternal()::$_0>::Run() /xpcom/threads/nsThreadUtils.h:531:5
        #46 0x7fa9c8d6ef37 in nsThread::ProcessNextEvent(bool, bool*) /xpcom/threads/nsThread.cpp:1173:16
        #47 0x7fa9c8d7a4ac in NS_ProcessNextEvent(nsIThread*, bool) /xpcom/threads/nsThreadUtils.cpp:467:10
        #48 0x7fa9ca46f6ff in mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) /ipc/glue/MessagePump.cpp:85:21
        #49 0x7fa9ca2ece31 in RunInternal /ipc/chromium/src/base/message_loop.cc:331:10
        #50 0x7fa9ca2ece31 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #51 0x7fa9ca2ece31 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #52 0x7fa9d108c337 in nsBaseAppShell::Run() /widget/nsBaseAppShell.cpp:137:27
        #53 0x7fa9d5f04edf in XRE_RunAppShell() /toolkit/xre/nsEmbedFunctions.cpp:856:20
        #54 0x7fa9ca2ece31 in RunInternal /ipc/chromium/src/base/message_loop.cc:331:10
        #55 0x7fa9ca2ece31 in RunHandler /ipc/chromium/src/base/message_loop.cc:324:3
        #56 0x7fa9ca2ece31 in MessageLoop::Run() /ipc/chromium/src/base/message_loop.cc:306:3
        #57 0x7fa9d5f04103 in XRE_InitChildProcess(int, char**, XREChildData const*) /toolkit/xre/nsEmbedFunctions.cpp:715:34
        #58 0x55744904547d in content_process_main(mozilla::Bootstrap*, int, char**) /browser/app/../../ipc/contentproc/plugin-container.cpp:57:28
        #59 0x5574490458b0 in main /browser/app/nsBrowserApp.cpp:327:18
        #60 0x7fa9ed7e90b2 in __libc_start_main /build/glibc-sMfBJT/glibc-2.31/csu/../csu/libc-start.c:308:16
        #61 0x557448f94569 in _start (/home/jkratzer/builds/mc-asan/firefox+0x5e569)
    
    AddressSanitizer can not provide additional info.
    SUMMARY: AddressSanitizer: SEGV /builds/worker/workspace/obj-build/dist/include/mozilla/BasePrincipal.h:95:12 in Is<mozilla::ContentPrincipal>
    ==239686==ABORTING
Attached file Testcase (deleted) —

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20220303094735-96a077ed86f8.
The bug appears to have been introduced in the following build range:

Start: e26783765b37fb54ba77b3ad45aa4ec1f0e2f57c (20220203195551)
End: 4b4089d4c9d8556b3e3b445b7697f2833cc5ba7a (20220203225616)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=e26783765b37fb54ba77b3ad45aa4ec1f0e2f57c&tochange=4b4089d4c9d8556b3e3b445b7697f2833cc5ba7a

Keywords: regression
Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]

Andrew, this looks like it may be related to Bug 1746750. Would you please take a look?

Flags: needinfo?(aosmond)
Severity: -- → S3
Priority: -- → P3
Regressed by: 1746750

Set release status flags based on info from the regressing bug 1746750

Bugmon Analysis
Testcase crashes using the initial build (mozilla-central 20220302043147-2c2b8330e2a5) but not with tip (mozilla-central 20220715212953-315e476ecf38.)

The bug appears to have been fixed in the following build range:

Start: 4120c49b58c644ed98d3e16a721cec451aa7bef7 (20220714172148)
End: 65f72ec8bb2a638e417a294b41d30ea5d142385a (20220714185143)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=4120c49b58c644ed98d3e16a721cec451aa7bef7&tochange=65f72ec8bb2a638e417a294b41d30ea5d142385a

jkratzer, can you confirm that the above bisection range is responsible for fixing this issue?
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Flags: needinfo?(aosmond) → needinfo?(jkratzer)
Keywords: bugmon
Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(jkratzer)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: