Skip to content

Commit d02569c

Browse files
committed
Merged PR 10544147: Remove SymCryptWipeKnownSize from Windows module exports
This change fixes a build break in the CMake pipeline by removing `SymCryptWipeKnownSize` from the exports for both the kernel and user mode modules. Since `SymCryptWipeKnownSize` is marked `FORCEINLINE`, it should be inlined everywhere and thus cannot be exported. (It's not clear why this didn't break the Windows Undocked Pipeline build--probably some difference in flags.) In the future we'll remove this function from the Linux module exports as well. We have already documented that as an upcoming breaking change in `doc/breaking_changes.md`. Since the Windows modules haven't shipped yet, we don't have to consider this a breaking change for those modules. Tested: unit tests with user mode + kernel mode dynamic modules
1 parent f3a6c3d commit d02569c

File tree

6 files changed

+13
-17
lines changed

6 files changed

+13
-17
lines changed

lib/CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,14 @@ if(WIN32 AND SYMCRYPT_USE_ASM)
245245
amd64/sha256ymm_asm-masm.asm
246246
amd64/sha512ymm_asm-masm.asm
247247
amd64/sha512ymm_avx512vl_asm-masm.asm
248-
PROPERTY LANGUAGE ASM_MASM)
248+
PROPERTIES LANGUAGE ASM_MASM)
249249

250250
elseif(SYMCRYPT_TARGET_ARCH MATCHES "X86")
251251
process_cppasm(i386/aesasm.cppasm masm x86)
252252
process_cppasm(i386/fdef_asm.cppasm masm x86)
253253

254+
set(CMAKE_ASMMASM_FLAGS "${CMAKE_ASMMASM_FLAGS} /safeseh")
255+
254256
list(APPEND SOURCES_COMMON
255257
i386/aesasm-masm.asm
256258
i386/fdef_asm-masm.asm
@@ -259,7 +261,9 @@ if(WIN32 AND SYMCRYPT_USE_ASM)
259261
i386/aesasm-masm.asm
260262
i386/fdef_asm-masm.asm
261263
i386/wipe.asm
262-
PROPERTY LANGUAGE ASM_MASM)
264+
PROPERTIES
265+
LANGUAGE ASM_MASM
266+
COMPILE_OPTIONS "/safeseh")
263267
set_source_files_properties(
264268
i386/fdef_asm-masm.asm PROPERTIES INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/i386)
265269
endif()
@@ -295,7 +299,7 @@ elseif(SYMCRYPT_USE_ASM) # Linux
295299
amd64/sha256ymm_asm-gas.asm
296300
amd64/sha512ymm_asm-gas.asm
297301
amd64/sha512ymm_avx512vl_asm-gas.asm
298-
PROPERTY LANGUAGE ASM)
302+
PROPERTIES LANGUAGE ASM)
299303
elseif(SYMCRYPT_TARGET_ARCH STREQUAL "ARM64")
300304
process_symcryptasm(arm64/fdef_asm.symcryptasm gas arm64 aapcs64)
301305
process_symcryptasm(arm64/fdef369_asm.symcryptasm gas arm64 aapcs64)
@@ -309,7 +313,7 @@ elseif(SYMCRYPT_USE_ASM) # Linux
309313
arm64/fdef_asm-gas.asm
310314
arm64/fdef369_asm-gas.asm
311315
arm64/wipe-gas.asm
312-
PROPERTY LANGUAGE ASM)
316+
PROPERTIES LANGUAGE ASM)
313317
elseif(SYMCRYPT_TARGET_ARCH STREQUAL "ARM")
314318
process_symcryptasm(arm/aesasm.symcryptasm gas arm aapcs32)
315319
process_symcryptasm(arm/fdef_asm.symcryptasm gas arm aapcs32)
@@ -323,7 +327,7 @@ elseif(SYMCRYPT_USE_ASM) # Linux
323327
arm/aesasm-gas.asm
324328
arm/fdef_asm-gas.asm
325329
arm/wipe-gas.asm
326-
PROPERTY LANGUAGE ASM)
330+
PROPERTIES LANGUAGE ASM)
327331
set_source_files_properties(
328332
arm/fdef_asm-gas.asm PROPERTIES INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/arm)
329333
endif()

modules/windows/kernel/symcryptk.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,6 @@ EXPORTS
510510
; SymCryptUint64Bitsize
511511
; SymCryptUint64Bytesize
512512
; SymCryptWipe
513-
; SymCryptWipeKnownSize
514513
; SymCryptXorBytes
515514
; SymCryptXtsAesDecrypt
516515
; SymCryptXtsAesDecryptWith128bTweak

modules/windows/user/symcrypt.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ EXPORTS
513513
SymCryptUint64Bitsize
514514
SymCryptUint64Bytesize
515515
SymCryptWipe
516-
SymCryptWipeKnownSize
517516
SymCryptXorBytes
518517
SymCryptXtsAesDecrypt
519518
SymCryptXtsAesDecryptWith128bTweak

unittest/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ if(NOT WIN32)
7474
create_resource_h("${DATA_FILES}")
7575
endif()
7676

77-
if(WIN32 AND SYMCRYPT_TARGET_ARCH MATCHES "X86")
78-
# Required on x86 to avoid "error LNK2026: module unsafe for SAFESEH image."
79-
add_link_options(/SAFESEH:NO)
80-
endif()
81-
82-
8377
if(SYMCRYPT_TEST_WITH_OPENSSL)
8478
include(${CMAKE_SOURCE_DIR}/cmake-configs/OpenSSL.cmake)
8579
include_directories(${OPENSSL_INCLUDE_DIR})

unittest/inc/SymCryptKernelTestModule_FuncList.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ FUNCTION(SymCryptUint32Bytesize)
493493
FUNCTION(SymCryptUint64Bitsize)
494494
FUNCTION(SymCryptUint64Bytesize)
495495
FUNCTION(SymCryptWipe)
496-
FUNCTION(SymCryptWipeKnownSize)
497496
FUNCTION(SymCryptXorBytes)
498497
FUNCTION(SymCryptXtsAesDecrypt)
499498
FUNCTION(SymCryptXtsAesDecryptWith128bTweak)

unittest/lib/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,16 @@ endif()
7171
if(WIN32 AND SYMCRYPT_USE_ASM)
7272
if(SYMCRYPT_TARGET_ARCH MATCHES "AMD64")
7373
list(APPEND SOURCES amd64/savevectors.asm)
74-
set_source_files_properties(amd64/savevectors.asm PROPERTY LANGUAGE ASM_MASM)
74+
set_source_files_properties(amd64/savevectors.asm PROPERTIES LANGUAGE ASM_MASM)
7575
elseif(SYMCRYPT_TARGET_ARCH MATCHES "X86")
7676
list(APPEND SOURCES i386/savevectors.asm)
77-
set_source_files_properties(i386/savevectors.asm PROPERTY LANGUAGE ASM_MASM)
77+
set_source_files_properties(i386/savevectors.asm PROPERTIES LANGUAGE ASM_MASM)
78+
set_source_files_properties(i386/savevectors.asm PROPERTIES COMPILE_OPTIONS "/safeseh")
7879
endif()
7980
elseif(SYMCRYPT_USE_ASM) # Linux
8081
if(SYMCRYPT_TARGET_ARCH MATCHES "AMD64")
8182
list(APPEND SOURCES amd64/saveymm-gas.asm)
82-
set_source_files_properties(amd64/saveymm-gas.asm PROPERTY LANGUAGE ASM)
83+
set_source_files_properties(amd64/saveymm-gas.asm PROPERTIES LANGUAGE ASM)
8384
endif()
8485
endif()
8586

0 commit comments

Comments
 (0)