-
Notifications
You must be signed in to change notification settings - Fork 35
load DLLs only from safe load list #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
load DLLs only from safe load list #551
Conversation
1353c92
to
899f11d
Compare
c143e63
to
d8c76c3
Compare
6e9275f
to
589bb23
Compare
cmake/helpers.cmake
Outdated
message(STATUS "C_COMPILER_ID: ${C_COMPILER_ID}") | ||
message(STATUS "CXX_COMPILER_ID: ${CXX_COMPILER_ID}") | ||
message(STATUS "CMAKE_C_COMPILER_ID: ${CMAKE_C_COMPILER_ID}") | ||
message(STATUS "CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: These messages potentially can be useful for other CMake generators. Could you move them to some common space, maybe in the main CMakeLists.txt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these were only debug prints - removed
c5421f8
to
5b3b0ed
Compare
5b3b0ed
to
0b04e14
Compare
0b04e14
to
38e126e
Compare
Set /DEPENDENTLOADFLAG to 2000 (LOAD_LIBRARY_SAFE_CURRENT_DIRS) in Windows umf.dll builds (MSVC only).
With this flag, loading a DLL for execution from the current directory is only allowed if it is under a directory in the Safe load list.
In addition, there is a new test written in Power Shell that uses dumpbin.exe to check that this flag is set correctly.
Detailed information about the flag can be found at: https://learn.microsoft.com/en-us/cpp/build/reference/dependentloadflag?view=msvc-170
and: https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa