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

Issue 2843613002: Fix crash when closing a device from a USB transfer timeout (Closed)

Created:
3 years, 7 months ago by Reilly Grant (use Gerrit)
Modified:
3 years, 7 months ago
Reviewers:
mcasas
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix crash when closing a device from a USB transfer timeout Code such as the USB device enumeration logic will close the device immediately in response to a transfer error. This would cause reentrancy into the CancelTransfer function, leading to a crash. This patch updates UsbDeviceHandleUsbfs::Close and CancelTransfer to be reentrancy safe and adds a test case that reproduces the crash without this change applied. BUG=714770 Review-Url: https://codereview.chromium.org/2843613002 Cr-Commit-Position: refs/heads/master@{#466815} Committed: https://chromium.googlesource.com/chromium/src/+/7ac2374e5a71a1c49f8cf433726ce6f4afb81c4e

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address mcasas@ nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -16 lines) Patch
M device/usb/usb_device_handle_unittest.cc View 1 2 chunks +39 lines, -0 lines 0 comments Download
M device/usb/usb_device_handle_usbfs.h View 2 chunks +2 lines, -0 lines 0 comments Download
M device/usb/usb_device_handle_usbfs.cc View 1 22 chunks +50 lines, -16 lines 0 comments Download

Messages

Total messages: 15 (9 generated)
Reilly Grant (use Gerrit)
PTAL
3 years, 7 months ago (2017-04-24 20:14:39 UTC) #4
mcasas
lgtm https://codereview.chromium.org/2843613002/diff/1/device/usb/usb_device_handle_unittest.cc File device/usb/usb_device_handle_unittest.cc (right): https://codereview.chromium.org/2843613002/diff/1/device/usb/usb_device_handle_unittest.cc#newcode124 device/usb/usb_device_handle_unittest.cc:124: EXPECT_EQ(status, UsbTransferStatus::TIMEOUT); nit: EXPECT_EQ(expected, actual) [1] so reverse ...
3 years, 7 months ago (2017-04-24 21:19:23 UTC) #7
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2843613002/diff/1/device/usb/usb_device_handle_unittest.cc File device/usb/usb_device_handle_unittest.cc (right): https://codereview.chromium.org/2843613002/diff/1/device/usb/usb_device_handle_unittest.cc#newcode124 device/usb/usb_device_handle_unittest.cc:124: EXPECT_EQ(status, UsbTransferStatus::TIMEOUT); On 2017/04/24 21:19:23, mcasas wrote: > nit: ...
3 years, 7 months ago (2017-04-24 22:14:01 UTC) #8
Reilly Grant (use Gerrit)
Address mcasas@ nits
3 years, 7 months ago (2017-04-24 22:14:30 UTC) #9
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/2843613002/20001
3 years, 7 months ago (2017-04-24 22:17:29 UTC) #12
commit-bot: I haz the power
3 years, 7 months ago (2017-04-24 23:13:02 UTC) #15
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/7ac2374e5a71a1c49f8cf433726c...

Powered by Google App Engine
This is Rietveld 408576698