]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/internal/boring: disable LFS64 interfaces
authorRoland Shoemaker <roland@golang.org>
Sat, 31 Aug 2024 04:11:09 +0000 (21:11 -0700)
committerRoland Shoemaker <bracewell@google.com>
Wed, 4 Sep 2024 19:22:52 +0000 (19:22 +0000)
Comment out the definition in the libcrypto I/O code which enables
the LFS64 interfaces. We don't use any of the I/O bits and pieces, and
it's outside of the FIPS module, and it fixes some breakage in certain
scenarios.

Change-Id: Ie6597813726f94e23780b77d907cc1b9ccef36f0
Reviewed-on: https://go-review.googlesource.com/c/go/+/609976
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Russ Cox <rsc@golang.org>
src/crypto/internal/boring/build-boring.sh
src/crypto/internal/boring/syso/goboringcrypto_linux_amd64.syso
src/crypto/internal/boring/syso/goboringcrypto_linux_arm64.syso

index 5e109653a4fd4fce1211d6f6b8c932ab983880b7..c7dc4f37ad5a1c6d709897e30d0fef1f650f0721 100755 (executable)
@@ -30,6 +30,15 @@ export CGO_ENABLED=0
 # Go toolchain / clang toolchain combinations.
 perl -p -i -e 's/defined.*ELF.*defined.*GNUC.*/$0 \&\& !defined(GOBORING)/' boringssl/crypto/mem.c
 
+# We build all of libcrypto, which includes a bunch of I/O operations that we
+# don't actually care about, since we only really want the BoringCrypto module.
+# In libcrypto, they use the LFS64 interfaces where available in order to
+# traverse files larger than 2GB. In some scenarios this can cause breakage, so
+# we comment out the _FILE_OFFSET_BITS definition which enables the LFS64
+# interfaces. Since this code is outside of the FIPS module, it doesn't affect
+# the certification status of the module. See b/364606941 for additional context.
+perl -p -i -e 's/(#define _FILE_OFFSET_BITS 64)/\/\/ $1/' boringssl/crypto/bio/file.c
+
 # Verbatim instructions from BoringCrypto build docs.
 printf "set(CMAKE_C_COMPILER \"clang\")\nset(CMAKE_CXX_COMPILER \"clang++\")\n" >${HOME}/toolchain
 cd boringssl
index 5ba8919dc14a6b0f78b64c4dc2b850997aeae77a..6d0aeb8335590923ed90cf37c83d039d591f5a42 100644 (file)
Binary files a/src/crypto/internal/boring/syso/goboringcrypto_linux_amd64.syso and b/src/crypto/internal/boring/syso/goboringcrypto_linux_amd64.syso differ
index c0f80c17e43a61cf22c7f38574faaaa6ad2e4bad..23736c82f6bb67137be20bc1e2fca05c226e2e33 100644 (file)
Binary files a/src/crypto/internal/boring/syso/goboringcrypto_linux_arm64.syso and b/src/crypto/internal/boring/syso/goboringcrypto_linux_arm64.syso differ