RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1309634 - "usb-filter" field of vv-file is ignored
Summary: "usb-filter" field of vv-file is ignored
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-viewer
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Virt Viewer Maint
QA Contact: SPICE QE bug list
URL:
Whiteboard:
Depends On:
Blocks: 1327525
TreeView+ depends on / blocked
 
Reported: 2016-02-18 10:59 UTC by Uri Lublin
Modified: 2016-11-04 01:14 UTC (History)
10 users (show)

Fixed In Version: virt-viewer-2.0-7.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1327525 (view as bug list)
Environment:
Last Closed: 2016-11-04 01:14:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2229 0 normal SHIPPED_LIVE virt-viewer, libgovirt, spice-gtk, and usbredir bug fix and enhancement update 2016-11-03 13:26:58 UTC

Description Uri Lublin 2016-02-18 10:59:57 UTC
Description of problem:
When using a vv-file to connect, usb-filter field is ignored.

remote-viewer should to pass the value to spice-gtk.

Version-Release number of selected component (if applicable):
virt-viewer-2.0-6.el7

How reproducible:
Happens every time.

Steps to Reproduce:
By checking debug messages:
0. Start a VM with USB enabled.
   In this example I'll use disable-ticketing,port=5907 and connect
   from localhost.
1. Create a vv-file.
$ cat > /tmp/console.vv << EOF
[virt-viewer]
type=spice
host=localhost
port=5907
enable-usbredir=1
enable-usb-autoshare=1
usb-filter=-1,8888,9999,-1,0
EOF
2. Run remote-viewer and connect to the vm; Look at debug messages.
$ remote-viewer --spice-debug   /tmp/console.vv  |& grep 'auto-connect filter'
3. Close remote-viewer.

By checking functionality
0. VM is already running
1. Modify the vv-file -- change usb-filter to reject all devices
usb-filter=-1,-1,-1,-1,0
2. Run remote-viewer
remote-viewer /tmp/console.vv
3. With focus on remote-viewer, plug in a usb-disk device and see if
   it is being auto-shared with the guest.

Actual results:
  debug-messages: only the following messages are seen:
    auto-connect filter set to 0x03,-1,-1,-1,0|-1,-1,-1,-1,1
  functionality:
    USB disk device is auto-share with the guest.

Expected results:
  debug-messages: the following line appears
    auto-connect filter set to -1,8888,9999,-1,0
  functionality:
    USB disk device is not shared with the guest.

Additional info:
1. Problem exists on upstream git too.
2. remote-viewer --spice-usbredir-auto-redirect-filter=-1,-1,-1,-1,0 spice://localhost:5907   works well

Comment 3 Fabiano Fidêncio 2016-02-18 15:27:15 UTC
Just for the record, the commit that solves the issue is:
7a54b96dbebfeb44f73a3e48e11f32006763a3b6

Comment 5 Xiaodai Wang 2016-04-15 09:02:05 UTC
I can reproduce it with virt-viewer-2.0-6.el7.x86_64.

Steps:
1. Prepare a guest and a ini file and set the "usb-filter=-1,-1,-1,-1,0" to forbid any usb device.

# cat b.ini
[virt-viewer]
type=spice
host=localhost
port=5901
enable-usbredir=1
enable-usb-autoshare=1
usb-filter=-1,-1,-1,-1,0

2. Run "remote-viewer b.ini" to connect to the guest.
3. Plug a usb device into the host device.

Acutal Result:
The usb device pops up in the guest.

Then updated to latest virt-viewer-2.0-7.el7.x86_64 and retested it again. The usb device cannot pop up. Set the usb-filter to "usb-filter=-1,-1,-1,-1,1" and replug the usb device, it can pop up successfully.

So it is fixed and move it from ON_QA to VERIFIED.

Comment 8 errata-xmlrpc 2016-11-04 01:14:29 UTC
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-2016-2229.html


Note You need to log in before you can comment on or make changes to this bug.