VirtualBox

Changeset 101358 in vbox


Ignore:
Timestamp:
Oct 5, 2023 3:24:57 PM (16 months ago)
Author:
vboxsync
Message:

Linux: vboxdrv: Replace SUPDRV_UNFORTIFIED_MEMCPY with RT_BCOPY_UNFORTIFIED, bugref:10209.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp

    r100357 r101358  
    17651765            /* execute */
    17661766            pReq->u.Out.cFunctions = RT_ELEMENTS(g_aFunctions);
    1767             SUPDRV_UNFORTIFIED_MEMCPY(&pReq->u.Out.aFunctions[0], g_aFunctions, sizeof(g_aFunctions));
     1767            RT_BCOPY_UNFORTIFIED(&pReq->u.Out.aFunctions[0], g_aFunctions, sizeof(g_aFunctions));
    17681768            pReq->Hdr.rc = VINF_SUCCESS;
    17691769            return 0;
  • trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h

    r99861 r101358  
    243243#       endif
    244244#   endif
    245 #   if (RTLNX_VER_MIN(5,18,0) || RTLNX_RHEL_RANGE(9,3, 9,99)) && !defined(__NO_FORTIFY) && defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE)
    246 #    define SUPDRV_UNFORTIFIED_MEMCPY __underlying_memcpy
    247 #   endif
    248245#   define SUPR0_EXPORT_SYMBOL(a_Name) EXPORT_SYMBOL(a_Name)
    249246
     
    375372 * @todo Test on servers with many CPUs and sockets. */
    376373# define SUPDRV_USE_TSC_DELTA_THREAD
    377 #endif
    378 
    379 /** @def SUPDRV_UNFORTIFIED_MEMCPY
    380  * Use when copying to variable length structures, it prevents a fortified
    381  * memcpy (linux 5.18+) from complaining about "field-spanning writes".
    382  *
    383  * @see @ticketref{21410}, @bugref{10209}
    384  */
    385 #if !defined(SUPDRV_UNFORTIFIED_MEMCPY) || defined(DOXYGEN_RUNNING) /* (Already defined above if fortified.) */
    386 # define SUPDRV_UNFORTIFIED_MEMCPY memcpy
    387374#endif
    388375
  • trunk/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp

    r100476 r101358  
    999999
    10001000            if (!pUmod)
    1001                 SUPDRV_UNFORTIFIED_MEMCPY(pProv->szName, pszName, cchName + 1);
     1001                RT_BCOPY_UNFORTIFIED(pProv->szName, pszName, cchName + 1);
    10021002            else
    10031003                RTStrPrintf(pProv->szName, cchName + 1, "%s%u", pszName, (uint32_t)pSession->Process);
    1004             SUPDRV_UNFORTIFIED_MEMCPY((void *)pProv->Core.pszModName, pszModName, cchModName + 1);
     1004            RT_BCOPY_UNFORTIFIED((void *)pProv->Core.pszModName, pszModName, cchModName + 1);
    10051005
    10061006            /*
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