]> git.baikalelectronics.ru Git - arm-tf.git/commit
sp_min: Implement workaround for CVE-2017-5715
authorDimitris Papastamos <dimitris.papastamos@arm.com>
Tue, 2 Jan 2018 11:37:02 +0000 (11:37 +0000)
committerDimitris Papastamos <dimitris.papastamos@arm.com>
Thu, 18 Jan 2018 10:36:18 +0000 (10:36 +0000)
commit7343505d9661ab6481e99fa96d60f2a8447a4565
tree5524a39d9125b61a8fb578622430382b3272a845
parenteec9e7d1e6ebb4c7e12687a55ae27ba9e481f7d9
sp_min: Implement workaround for CVE-2017-5715

This patch introduces two workarounds for ARMv7 systems.  The
workarounds need to be applied prior to any `branch` instruction in
secure world.  This is achieved using a custom vector table where each
entry is an `add sp, sp, #1` instruction.

On entry to monitor mode, once the sequence of `ADD` instructions is
executed, the branch target buffer (BTB) is invalidated.  The bottom
bits of `SP` are then used to decode the exception entry type.

A side effect of this change is that the exception vectors are
installed before the CPU specific reset function.  This is now
consistent with how it is done on AArch64.

Note, on AArch32 systems, the exception vectors are typically tightly
integrated with the secure payload (e.g. the Trusted OS).  This
workaround will need porting to each secure payload that requires it.

The patch to modify the AArch32 per-cpu vbar to the corresponding
workaround vector table according to the CPU type will be done in a
later patch.

Change-Id: I5786872497d359e496ebe0757e8017fa98f753fa
Signed-off-by: Dimitris Papastamos <dimitris.papastamos@arm.com>
bl32/sp_min/aarch32/entrypoint.S
bl32/sp_min/sp_min.mk
bl32/sp_min/workaround_cve_2017_5715_bpiall.S [new file with mode: 0644]
bl32/sp_min/workaround_cve_2017_5715_icache_inv.S [new file with mode: 0644]
include/common/aarch32/el3_common_macros.S
include/lib/aarch32/arch.h
include/lib/aarch32/smcc_helpers.h