chromeos_smart_card_connector icon indicating copy to clipboard operation
chromeos_smart_card_connector copied to clipboard

Fix crash when USB device numbers reach 256

Open emaxx-google opened this issue 5 years ago • 3 comments

Currently, the Smart Card Connector crashes once it receives a USB device number from Chrome that exceeds 255.

Such big numbers don't occur usually, since Chrome just uses an internal counter that gets incremented for every new device, but nevertheless these values may be reached if the Chromebook doesn't get rebooted over a long period of time and the user plugs and unplugs devices many times in between.

The crash happens due to hitting the assertion when the value received from Chrome cannot be casted into the 8-bit number used by libusb: https://github.com/GoogleChromeLabs/chromeos_smart_card_connector/blob/d48f773553a9441846b2e0a1371cc5feb580dfdb/third_party/libusb/naclport/src/libusb_over_chrome_usb.cc#L521

As was written in the comment in the code, one way for fixing this problem is adding code that starts reusing the device numbers once we hit the boundary (e.g., by keeping the track of the most recently used device numbers).

emaxx-google avatar Jan 02 '20 18:01 emaxx-google

This would be very handy as I've run into this a few times on my Chromebooks. I move my Yubikey between several devices during the day for 2FA/GPG/SSH and after a while that leads to my Chromebook not properly interacting with the Yubikey for SSH to other machines or into Crostini if the Smart Card Connector fails. I've recently disabled Smart Card Connector temporarily due to #122 where it prevents mapping a Yubikey directly into Crostini with VMC but it would be nice to have this bug sorted as well for the times where I just need to SSH to another host and not Crostini.

I might be an edge case since I have a Chromebook with tons of RAM that I rarely reboot since more RAM == more open tabs and I have to rely on an extension or two to make closing before a reboot and reopening all of them after a reboot less onerous, but they typically handle per window tab lists and I may have a bunch of tabs "saved" previously by closing them using an extension that I wouldn't want to reopen after a reboot making the session restores more tricky.

dragon788 avatar Jun 16 '20 23:06 dragon788

Chrome is repeatedly crashing on my iPad Pro ,please rectify it regards nawabdera

NAWABDERA1 avatar Mar 05 '22 12:03 NAWABDERA1

Chrome is repeatedly crashing on my iPad Pro ,please rectify it regards nawabdera

NAWABDERA1, please use the standard bug report channel for Chrome issues: https://support.google.com/chrome/answer/95315

emaxx-google avatar Mar 05 '22 18:03 emaxx-google