Chromium Code Reviews
DescriptionVideoCaptureManager: 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.
Committed: https://crrev.com/abb68a36070c6f5a183c8db994a3f1f9e250d16f
Cr-Commit-Position: refs/heads/master@{#425525}
Patch Set 1 : #
Total comments: 2
Messages
Total messages: 13 (6 generated)
|
|||||||||||||||||||