Skip to content

Commit ef135ee

Browse files
hochmibrunin
authored andcommitted
[Backport] CVE-2024-7536: Use after free in WebAudio
Manual backport of patch originally reviewed on https://chromium-review.googlesource.com/c/chromium/src/+/5744142: Avoid accessing unconnected outputs in AudioWorkletHandler, AudioHandler This CL fixes the logic to zero out output buses regardless of the outgoing connection status. If an output bus is not connected (or disconnected), we should assume that the outgoing connection might be stale. This fix is verified locally by both the author and the reporter. Bug: 354847246 Change-Id: If10c7bb816e50f7b88252aa9a981b53704724da0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5744142 Commit-Queue: Hongchan Choi <[email protected]> Reviewed-by: Michael Wilson <[email protected]> Cr-Commit-Position: refs/heads/main@{#1334898} Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/582138 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
1 parent 4ed4972 commit ef135ee

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

chromium/third_party/blink/renderer/modules/webaudio/audio_handler.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,9 @@ bool AudioHandler::InputsAreSilent() {
398398

399399
void AudioHandler::SilenceOutputs() {
400400
for (auto& output : outputs_) {
401-
output->Bus()->Zero();
401+
if (output->IsConnectedDuringRendering()) {
402+
output->Bus()->Zero();
403+
}
402404
}
403405
}
404406

chromium/third_party/blink/renderer/modules/webaudio/audio_worklet_handler.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ void AudioWorkletHandler::Process(uint32_t frames_to_process) {
114114
// state. If so, silence the connected outputs and return.
115115
if (!processor_ || processor_->hasErrorOccurred()) {
116116
for (unsigned i = 0; i < NumberOfOutputs(); ++i) {
117-
Output(i).Bus()->Zero();
117+
if (Output(i).IsConnectedDuringRendering()) {
118+
Output(i).Bus()->Zero();
119+
}
118120
}
119121
return;
120122
}

0 commit comments

Comments
 (0)