VirtualBox

Changeset 98846 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Mar 6, 2023 6:56:23 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
156169
Message:

Main/Medium+VirtualBox: If Medium::close() and VirtualBox::i_registerMedium()
are running concurrently they can wrestle over the media tree lock and
end up registering a medium which is in the process of being closed. If
both of the respective threads are operating on the same medium then there
is a window of opportunity when Medium::i_close() drops the media tree
lock before calling Medium::uninit() that VirtualBox::i_registerMedium()
can grab the lock and register the medium. The fix is to check whether
the medium is in the process of being closed inside i_registerMedium()
and bail out if so to maintain media registry consistency. bugref:6447

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/MediumImpl.h

    r98291 r98846  
    117117    MediumVariant_T i_getVariant() const;
    118118    bool i_isHostDrive() const;
     119    bool i_isClosing() const;
    119120    const Utf8Str& i_getLocationFull() const;
    120121    const Utf8Str& i_getFormat() const;
Note: See TracChangeset for help on using the changeset viewer.

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