VirtualBox

Changeset 70726 in vbox


Ignore:
Timestamp:
Jan 24, 2018 1:58:10 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120473
Message:

Do not allow SUID, SGID or sticky bits on shared folders.
bugref:9047: Clean up Linux guest vboxuser device
Shared folders are primarily intended as a convenient method of file transfer
between guest and host, but not for more complicated things. Therefore the
SUID, SGID or sticky bits do not make sense there, and this change removes
them so that people do not get wrong ideas.
Not strictly related to the vboxuser device, but same general idea.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/shflsvc.h

    r69107 r70726  
    484484    pDst->BirthTime         = pSrc->BirthTime;
    485485    pDst->Attr.fMode        = pSrc->Attr.fMode;
     486    /* Clear bits which we don't pass through for security reasons. */
     487    pDst->Attr.fMode       &= ~(RTFS_UNIX_ISUID | RTFS_UNIX_ISGID | RTFS_UNIX_ISTXT);
    486488    RT_ZERO(pDst->Attr.u);
    487489    switch (pSrc->Attr.enmAdditional)
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r69753 r70726  
    15261526#ifndef RT_OS_WINDOWS
    15271527                /* Don't allow the guest to clear the own bit, otherwise the guest wouldn't be
    1528                  * able to access this file anymore. Only for guests, which set the UNIX mode. */
     1528                 * able to access this file anymore. Only for guests, which set the UNIX mode.
     1529                 * Also, clear bits which we don't pass through for security reasons. */
    15291530                if (fMode & RTFS_UNIX_MASK)
     1531                {
    15301532                    fMode |= RTFS_UNIX_IRUSR;
     1533                    fMode &= ~(RTFS_UNIX_ISUID | RTFS_UNIX_ISGID | RTFS_UNIX_ISTXT);
     1534                }
    15311535#endif
    15321536
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