Skip to content

Commit 007dcd8

Browse files
committed
Add extra security check flags on Linux, remove unneeded include.
1 parent 65fa235 commit 007dcd8

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.github/workflows/buildsCI.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,10 @@ jobs:
330330
331331
- name: Build
332332
shell: bash
333+
# Adding -DENABLE_SECURITY_FLAGS=true here to also check examples and tools. See RSDSO-RSDSO-20629.
333334
run: |
334335
cd build
335-
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_RUN_CONFIG}} -DBUILD_SHARED_LIBS=false -DBUILD_EXAMPLES=true -DBUILD_TOOLS=true -DCHECK_FOR_UPDATES=true -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3)
336+
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_RUN_CONFIG}} -DBUILD_SHARED_LIBS=false -DBUILD_EXAMPLES=true -DBUILD_TOOLS=true -DCHECK_FOR_UPDATES=true -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3) -DENABLE_SECURITY_FLAGS=true
336337
cmake --build . -- -j4
337338
338339
@@ -512,9 +513,10 @@ jobs:
512513
513514
- name: Build
514515
shell: bash
516+
# Adding -DENABLE_SECURITY_FLAGS=true here to also check DDS. See RSDSO-RSDSO-20629.
515517
run: |
516518
cd build
517-
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_RUN_CONFIG}} -DBUILD_SHARED_LIBS=true -DBUILD_EXAMPLES=false -DBUILD_TOOLS=false -DBUILD_UNIT_TESTS=false -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=true -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3)
519+
cmake .. -DCMAKE_BUILD_TYPE=${{env.LRS_RUN_CONFIG}} -DBUILD_SHARED_LIBS=true -DBUILD_EXAMPLES=false -DBUILD_TOOLS=false -DBUILD_UNIT_TESTS=false -DCHECK_FOR_UPDATES=false -DBUILD_WITH_DDS=true -DBUILD_PYTHON_BINDINGS=true -DPYTHON_EXECUTABLE=$(which python3) -DENABLE_SECURITY_FLAGS=true
518520
cmake --build . -- -j4
519521
520522
- name: LibCI

CMake/unix_config.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ macro(os_set_flags)
6464
# -z noexecstack: Marks the stack as non-executable to prevent certain types of attacks.
6565
# -Wl,-z,relro,-z,now: Enables read-only relocations and immediate binding for security.
6666
# -fstack-protector-strong: Provides stronger stack protection than -fstack-protector.
67+
# -Wdate-time: Warns about the use of date/time macros that can affect reproducibility.
6768

6869
# Linker flags
6970
# -pie: Produces position-independent executables during the linking phase.
7071

7172
# see https://readthedocs.intel.com/SecureCodingStandards/2023.Q2.0/compiler/c-cpp/ for more details
73+
# see also RSDSO-20629 for some extra flags
7274

7375
set(SECURITY_COMPILER_FLAGS "-Wformat -Wformat-security -fPIC -fstack-protector -Wno-error=stringop-overflow")
7476

@@ -81,7 +83,7 @@ macro(os_set_flags)
8183
message(STATUS "Configuring for Debug build")
8284
else() # Release, RelWithDebInfo, or multi configuration generator is being used (aka not specifing build type, or building with VS)
8385
message(STATUS "Configuring for Release build")
84-
set(SECURITY_COMPILER_FLAGS "${SECURITY_COMPILER_FLAGS} -Werror -z noexecstack -Wl,-z,relro,-z,now -fstack-protector-strong")
86+
set(SECURITY_COMPILER_FLAGS "${SECURITY_COMPILER_FLAGS} -Werror -z noexecstack -Wl,-z,relro,-z,now -fstack-protector-strong -Wdate-time")
8587
endif()
8688

8789
push_security_flags()

src/gl/m420-to-rgb-gl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <iostream>
1919

2020
#include <chrono>
21-
#include <strstream>
2221

2322
#include "synthetic-stream-gl.h"
2423

0 commit comments

Comments
 (0)