VirtualBox

Changeset 100772 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Aug 1, 2023 5:34:48 PM (18 months ago)
Author:
vboxsync
Message:

include/VBox/usbfilter.h,HostDrivers/VBoxUSB/USBFilter: IUSBDeviceFilter:
USB device interval filters don't work. bugref:10452

Main/Host,Main/USBDeviceFilter: Adding or removing global USB device
filters causes memory corruption wihch can lead to a deadlock or a SEGV
as the list of global USB device filters (llChildren) changes while
the list is being walked.

Frontends/VBoxManage: 'VBoxManage list usbfilters' doesn't display the
'Port' value of the device filter.

Frontends/VBoxManage: 'VBoxManage add usbfilter' and 'VBoxManage modify
usbfilter' both ignore the --product="Value" option.

Main/VirtualBox.xidl: Improve the IUSBDeviceFilter wording to make
things clearer in the 'VirtualBox Programming Guide and Reference Guide'
aka SDKRef.pdf.

HostDrivers/VBoxUSB/testcase/tstUSBFilter: Include a variety of USB
device filter entries which include the 'int:' prefix to fully exercise
the interval filter parsing code.

Location:
trunk/src/VBox/Main/src-server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r100108 r100772  
    217217
    218218#ifdef VBOX_WITH_USB
    219     USBDeviceFilterList     llChildren;                 // all USB device filters
     219    USBDeviceFilterList     llChildren;                 // all global USB device filters
    220220    USBDeviceFilterList     llUSBDeviceFilters;         // USB device filters in use by the USB proxy service
    221221
     
    535535
    536536#ifdef VBOX_WITH_USB
    537     /* uninit all USB device filters still referenced by clients
    538      * Note! HostUSBDeviceFilter::uninit() will modify llChildren.
    539      * This list should be already empty, but better be safe than sorry. */
    540     while (!m->llChildren.empty())
    541     {
    542         ComObjPtr<HostUSBDeviceFilter> &pChild = m->llChildren.front();
    543         pChild->uninit();
    544         m->llChildren.pop_front();
     537    /* Clean up the list of global USB device filters. */
     538    if (!m->llChildren.empty())
     539    {
     540        /*
     541         * i_removeChild() modifies llChildren so we make a copy to traverse here. The
     542         * removal of a global USB device filter from the llChildren list at this point
     543         * in Host:uninit() will trigger HostUSBDeviceFilter::FinalRelease() ->
     544         * HostUSBDeviceFilter::uninit() which will complete the remainder of the clean-up
     545         * for each global USB device filter and thus we don't need to call
     546         * HostUSBDeviceFilter::uninit() directly here ourselves.
     547         */
     548        USBDeviceFilterList llChildrenCopy(m->llChildren);
     549        for (USBDeviceFilterList::iterator it = llChildrenCopy.begin();
     550            it != llChildrenCopy.end();
     551            ++it)
     552            i_removeChild(*it);
    545553    }
    546554
  • trunk/src/VBox/Main/src-server/USBDeviceFilterImpl.cpp

    r98292 r100772  
    976976    bd.free();
    977977
    978     mParent->i_removeChild(this);
    979 
    980978    unconst(mParent) = NULL;
    981979}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette