arm-trusted-firmware/include/lib/aarch32
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
..
arch.h xlat v2: Split MMU setup and enable 2018-06-27 11:31:30 +01:00
arch_helpers.h AMU: Add hooks to save/restore AMU context 2018-01-11 14:36:45 +00:00
smcc_helpers.h Rename 'smcc' to 'smccc' 2018-03-21 10:49:27 +00:00
smcc_macros.S Rename 'smcc' to 'smccc' 2018-03-21 10:49:27 +00:00
smccc_helpers.h Fix incorrect pointer conversion in SMC_UUID_RET() 2018-07-03 17:35:08 +02:00
smccc_macros.S Rename 'smcc' to 'smccc' 2018-03-21 10:49:27 +00:00