arm-trusted-firmware/include/lib
Sandrine Bailleux 43b8fa8e98 Fix incorrect pointer conversion in SMC_UUID_RET()
Casting a pointer to a struct uuid into a pointer to uint32_t may
result in a pointer that is not correctly aligned, which constitutes
an undefined behaviour. In the case of TF, this also generates a data
abort because alignment fault checking is enabled (through the SCTLR.A
bit).

This patch modifies the SMC_UUID_RET() macro to read the uuid
structure without any pointer aliasing. A helper function then
combines every set of 4 bytes into a 32-bit value suitable to be
returned through the x0-x3 registers.

This fixes a violation of MISRA rule 11.3.

Change-Id: I53ee73bb4cb332f4d8286055ceceb6f347caa080
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
2018-07-03 17:35:08 +02:00
..
aarch32 Fix incorrect pointer conversion in SMC_UUID_RET() 2018-07-03 17:35:08 +02:00
aarch64 Fix incorrect pointer conversion in SMC_UUID_RET() 2018-07-03 17:35:08 +02:00
cpus Implement dynamic mitigation for CVE-2018-3639 on Cortex-A76 2018-06-08 11:46:31 +01:00
el3_runtime SDEI: Ensure SDEI handler executes with CVE-2018-3639 mitigation enabled 2018-06-08 11:46:31 +01:00
extensions RAS: Allow individual interrupt registration 2018-05-04 08:33:17 +01:00
libfdt libfdt: Replace v1.4.1 by v1.4.2 2017-01-16 17:26:04 +00:00
pmf lib: fix switch statements to comply with MISRA rules 2018-03-26 12:43:05 +01:00
psci Update PSCI version to 1.1 2017-10-13 12:39:08 +01:00
stdlib types: use int-ll64 for both aarch32 and aarch64 2018-04-27 18:35:02 +09:00
xlat_tables xlat v2: Split code into separate files 2018-07-03 13:41:07 +01:00
zlib zlib: add gunzip() support 2018-02-02 00:18:54 +09:00
bakery_lock.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
cassert.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
coreboot.h Add platform-independent coreboot support library 2018-01-19 15:21:12 -08:00
mmio.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
optee_utils.h Add Trusted OS extra image parsing support for ARM standard platforms 2017-08-09 18:06:05 +08:00
runtime_instr.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
semihosting.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
smcc.h Rename 'smcc' to 'smccc' 2018-03-21 10:49:27 +00:00
smccc.h Fix incorrect pointer conversion in SMC_UUID_RET() 2018-07-03 17:35:08 +02:00
smccc_v1.h Add support for the SMC Calling Convention 2.0 2018-04-23 15:43:29 +01:00
smccc_v2.h Add support for the SMC Calling Convention 2.0 2018-04-23 15:43:29 +01:00
spinlock.h Use SPDX license identifiers 2017-05-03 09:39:28 +01:00
utils.h ARM platforms: Demonstrate mem_protect from el3_runtime 2018-05-01 15:25:25 +01:00
utils_def.h xlat v2: Split MMU setup and enable 2018-06-27 11:31:30 +01:00