提交 064427fc 编写于 作者: Z Zbigniew Bodek 提交者: Wojciech Zmuda WX948747

Allow enabling SSP for platforms that don't randomize canary

HiSilicon-specific randomization routine for the __stack_chk_guard
should not be called for other platforms that don't implement
this function.
Fix build for targets that don't link with HiSi libraries when
stack smashing protector is enabled.
Signed-off-by: NZbigniew Bodek <zbigniew.bodek@huawei.com>
Change-Id: I1843c897b32991fddc3d0ba362d188c4a621d052
上级 4188734e
......@@ -157,11 +157,14 @@
@ Description: Stack-Protector Init
__stack_chk_guard_setup:
PUSH {FP, LR}
#if defined(LOSCFG_PLATFORM_HI3516DV300) || defined(LOSCFG_PLATFORM_HI3518EV300)
/* Randomize __stack_chk_quard using platform-specific function. */
BL OsRandomStackGuard
LDR R1, =__stack_chk_guard
MOV R3, R0
ORR R2, R3, #0X80000000
STR R2, [R1]
#endif
POP {FP, PC}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册