| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
lgtm % nits
const auto endpoint_it = endpoint_map_.find(endpoint_address);
if (endpoint_it == endpoint_map_.end()) {Use contains
USB_LOG(ERROR) << "Failed to submit isochronous transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " not part of a claimed interface.";Add missing "is"
```suggestion
USB_LOG(ERROR) << "Failed to submit isochronous transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " is not part of a claimed interface.";
```
const auto endpoint_it = endpoint_map_.find(endpoint_address);
if (endpoint_it == endpoint_map_.end()) {Use contains
USB_LOG(ERROR) << "Failed to submit isochronous transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " not part of a claimed interface.";Add missing "is"
```suggestion
USB_LOG(ERROR) << "Failed to submit isochronous transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " is not part of a claimed interface.";
```
USB_LOG(ERROR) << "Failed to submit transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " not part of a claimed interface.";Add missing "is"
```suggestion
USB_LOG(ERROR) << "Failed to submit transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " is not part of a claimed interface.";
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
const auto endpoint_it = endpoint_map_.find(endpoint_address);
if (endpoint_it == endpoint_map_.end()) {Alvin JiUse contains
Done
USB_LOG(ERROR) << "Failed to submit isochronous transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " not part of a claimed interface.";Add missing "is"
```suggestion
USB_LOG(ERROR) << "Failed to submit isochronous transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " is not part of a claimed interface.";
```
Done
const auto endpoint_it = endpoint_map_.find(endpoint_address);
if (endpoint_it == endpoint_map_.end()) {Alvin JiUse contains
Done
USB_LOG(ERROR) << "Failed to submit isochronous transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " not part of a claimed interface.";Add missing "is"
```suggestion
USB_LOG(ERROR) << "Failed to submit isochronous transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " is not part of a claimed interface.";
```
Done
USB_LOG(ERROR) << "Failed to submit transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " not part of a claimed interface.";Add missing "is"
```suggestion
USB_LOG(ERROR) << "Failed to submit transfer because endpoint "
<< static_cast<int>(endpoint_address)
<< " is not part of a claimed interface.";
```
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: services/device/usb/usb_device_handle_impl.cc
Insertions: 5, Deletions: 7.
@@ -775,11 +775,10 @@
uint8_t endpoint_address =
ConvertTransferDirection(UsbTransferDirection::INBOUND) | endpoint_number;
- const auto endpoint_it = endpoint_map_.find(endpoint_address);
- if (endpoint_it == endpoint_map_.end()) {
+ if (!endpoint_map_.contains(endpoint_address)) {
USB_LOG(ERROR) << "Failed to submit isochronous transfer because endpoint "
<< static_cast<int>(endpoint_address)
- << " not part of a claimed interface.";
+ << " is not part of a claimed interface.";
ReportIsochronousTransferError(std::move(callback), packet_lengths,
UsbTransferStatus::TRANSFER_ERROR);
return;
@@ -812,11 +811,10 @@
uint8_t endpoint_address =
ConvertTransferDirection(UsbTransferDirection::OUTBOUND) |
endpoint_number;
- const auto endpoint_it = endpoint_map_.find(endpoint_address);
- if (endpoint_it == endpoint_map_.end()) {
+ if (!endpoint_map_.contains(endpoint_address)) {
USB_LOG(ERROR) << "Failed to submit isochronous transfer because endpoint "
<< static_cast<int>(endpoint_address)
- << " not part of a claimed interface.";
+ << " is not part of a claimed interface.";
ReportIsochronousTransferError(std::move(callback), packet_lengths,
UsbTransferStatus::TRANSFER_ERROR);
return;
@@ -852,7 +850,7 @@
if (endpoint_it == endpoint_map_.end()) {
USB_LOG(ERROR) << "Failed to submit transfer because endpoint "
<< static_cast<int>(endpoint_address)
- << " not part of a claimed interface.";
+ << " is not part of a claimed interface.";
task_runner_->PostTask(
FROM_HERE,
base::BindOnce(std::move(callback), UsbTransferStatus::TRANSFER_ERROR,
```
usb: prevent UAF in macOS WebUSB isochronous transfers
Add endpoint verification to IsochronousTransferIn and IsochronousTransferOut to ensure the target endpoint is part of a claimed interface before creating the transfer. This prevents transfers from being created with a null claimed interface, which allowed them to bypass cancellation during ReleaseInterface and lead to a Use-After-Free on macOS.
BUG=516999424
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |