Skip to content

Commit f6fc80f

Browse files
committed
Enable overflow checks by default and for release builds in the CI
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]>
1 parent 9c1bc39 commit f6fc80f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

.github/workflows/kernel-arm64-release.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ CONFIG_CC_HAS_SANCOV_TRACE_PC=y
13751375
# Rust hacking
13761376
#
13771377
# CONFIG_RUST_DEBUG_ASSERTIONS is not set
1378-
# CONFIG_RUST_OVERFLOW_CHECKS is not set
1378+
CONFIG_RUST_OVERFLOW_CHECKS=y
13791379
CONFIG_RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C=y
13801380
# CONFIG_RUST_OPT_LEVEL_0 is not set
13811381
# CONFIG_RUST_OPT_LEVEL_1 is not set

.github/workflows/kernel-ppc64le-release.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ CONFIG_CC_HAS_SANCOV_TRACE_PC=y
14831483
# Rust hacking
14841484
#
14851485
# CONFIG_RUST_DEBUG_ASSERTIONS is not set
1486-
# CONFIG_RUST_OVERFLOW_CHECKS is not set
1486+
CONFIG_RUST_OVERFLOW_CHECKS=y
14871487
CONFIG_RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C=y
14881488
# CONFIG_RUST_OPT_LEVEL_0 is not set
14891489
# CONFIG_RUST_OPT_LEVEL_1 is not set

.github/workflows/kernel-x86_64-release.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ CONFIG_CC_HAS_SANCOV_TRACE_PC=y
14251425
# Rust hacking
14261426
#
14271427
# CONFIG_RUST_DEBUG_ASSERTIONS is not set
1428-
# CONFIG_RUST_OVERFLOW_CHECKS is not set
1428+
CONFIG_RUST_OVERFLOW_CHECKS=y
14291429
CONFIG_RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C=y
14301430
# CONFIG_RUST_OPT_LEVEL_0 is not set
14311431
# CONFIG_RUST_OPT_LEVEL_1 is not set

lib/Kconfig.debug

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2557,7 +2557,7 @@ config RUST_DEBUG_ASSERTIONS
25572557

25582558
config RUST_OVERFLOW_CHECKS
25592559
bool "Overflow checks"
2560-
default n
2560+
default y
25612561
depends on RUST
25622562
help
25632563
Enables rustc's `-Coverflow-checks` codegen option.
@@ -2568,7 +2568,7 @@ config RUST_OVERFLOW_CHECKS
25682568

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

2571-
If unsure, say N.
2571+
If unsure, say Y.
25722572

25732573
choice
25742574
prompt "Optimization level"

0 commit comments

Comments
 (0)