Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Issue 2447263002: VideoCaptureManager: fixed double-deletion bug in StopCaptureForClient() on error (Closed)

Created:
4 years, 1 month ago by mcasas
Modified:
4 years, 1 month ago
Reviewers:
emircan
CC:
chromium-reviews, posciak+watch_chromium.org, jam, feature-media-reviews_chromium.org, darin-cc_chromium.org, mcasas+watch+vc_chromium.org, miu+watch_chromium.org
Target Ref:
refs/pending/branch-heads/2883
Project:
chromium
Visibility:
Public.

Description

VideoCaptureManager: fixed double-deletion bug in StopCaptureForClient() on error VideoCaptureManager::StopCaptureForClient() [1], when called in error condition, will run, in the beginning, DeviceEntry* entry = GetDeviceEntryByController(controller); but then, if |aborted_due_to_error|, it would also call (l.719 [2]) synchronuosly: listener_->Aborted(...); MediaStreamManager::StopDevice(...) MediaStreamManager::CloseDevice(...); VideoCaptureManager::Close(...); VideoCaptureManager::DestroyDeviceIfNoClient(...); the last one will invalidate |entry| and destroy the |controller| needed in l.727 [3], hence the UAF. This bug was there before the blamed CLs (see bug), but the migration to mojo has made this path more possible for Cluster Fuzz to exercise. Note: I have no clue how ClusterFuzz managed this, I had to patch the code to cause this error condition :) [1] https://cs.chromium.org/chromium/src/content/browser/renderer_host/media/video_capture_manager.cc?q=VideoCaptureManager::StopCaptureForClient&sq=package:chromium&l=689&dr=CSs [2] https://cs.chromium.org/chromium/src/content/browser/renderer_host/media/video_capture_manager.cc?q=VideoCaptureManager::StopCaptureForClient&sq=package:chromium&dr=CSs&l=719 [3] https://cs.chromium.org/chromium/src/content/browser/renderer_host/media/video_capture_manager.cc?q=VideoCaptureManager::StopCaptureForClient&sq=package:chromium&dr=CSs&l=727 BUG=654199 TEST= see bug for repro; doesn't crash with the patch, capture device is still correctly closed. Review-Url: https://codereview.chromium.org/2417383002 Cr-Commit-Position: refs/heads/master@{#425525} (cherry picked from commit abb68a36070c6f5a183c8db994a3f1f9e250d16f) NOTRY=true NOPRESUBMIT=true

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -10 lines) Patch
M content/browser/renderer_host/media/video_capture_manager.cc View 2 chunks +10 lines, -10 lines 0 comments Download

Messages

Total messages: 16 (8 generated)
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2447263002/1
4 years, 1 month ago (2016-10-25 21:18:21 UTC) #2
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
4 years, 1 month ago (2016-10-25 21:18:22 UTC) #4
mcasas
emircan@ RS plz
4 years, 1 month ago (2016-10-25 21:25:00 UTC) #6
emircan
lgtm
4 years, 1 month ago (2016-10-25 22:05:52 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2447263002/1
4 years, 1 month ago (2016-10-25 22:08:26 UTC) #9
commit-bot: I haz the power
CLs for remote refs other than refs/pending/heads/master must contain NOTRY=true and NOPRESUBMIT=true in order for ...
4 years, 1 month ago (2016-10-25 22:08:28 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2447263002/1
4 years, 1 month ago (2016-10-25 22:13:24 UTC) #14
commit-bot: I haz the power
4 years, 1 month ago (2016-10-25 22:17:50 UTC) #16
Message was sent while issue was closed.
Committed patchset #1 (id:1)

Powered by Google App Engine
This is Rietveld 408576698