feat: Enable ubsan on bootstrap nodes.

Not all sanitizers are enabled, but the cheap ones are, making the
bootstrap node quite a bit more secure at a small runtime cost.
This commit is contained in:
iphydf 2023-12-16 10:47:14 +00:00
parent 89b6450d66
commit 90f7496819
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
2 changed files with 6 additions and 5 deletions

View File

@ -1,15 +1,16 @@
########################################################### ###########################################################
# Builder image: we compile the code here (static build) # Builder image: we compile the code here (static build)
FROM alpine:3.18.5 AS build FROM alpine:3.19.0 AS build
RUN ["apk", "--no-cache", "add",\ RUN ["apk", "--no-cache", "add",\
"build-base",\ "clang",\
"cmake",\ "cmake",\
"linux-headers",\ "linux-headers",\
"libconfig-dev",\ "libconfig-dev",\
"libconfig-static",\ "libconfig-static",\
"libsodium-dev",\ "libsodium-dev",\
"libsodium-static",\ "libsodium-static",\
"musl-dev",\
"ninja",\ "ninja",\
"python3"\ "python3"\
] ]
@ -34,9 +35,9 @@ COPY CMakeLists.txt so.version ./
COPY other/bootstrap_daemon/CMakeLists.txt other/bootstrap_daemon/CMakeLists.txt COPY other/bootstrap_daemon/CMakeLists.txt other/bootstrap_daemon/CMakeLists.txt
COPY testing/CMakeLists.txt testing/CMakeLists.txt COPY testing/CMakeLists.txt testing/CMakeLists.txt
RUN cmake -B_build -H. \ RUN CC=clang cmake -B_build -H. \
-GNinja \ -GNinja \
-DCMAKE_C_FLAGS="-DTCP_SERVER_USE_EPOLL -fstack-protector-all -fisolate-erroneous-paths-attribute" \ -DCMAKE_C_FLAGS="-DTCP_SERVER_USE_EPOLL -fsanitize=alignment,return,returns-nonnull-attribute,vla-bound,unreachable,float-cast-overflow,null -fsanitize-trap=all -fstack-protector-all" \
-DCMAKE_UNITY_BUILD=ON \ -DCMAKE_UNITY_BUILD=ON \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DFULLY_STATIC=ON \ -DFULLY_STATIC=ON \

View File

@ -1 +1 @@
5aac1df4d6c1de289e8e9f646d06099c84fd4d9b80d19f45e3254eec3ece2bff /usr/local/bin/tox-bootstrapd 849ec5686eeaea448f4ef99650b016c883e6ea13d5fa2e7b2a344c9275a10431 /usr/local/bin/tox-bootstrapd