qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] e58d64: ccid-card-passthru: fix regression in


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] e58d64: ccid-card-passthru: fix regression in realize()
Date: Fri, 18 May 2018 06:11:41 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e58d64a16abc2304c4dcb644411eb9580bf63b1e
      
https://github.com/qemu/qemu/commit/e58d64a16abc2304c4dcb644411eb9580bf63b1e
  Author: Marc-André Lureau <address@hidden>
  Date:   2018-05-18 (Fri, 18 May 2018)

  Changed paths:
    M hw/usb/ccid-card-passthru.c

  Log Message:
  -----------
  ccid-card-passthru: fix regression in realize()

Since cc847bfd16d894fd8c1a2ce25f31772f6cdbbc74, CCID card-passthru
fails to intialize, because it changed a debug line to an error,
probably by mistake. Change it back to a DPRINTF debug.

(solves Boxes creating VM with smartcard passthru failing to start)

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 8030dca376fa1bc4d8a6be7628196578f8783ab3
      
https://github.com/qemu/qemu/commit/8030dca376fa1bc4d8a6be7628196578f8783ab3
  Author: Jakub Jelen <address@hidden>
  Date:   2018-05-18 (Fri, 18 May 2018)

  Changed paths:
    M hw/usb/dev-smartcard-reader.c

  Log Message:
  -----------
  hw/usb/dev-smartcard-reader: Handle 64 B USB packets

The current code was not correctly handling 64 B (Max USB 1.1 payload size)
packets and therefore preventing some of the messages from smart card to
pass through to the guest.

If the smart card in host responded with 34 B of data in APDU layer, the
CCID headers added up to 64 B. The packet was send, but not correctly
committed per USB specification (8.5.3.2  Variable-length Data Stage):

>   When all of the data structure is returned to the host, the function
> should indicate that the Data stage is ended by returning a packet
> that is shorter than the MaxPacketSize for the pipe.  If the data
> structure is an exact multiple of wMaxPacketSize for the pipe, the
> function will return a zero-length packet to indicate the end of the
> Data stage.

This lead the guest applications to timeout while waiting for the rest
of data (the emulation layer is answering with NAK until the timeout).

This patch is checking the current maximum packet size and if the
payload of this size is detected, the message buffer is not yet released.
With the next call, the empty buffer is sent and the message buffer
is finally released.

Signed-off-by: Jakub Jelen <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: dba0f15a3b3a2e72a526be665efad73f3c34a5dd
      
https://github.com/qemu/qemu/commit/dba0f15a3b3a2e72a526be665efad73f3c34a5dd
  Author: Peter Maydell <address@hidden>
  Date:   2018-05-18 (Fri, 18 May 2018)

  Changed paths:
    M hw/usb/ccid-card-passthru.c
    M hw/usb/dev-smartcard-reader.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kraxel/tags/usb-20180518-pull-request' 
into staging

usb: two smartcard reader fixes.

# gpg: Signature made Fri 18 May 2018 08:50:01 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <address@hidden>"
# gpg:                 aka "Gerd Hoffmann <address@hidden>"
# gpg:                 aka "Gerd Hoffmann (private) <address@hidden>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/usb-20180518-pull-request:
  hw/usb/dev-smartcard-reader: Handle 64 B USB packets
  ccid-card-passthru: fix regression in realize()

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/30d9081d646c...dba0f15a3b3a
      **NOTE:** This service been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]