Skip to content

hw/usb/u2f-passthru: U2F keepalive fixes

David Bouman qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4hw/usb/u2f: Add `start` and `stop` callbacks to U2F key classhw/usb/u2f.c hw/usb/u2f.h+28 -00 replies
2/4hw/usb/u2f-passthru: Do not needlessly retain handle to hidraw chardevhw/usb/u2f-passthru.c+61 -230 replies
3/4hw/usb/u2f-passthru: Clean up codehw/usb/u2f-passthru.c+44 -290 replies
4/4hw/usb/u2f-passthru: Implement FIDO U2FHID keep-alivehw/usb/u2f-passthru.c+5 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] hw/usb/u2f-passthru: U2F keepalive fixes

Hello,

The u2f-passthru device is currently broken for (at least) the Yubikey 5. (gitlab: https://gitlab.com/qemu-project/qemu/-/issues/2293)

This patchset aims to fix the issue by properly handling the U2F keepalive response in the u2f-passthru device.

I initially suspected the hidraw chardev handle management to be the culprit, so I also implemented a more efficient strategy where the host hidraw chardev is only opened as long as the guest actually needs it to be opened.

This turned out to not be the root cause, but regardless, it's probably the right way to be doing it. Hence, I also included these patches here.

The patches were tested with pamu2fcfg in an x86_64 Linux guest with the u2f-passthru device backed by a physical Yubikey 5 (type C model).

---

I apologize for any anticipatory errors, I'm not really acquainted with the USB/HID/U2F protocols, nor with QEMU. Happy to hear your feedback!

David Bouman (4):
hw/usb/u2f: Add start and stop callbacks to U2F key class hw/usb/u2f-passthru: Do not needlessly retain handle to hidraw chardev hw/usb/u2f-passthru: Clean up code
hw/usb/u2f-passthru: Implement FIDO U2FHID keep-alive

 hw/usb/u2f-passthru.c | 163 ++++++++++++++++++++++++++++--------------
 hw/usb/u2f.c          |  23 ++++++
 hw/usb/u2f.h          |   5 ++
 3 files changed, 138 insertions(+), 53 deletions(-)
Signature · 1 line
2.34.1