diff options
author | Paul Beesley <paul.beesley@arm.com> | 2019-04-08 15:24:43 +0100 |
---|---|---|
committer | Paul Beesley <paul.beesley@arm.com> | 2019-04-09 11:10:09 +0100 |
commit | 00e51ca312cdf64554ac6c393c7cdf06b1c7a7a7 (patch) | |
tree | a0f617338e8c24fa6ee1f6aecbb71feb0103355e /services | |
parent | 01e7e0cadcfee14cc8ce6846cbcab6182fbf2cea (diff) |
services/spm: Fix service UUID lookup
The spm_sp_get_by_uuid() function is used to look up the secure
partition that provides a given service.
Within this function, memcmp() is used to compare the service
UUIDs but it uses the size of the rdsvc->uuid pointer instead of
the size of its content (missing dereference). This means that only
a partial comparison is performed as UUIDs are 128 bits in length and
rdsvc->uuid is a uint32_t typed pointer.
Instead, use the size of the array pointed to by the svc_uuid parameter,
which will be the full 128 bits, for the comparison.
Change-Id: I258fb0cca3bf19f97b8f2a4c133981647cd050e4
Signed-off-by: Paul Beesley <paul.beesley@arm.com>
Diffstat (limited to 'services')
-rw-r--r-- | services/std_svc/spm/spm_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/std_svc/spm/spm_main.c b/services/std_svc/spm/spm_main.c index aa7bd04b..3a63f1c6 100644 --- a/services/std_svc/spm/spm_main.c +++ b/services/std_svc/spm/spm_main.c @@ -104,7 +104,7 @@ sp_context_t *spm_sp_get_by_uuid(const uint32_t (*svc_uuid)[4]) rdsvc = rdsvc->next) { uint32_t *rd_uuid = (uint32_t *)(rdsvc->uuid); - if (memcmp(rd_uuid, svc_uuid, sizeof(rd_uuid)) == 0) { + if (memcmp(rd_uuid, svc_uuid, sizeof(*svc_uuid)) == 0) { return sp_ctx; } } |