VirtualBox

Changeset 105643 in vbox for trunk


Ignore:
Timestamp:
Aug 9, 2024 9:38:35 PM (5 months ago)
Author:
vboxsync
Message:

IPRT,libs/openssl-3.1.5: Added RTMEMSAFER_F_NO_SUPLIB_ALLOC and made OpenSSL use it. OpenSSL can't use the SUPLIB secure memory allocator, as SUPR3Term may be invoked while the memory is still being used. bugref:10638

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/memsafer.h

    r99739 r105643  
    7676 *          suspend-to-disk. */
    7777#define RTMEMSAFER_F_REQUIRE_NOT_PAGABLE    RT_BIT_32(0)
     78/** Do not use the SUPLib allocator.
     79 * The SUPLib allocator may be terminated earlier than IPRT,
     80 * automatically rendering the allocations inaccessible. */
     81#define RTMEMSAFER_F_NO_SUPLIB_ALLOC        RT_BIT_32(1)
    7882/** Mask of valid bits.  */
    79 #define RTMEMSAFER_F_VALID_MASK             UINT32_C(0x00000001)
     83#define RTMEMSAFER_F_VALID_MASK             UINT32_C(0x00000003)
    8084/** @} */
    8185
  • trunk/src/VBox/Runtime/r3/memsafer-r3.cpp

    r100442 r105643  
    422422             * falling back on the less safe one.
    423423             */
    424             rc = rtMemSaferSupR3AllocPages(pThis);
     424            if (!(fFlags & RTMEMSAFER_F_NO_SUPLIB_ALLOC))
     425                rc = rtMemSaferSupR3AllocPages(pThis);
     426            else
     427                rc = VERR_NO_PAGE_MEMORY;
    425428            if (RT_SUCCESS(rc))
    426429                pThis->enmAllocator = RTMEMSAFERALLOCATOR_SUPR3;
  • trunk/src/libs/openssl-3.1.5/crypto/mem_sec.c

    r104078 r105643  
    175175#else
    176176    RT_NOREF(line);
    177     return RTMemSaferAllocZTag(num, file);
     177    void *pvRet = NULL;
     178    int rc = RTMemSaferAllocZExTag(&pvRet, num, RTMEMSAFER_F_NO_SUPLIB_ALLOC, file);
     179    AssertRCReturn(rc, NULL);
     180    return pvRet;
    178181#endif /* VBOX */
    179182}
     
    190193#else
    191194    RT_NOREF(line);
    192     return RTMemSaferAllocZTag(num, file);
     195    void *pvRet = NULL;
     196    int rc = RTMemSaferAllocZExTag(&pvRet, num, RTMEMSAFER_F_NO_SUPLIB_ALLOC, file);
     197    AssertRCReturn(rc, NULL);
     198    return pvRet;
    193199#endif
    194200}
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