Changeset 273692 in webkit
- Timestamp:
- Mar 1, 2021, 2:29:17 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
Modules/webaudio/AudioWorkletGlobalScope.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r273690 r273692 1 2021-03-01 Chris Dumez <cdumez@apple.com> 2 3 Protect AudioWorkletGlobalScope::registerProcessor() against re-entry 4 https://bugs.webkit.org/show_bug.cgi?id=222567 5 <rdar://74860464> 6 7 Reviewed by Eric Carlson. 8 9 AudioWorkletGlobalScope::registerProcessor() checks if 'name' is in m_processorConstructorMap 10 then does some checks that potentially run JS and thus call registerProcessor() again (potentially 11 with the same name). To address this, we now check the map again after potentially running the 12 JS code. 13 14 * Modules/webaudio/AudioWorkletGlobalScope.cpp: 15 (WebCore::AudioWorkletGlobalScope::registerProcessor): 16 1 17 2021-03-01 Martin Robinson <mrobinson@webkit.org> 2 18 -
trunk/Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp
r272393 r273692 83 83 84 84 if (!jsConstructor->isConstructor(vm)) 85 return Exception { TypeError, "Class definiti tion passed to registerProcessor() is not a constructor"_s };85 return Exception { TypeError, "Class definition passed to registerProcessor() is not a constructor"_s }; 86 86 87 87 auto prototype = jsConstructor->getPrototype(vm, globalObject); … … 89 89 90 90 if (!prototype.isObject()) 91 return Exception { TypeError, "Class definiti tion passed to registerProcessor() has invalid prototype"_s };91 return Exception { TypeError, "Class definition passed to registerProcessor() has invalid prototype"_s }; 92 92 93 93 auto parameterDescriptorsValue = jsConstructor->get(globalObject, JSC::Identifier::fromString(vm, "parameterDescriptors")); … … 111 111 } 112 112 113 m_processorConstructorMap.add(name, WTFMove(processorContructor)); 113 auto addResult = m_processorConstructorMap.add(name, WTFMove(processorContructor)); 114 115 // We've already checked at the beginning of this function but then we ran some JS so we need to check again. 116 if (!addResult.isNewEntry) 117 return Exception { NotSupportedError, "A processor was already registered with this name"_s }; 114 118 115 119 thread().messagingProxy().postTaskToAudioWorklet([name = name.isolatedCopy(), parameterDescriptors = crossThreadCopy(parameterDescriptors)](AudioWorklet& worklet) mutable {
Note:
See TracChangeset
for help on using the changeset viewer.