Changeset 107605 in vbox
- Timestamp:
- Jan 9, 2025 5:32:38 PM (3 months ago)
- svn:sync-xref-src-repo-rev:
- 166685
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/Graphics/VBoxVideoErr.h
r106061 r107605 74 74 /** @} */ 75 75 76 /** @def RT_BCOPY_UNFORTIFIED 77 * For copying a number of bytes from/to variable length structures. 78 * 79 * This is for working around false positives ("field-spanning writes") in the 80 * linux kernel's fortified memcpy (v5.18+) when copying from/to 81 * RT_FLEXIBLE_ARRAY fields and similar tricks going beyond the strict 82 * definition of a target or source structure. 83 * 84 * @param a_pDst Pointer to the destination buffer. 85 * @param a_pSrc Pointer to the source buffer. 86 * @param a_cbToCopy Number of bytes to copy. 87 * @see @bugref{10209}, @ticketref{21410} 88 */ 89 #if defined(RT_OS_LINUX) && defined(__KERNEL__) 90 /* The definition of RT_BCOPY_UNFORTIFIED macro originally comes from IPRT 91 * header file. However, due to vboxvideo (Linux/DRM module) implementation, 92 * those header files cannot be used directly. Therefore, let's duplicate this 93 * definition here. Following vbox_drv.h header file is a part of 94 * vboxvideo sources, so this code block is only intended to be used from there. */ 95 # include "vbox_drv.h" 96 # if (RTLNX_VER_MIN(5,18,0) || RTLNX_RHEL_RANGE(9,3, 9,99)) \ 97 && !defined(__NO_FORTIFY) \ 98 && defined(__OPTIMIZE__) \ 99 && defined(CONFIG_FORTIFY_SOURCE) 100 # define RT_BCOPY_UNFORTIFIED(a_pDst, a_pSrc, a_cbToCopy) __underlying_memcpy((a_pDst), (a_pSrc), (a_cbToCopy)) 101 # else 102 # define RT_BCOPY_UNFORTIFIED(a_pDst, a_pSrc, a_cbToCopy) memcpy((a_pDst), (a_pSrc), (a_cbToCopy)) 103 # endif 104 #else /* !RT_OS_LINUX && !__KERNEL__ */ 105 # define RT_BCOPY_UNFORTIFIED(a_pDst, a_pSrc, a_cbToCopy) memcpy((a_pDst), (a_pSrc), (a_cbToCopy)) 106 #endif /* !RT_OS_LINUX && !__KERNEL__ */ 107 76 108 #endif /* !VBOX_INCLUDED_Graphics_VBoxVideoErr_h */ -
trunk/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp
r106061 r107605 233 233 if (cbPixels) 234 234 /* Copy the actual pointer data. */ 235 memcpy(p->au8Data, pPixels, cbPixels);235 RT_BCOPY_UNFORTIFIED(p->au8Data, pPixels, cbPixels); 236 236 /* No need to check that the buffer is valid as we have just allocated it. */ 237 237 VBoxHGSMIBufferSubmit(pCtx, p); -
trunk/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp
r106061 r107605 253 253 VBVABUFFER *pVBVA = pCtx->pVBVA; 254 254 uint32_t u32BytesTillBoundary = pVBVA->cbData - offset; 255 uint8_t *dst = &pVBVA->au8Data[ offset];255 uint8_t *dst = &pVBVA->au8Data[0] + offset; 256 256 int32_t i32Diff = cb - u32BytesTillBoundary; 257 257 … … 259 259 { 260 260 /* Chunk will not cross buffer boundary. */ 261 memcpy(dst, p, cb);261 RT_BCOPY_UNFORTIFIED(dst, p, cb); 262 262 } 263 263 else 264 264 { 265 265 /* Chunk crosses buffer boundary. */ 266 memcpy(dst, p, u32BytesTillBoundary);267 memcpy(&pVBVA->au8Data[0], (uint8_t *)p + u32BytesTillBoundary, i32Diff);266 RT_BCOPY_UNFORTIFIED(dst, p, u32BytesTillBoundary); 267 RT_BCOPY_UNFORTIFIED(&pVBVA->au8Data[0], (uint8_t *)p + u32BytesTillBoundary, i32Diff); 268 268 } 269 269 } -
trunk/src/VBox/Additions/linux/drm/Makefile.module.kms
r106061 r107605 45 45 46 46 VBOXMOD_NAME = vboxvideo 47 VBOXMOD_CFLAGS = -DRT_OS_LINUX 47 48 VBOXMOD_OBJS = \ 48 49 hgsmi_base.o \
Note:
See TracChangeset
for help on using the changeset viewer.