VirtualBox

Ignore:
Timestamp:
Apr 17, 2023 2:25:25 PM (21 months ago)
Author:
vboxsync
Message:

linux/vboxsf: s/VBOX_LINUX_MEMCPY/VBSF_UNFORTIFIED_MEMCPY/g + explanation why and when to use. bugref:10209 ticketref:21410

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/sharedfolders/vfsmod.h

    r98869 r99420  
    8080
    8181
    82 /* Simmilar workaround for CONFIG_FORTIFY_SOURCE kernel config option as we have for host drivers.
    83  * In Linux 5.18-rc1, memcpy became a wrapper which does fortify checks
    84  * before triggering __underlying_memcpy() call. We do not pass these checks in some places so
    85  * bypass them for now.  */
     82/** Similar workaround for CONFIG_FORTIFY_SOURCE kernel config option as we
     83 * have in the host drivers.
     84 *
     85 * In Linux 5.18-rc1, memcpy became a wrapper which does fortify checks before
     86 * making a call to __underlying_memcpy().  There are a number of places where
     87 * we trigger the "field-spanning write" fortify check, typically when copying
     88 * to SHFLSTRING structure members as these are actually of variable length but
     89 * we don't (cannot with gcc) use RT_FLEXIBLE_ARRAY_NESTED.
     90 *
     91 * Use this when copying to structures or members with a variable length member.
     92 *
     93 * @see @ticketref{21410}, @bugref{10209}
     94 */
    8695#if RTLNX_VER_MIN(5,18,0) && !defined(__NO_FORTIFY) && defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE)
    87 # define VBOX_LINUX_MEMCPY __underlying_memcpy
     96# define VBSF_UNFORTIFIED_MEMCPY __underlying_memcpy
    8897#else
    89 #define VBOX_LINUX_MEMCPY memcpy
     98# define VBSF_UNFORTIFIED_MEMCPY memcpy
    9099#endif
    91100
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