Changeset 99421 in vbox
- Timestamp:
- Apr 17, 2023 2:38:06 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156875
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.cpp
r98103 r99421 84 84 # define VBOXDRV_IOCTL_ENTRY(pvSession, uIOCtl, pvReqHdr) do { } while (0) 85 85 # define VBOXDRV_IOCTL_RETURN(pvSession, uIOCtl, pvReqHdr, rcRet, rcReq) do { } while (0) 86 #endif87 88 #if defined(RT_OS_LINUX)89 /* In Linux 5.18-rc1, memcpy became a wrapper which does fortify checks90 * before triggering __underlying_memcpy() call. We do not pass these checks here,91 * so bypass them for now. */92 # if RTLNX_VER_MIN(5,18,0) && !defined(__NO_FORTIFY) && defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE)93 # define SUPDRV_MEMCPY __underlying_memcpy94 # else95 # define SUPDRV_MEMCPY memcpy96 # endif97 #else98 # define SUPDRV_MEMCPY memcpy99 86 #endif 100 87 … … 1778 1765 /* execute */ 1779 1766 pReq->u.Out.cFunctions = RT_ELEMENTS(g_aFunctions); 1780 SUPDRV_ MEMCPY(&pReq->u.Out.aFunctions[0], g_aFunctions, sizeof(g_aFunctions));1767 SUPDRV_UNFORTIFIED_MEMCPY(&pReq->u.Out.aFunctions[0], g_aFunctions, sizeof(g_aFunctions)); 1781 1768 pReq->Hdr.rc = VINF_SUCCESS; 1782 1769 return 0; -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r98103 r99421 243 243 # endif 244 244 # endif 245 # if RTLNX_VER_MIN(5,18,0) && !defined(__NO_FORTIFY) && defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE) 246 # define SUPDRV_UNFORTIFIED_MEMCPY __underlying_memcpy 247 # endif 245 248 # define SUPR0_EXPORT_SYMBOL(a_Name) EXPORT_SYMBOL(a_Name) 246 249 … … 372 375 * @todo Test on servers with many CPUs and sockets. */ 373 376 # 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 374 387 #endif 375 388
Note:
See TracChangeset
for help on using the changeset viewer.