Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
c6ef55c5
Commit
c6ef55c5
authored
May 20, 2020
by
Sandrine Bailleux
Committed by
TrustedFirmware Code Review
May 20, 2020
Browse files
Merge "Tegra: enable stack protection" into integration
parents
f1a1653c
359acf77
Changes
3
Hide whitespace changes
Inline
Side-by-side
plat/nvidia/tegra/common/tegra_common.mk
View file @
c6ef55c5
#
#
# Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved.
# Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved.
# Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
#
#
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: BSD-3-Clause
#
#
...
@@ -32,3 +33,7 @@ BL31_SOURCES += drivers/delay_timer/delay_timer.c \
...
@@ -32,3 +33,7 @@ BL31_SOURCES += drivers/delay_timer/delay_timer.c \
${COMMON_DIR}
/tegra_platform.c
\
${COMMON_DIR}
/tegra_platform.c
\
${COMMON_DIR}
/tegra_pm.c
\
${COMMON_DIR}
/tegra_pm.c
\
${COMMON_DIR}
/tegra_sip_calls.c
${COMMON_DIR}
/tegra_sip_calls.c
ifneq
($(ENABLE_STACK_PROTECTOR), 0)
BL31_SOURCES
+=
${COMMON_DIR}
/tegra_stack_protector.c
endif
plat/nvidia/tegra/common/tegra_stack_protector.c
0 → 100644
View file @
c6ef55c5
/*
* Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdint.h>
#include <arch_helpers.h>
#include <lib/mmio.h>
#include <plat/common/platform.h>
#include <platform_def.h>
u_register_t
plat_get_stack_protector_canary
(
void
)
{
u_register_t
seed
;
/*
* Ideally, a random number should be returned instead. As the
* platform does not have any random number generator, this is
* better than nothing, but not really secure.
*/
seed
=
mmio_read_32
(
TEGRA_MISC_BASE
+
HARDWARE_REVISION_OFFSET
);
seed
<<=
32
;
seed
|=
mmio_read_32
(
TEGRA_TMRUS_BASE
);
return
seed
^
read_cntpct_el0
();
}
plat/nvidia/tegra/platform.mk
View file @
c6ef55c5
...
@@ -49,6 +49,9 @@ ENABLE_TEGRA_WDT_LEGACY_FIQ_HANDLING ?= 0
...
@@ -49,6 +49,9 @@ ENABLE_TEGRA_WDT_LEGACY_FIQ_HANDLING ?= 0
# Flag to allow relocation of BL32 image to TZDRAM during boot
# Flag to allow relocation of BL32 image to TZDRAM during boot
RELOCATE_BL32_IMAGE
?=
0
RELOCATE_BL32_IMAGE
?=
0
# Enable stack protection
ENABLE_STACK_PROTECTOR
:=
strong
include
plat/nvidia/tegra/common/tegra_common.mk
include
plat/nvidia/tegra/common/tegra_common.mk
include
${SOC_DIR}/platform_${TARGET_SOC}.mk
include
${SOC_DIR}/platform_${TARGET_SOC}.mk
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment