Skip to content

Commit

Permalink
wire up -fsanitize=local-init
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Jan 28, 2018
1 parent 9310bdb commit 9e84af7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,10 @@ ifneq ($(CONFIG_FRAME_WARN),0)
KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
endif

ifdef CONFIG_LOCAL_SANITIZE
KBUILD_CFLAGS += -fsanitize=local-sanitize
endif

# This selects the stack protector compiler flag. Testing it is delayed
# until after .config has been reprocessed, in the prepare-compiler-check
# target.
Expand Down
6 changes: 6 additions & 0 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,12 @@ config CC_OPTIMIZE_FOR_SIZE

endchoice

config LOCAL_SANITIZE
bool "Zero uninitialized locals"
help
Zero-fill uninitialized local variables, other than variable-length
arrays. Requires compiler support.

config SYSCTL
bool

Expand Down

0 comments on commit 9e84af7

Please sign in to comment.