mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
x86: unify stackprotector features
streamline the stackprotector features under a single option and make the stronger feature the one accessible. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
960a672bd9
commit
113c5413cf
1 changed files with 9 additions and 13 deletions
|
@ -1140,13 +1140,17 @@ config SECCOMP
|
||||||
|
|
||||||
If unsure, say Y. Only embedded should say N here.
|
If unsure, say Y. Only embedded should say N here.
|
||||||
|
|
||||||
|
config CC_STACKPROTECTOR_ALL
|
||||||
|
bool
|
||||||
|
|
||||||
config CC_STACKPROTECTOR
|
config CC_STACKPROTECTOR
|
||||||
bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
|
bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
|
||||||
depends on X86_64
|
depends on X86_64
|
||||||
|
select CC_STACKPROTECTOR_ALL
|
||||||
help
|
help
|
||||||
This option turns on the -fstack-protector GCC feature. This
|
This option turns on the -fstack-protector GCC feature. This
|
||||||
feature puts, at the beginning of critical functions, a canary
|
feature puts, at the beginning of functions, a canary value on
|
||||||
value on the stack just before the return address, and validates
|
the stack just before the return address, and validates
|
||||||
the value just before actually returning. Stack based buffer
|
the value just before actually returning. Stack based buffer
|
||||||
overflows (that need to overwrite this return address) now also
|
overflows (that need to overwrite this return address) now also
|
||||||
overwrite the canary, which gets detected and the attack is then
|
overwrite the canary, which gets detected and the attack is then
|
||||||
|
@ -1154,16 +1158,8 @@ config CC_STACKPROTECTOR
|
||||||
|
|
||||||
This feature requires gcc version 4.2 or above, or a distribution
|
This feature requires gcc version 4.2 or above, or a distribution
|
||||||
gcc with the feature backported. Older versions are automatically
|
gcc with the feature backported. Older versions are automatically
|
||||||
detected and for those versions, this configuration option is ignored.
|
detected and for those versions, this configuration option is
|
||||||
|
ignored. (and a warning is printed during bootup)
|
||||||
config CC_STACKPROTECTOR_ALL
|
|
||||||
bool "Use stack-protector for all functions"
|
|
||||||
depends on CC_STACKPROTECTOR
|
|
||||||
default y
|
|
||||||
help
|
|
||||||
Normally, GCC only inserts the canary value protection for
|
|
||||||
functions that use large-ish on-stack buffers. By enabling
|
|
||||||
this option, GCC will be asked to do this for ALL functions.
|
|
||||||
|
|
||||||
source kernel/Kconfig.hz
|
source kernel/Kconfig.hz
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue