diff options
author | Alvin Chang <alvinga@andestech.com> | 2025-07-03 23:19:57 +0800 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2025-07-20 20:54:34 +0530 |
commit | edfbc1285dd9ac624665fe9fa5de26437d61c1eb (patch) | |
tree | 42840145378dd5c8a2d5195401e9a42f6eeb2dc4 /lib/utils/cppc/fdt_cppc_rpmi.c | |
parent | ea5abd1f5e33ed3afedc92686ec8bfd00bc49235 (diff) | |
download | opensbi-edfbc1285dd9ac624665fe9fa5de26437d61c1eb.zip opensbi-edfbc1285dd9ac624665fe9fa5de26437d61c1eb.tar.gz opensbi-edfbc1285dd9ac624665fe9fa5de26437d61c1eb.tar.bz2 |
firmware: Initial compiler built-in stack protector support
Add __stack_chk_fail() and __stack_chk_guard variable which are used by
compiler built-in stack protector.
This patch just try to support stack-protector so the value of the stack
guard variable is simply fixed for now. It could be improved by
deriving from a random number generator, such as Zkr extension or any
platform-specific random number sources.
Introduce three configurations for the stack protector:
1. CONFIG_STACK_PROTECTOR to enable the stack protector feature by
providing "-fstack-protector" compiler flag
2. CONFIG_STACK_PROTECTOR_STRONG to provide "-fstack-protector-strong"
3. CONFIG_STACK_PROTECTOR_ALL to provide "-fstack-protector-all"
Instead of fixing the compiler flag of stack-protector feature as
"-fstack-protector", we derive it from the introduced Kconfig
configurations. The compiler flag "stack-protector-cflags-y" is defined
as Makefile "immediately expanded variables" with ":=". Thus, the
stronger configuration of the stack protector can overwrite the
preceding one.
Signed-off-by: Alvin Chang <alvinga@andestech.com>
Reviewed-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20250703151957.2545958-3-alvinga@andestech.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils/cppc/fdt_cppc_rpmi.c')
0 files changed, 0 insertions, 0 deletions