Skip to content

Commit

Permalink
Enable overflow checks by default and for release builds in the CI
Browse files Browse the repository at this point in the history
Size does not increase much:

       text    data     bss      dec
    7464833 1492128 2301996 11258957 vmlinux (without Rust support)
    7667127 1701060 2301996 11670183 vmlinux (with    Rust support)
    7667127 1709252 2301996 11678375 vmlinux (+ overflow checks)

Performance is harder to measure at the time being, since we do not
have yet proper benchmarks, but we can always disable later.

Suggested-by: Kees Cook <[email protected]>
Suggested-by: Wedson Almeida Filho <[email protected]>
Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
ojeda committed Apr 12, 2021
1 parent 9c1bc39 commit f6fc80f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kernel-arm64-release.config
Original file line number Diff line number Diff line change
Expand Up @@ -1375,7 +1375,7 @@ CONFIG_CC_HAS_SANCOV_TRACE_PC=y
# Rust hacking
#
# CONFIG_RUST_DEBUG_ASSERTIONS is not set
# CONFIG_RUST_OVERFLOW_CHECKS is not set
CONFIG_RUST_OVERFLOW_CHECKS=y
CONFIG_RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C=y
# CONFIG_RUST_OPT_LEVEL_0 is not set
# CONFIG_RUST_OPT_LEVEL_1 is not set
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kernel-ppc64le-release.config
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ CONFIG_CC_HAS_SANCOV_TRACE_PC=y
# Rust hacking
#
# CONFIG_RUST_DEBUG_ASSERTIONS is not set
# CONFIG_RUST_OVERFLOW_CHECKS is not set
CONFIG_RUST_OVERFLOW_CHECKS=y
CONFIG_RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C=y
# CONFIG_RUST_OPT_LEVEL_0 is not set
# CONFIG_RUST_OPT_LEVEL_1 is not set
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kernel-x86_64-release.config
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ CONFIG_CC_HAS_SANCOV_TRACE_PC=y
# Rust hacking
#
# CONFIG_RUST_DEBUG_ASSERTIONS is not set
# CONFIG_RUST_OVERFLOW_CHECKS is not set
CONFIG_RUST_OVERFLOW_CHECKS=y
CONFIG_RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C=y
# CONFIG_RUST_OPT_LEVEL_0 is not set
# CONFIG_RUST_OPT_LEVEL_1 is not set
Expand Down
4 changes: 2 additions & 2 deletions lib/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -2557,7 +2557,7 @@ config RUST_DEBUG_ASSERTIONS

config RUST_OVERFLOW_CHECKS
bool "Overflow checks"
default n
default y
depends on RUST
help
Enables rustc's `-Coverflow-checks` codegen option.
Expand All @@ -2568,7 +2568,7 @@ config RUST_OVERFLOW_CHECKS

Note that this will apply to all Rust code, including `core`.

If unsure, say N.
If unsure, say Y.

choice
prompt "Optimization level"
Expand Down

0 comments on commit f6fc80f

Please sign in to comment.