Hide Forgot
Description of problem: smart card emulation doesn't work with USB3 (nec-xhci) controller Version-Release number of selected component (if applicable): qemu-kvm-1.5.3-86.el7_1.1.x86_64 How reproducible: always Steps to Reproduce: 1. set up a VM with smartcard controller and USB3 controller: <controller type='usb' index='0' model='nec-xhci'/> <smartcard mode='passthrough' type='spicevmc'> <address type='ccid' controller='0' slot='0'/> </smartcard> 2. connect to the VM (virt-viewer $VM_NAME --spice-smartcard) 3. Actual results: smartcard emulation doesn't work. Examples of what is printed to qemu log with both QEMU_CCID_PASSTHRU_DEBUG and QEMU_CCID_DEBUG set to 4 is below Expected results: smartcard works just as it works with default controller (USB2 or in domain xml, ich9-ehci/ich9-uhci) Additional info: examples of qemu log: -- 8< -- usb-ccid: ccid_handle_bulk_out 65 GetSlotStatus usb-ccid: ccid_reserve_recv_buf: QUEUE: reserve 10 bytes usb-ccid: ccid_calc_status: status = 0 usb-ccid: ccid_bulk_in_copy_to_guest: 10/10 req/act to guest (BULK_IN) usb-ccid: ccid_bulk_in_copy_to_guest: 10/2 req/act to guest (BULK_IN) usb-ccid: ccid_bulk_in_copy_to_guest: returning short (EREMOTEIO) 2 < 10 -- 8< -- usb-ccid: ccid_handle_bulk_out 65 GetSlotStatus usb-ccid: ccid_reserve_recv_buf: QUEUE: reserve 10 bytes usb-ccid: ccid_calc_status: status = 0 usb-ccid: ccid_bulk_in_copy_to_guest: 10/10 req/act to guest (BULK_IN) usb-ccid: ccid_bulk_in_copy_to_guest: 10/10 req/act to guest (BULK_IN) usb-ccid: ccid_handle_bulk_out 65 GetSlotStatus usb-ccid: ccid_reserve_recv_buf: QUEUE: reserve 10 bytes usb-ccid: ccid_calc_status: status = 0 usb-ccid: ccid_bulk_in_copy_to_guest: 10/10 req/act to guest (BULK_IN) usb-ccid: ccid_handle_bulk_out 62 IccPowerOn usb-ccid: ccid_handle_bulk_out: PowerOn: 0 usb-ccid: ccid_write_data_block_atr: atr contains protocol=0 usb-ccid: ccid_reserve_recv_buf: QUEUE: reserve 22 bytes usb-ccid: ccid_calc_status: status = 0 usb-ccid: ccid_bulk_in_copy_to_guest: 259/22 req/act to guest (BULK_IN) usb-ccid: ccid_bulk_in_copy_to_guest: returning short (EREMOTEIO) 22 < 259 usb-ccid: ccid_handle_bulk_out 6f XfrBlock usb-ccid: ccid_on_apdu_from_guest: seq 27, len 14 usb-ccid: usb-ccid: pending answers:usb-ccid: 0:27 usb-ccid: ccid_bulk_in_copy_to_guest: returning short (EREMOTEIO) 0 < 273 usb-ccid: APDU returned to guest 2 (answer seq 27, slot 0) usb-ccid: usb-ccid: pending answers:usb-ccid: empty usb-ccid: ccid_reserve_recv_buf: QUEUE: reserve 12 bytes usb-ccid: ccid_calc_status: status = 0
http://patchwork.ozlabs.org/patch/465422/
(In reply to Gerd Hoffmann from comment #1) > http://patchwork.ozlabs.org/patch/465422/ I don't see this patch upstream yet... What's the plan? Should I devel_ack+ this BZ?
upstream commit 4e8cfbe1143d8384387595b500212d7a7f11aeae
backport posted.
please test this scratch build: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=9529070
new patch posted.
(In reply to Gerd Hoffmann from comment #6) > please test this scratch build: > http://brewweb.devel.redhat.com/brew/taskinfo?taskID=9529070 The scratch build fixes the problem at my system. The "ccid_bulk_in_copy_to_guest: returning short (EREMOTEIO)" messages keep being printed by qemu however (I'm not sure if they're significant though).
Created attachment 1054428 [details] log of logging into the system using smartcard, log is full of EREMOTEIO messages
Fix included in qemu-kvm-rhev-2.3.0-15.el7
reproduce the issue: host info: 3.10.0-303.el7.x86_64 qemu-kvm-rhev-2.3.0-12.el7.x86_64 steps: 1.boot up a rhel7.2 guest with smartcard controller and USB3 controller: -device nec-usb-xhci -chardev spicevmc,name=smartcard,id=ccid -device usb-ccid -device ccid-card-passthru,chardev=ccid 2.in both host and guest #yum groupinstall "smart card support" #yum remove '*openct*' #service pcscd start 3.plug in the reader before you run remote-viewer on host. remote-viewer --spice-smartcard spice://$IP:7000 4. open Smart Card Manager application in guest actual results: Smart Card Manager application can not find the samrt card in guest. verify the issue: host info: 3.10.0-303.el7.x86_64 qemu-kvm-rhev-2.3.0-15.el7.x86_64 steps: the same as above actual results: Smart Card Manager application can find the samrt card in guest.
Verify this issue from libvirt : verify version: libvirt-1.2.17-5.el7.x86_64 qemu-kvm-rhev-2.3.0-17.el7.x86_64 verify steps: 1.prepare env both host and guest : # yum groupinstall "smart card support" # service pcscd start Redirecting to /bin/systemctl start pcscd.service Plug physical smart card to host . check in host : Application ---> SystemTools ---> Smart Card Manager 2.define and start guest with following XML configuration. #virsh dumpxml r708 usb3.0 controller: <controller type='usb' index='0' model='nec-xhci'> <alias name='usb'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </controller> ccid controller : <controller type='ccid' index='0'> <alias name='ccid0'/> </controller> smart card passthrough : <smartcard mode='passthrough' type='spicevmc'> <alias name='smartcard0'/> <address type='ccid' controller='0' slot='0'/> </smartcard> spice graphic: <graphics type='spice' autoport='yes' listen='0.0.0.0'> <listen type='address' address='0.0.0.0'/> </graphics> 2.1 check qemu cli, make sure guest's qemu cli like following : -device nec-usb-xhci,id=usb,bus=pci.0,addr=0x6 -device usb-ccid,id=ccid0 -chardev spicevmc,id=charsmartcard0,name=smartcard -device ccid-card-passthru,chardev=charsmartcard0,id=smartcard0,bus=ccid0.0 3.start guest to check #virsh start r708 #virsh domdisplay r708 3.2 using remote-viewer to check, must with "--spice-smartcard" # remote-viewer --spice-smartcard spice://$host-IP:5901 check in guest : Application ---> SystemTools ---> Smart Card Manager smartcard enrolled.
According to comment12 and commnet13, set this issue as verified.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2546.html