Skip to content

Warning in _plat__GetUnique() #15

@jenswikl

Description

@jenswikl

There is a warning in _plat__GetUnique():

platform/Unique.c: In function ‘_plat__GetUnique’:
platform/Unique.c:77:51: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]

The array is accessed incorrectly and fixed easily. However, when looking closer at this, there are more issues.

  1. deviceUniqueValue is supposed to be a buffer large enough to hold a TEE_UUID and one more byte, but it's declared as an array of char pointers instead of only char.
  2. The value appears to be used to protect secrets, yet a value accessible by any TA is used.
  3. The function has a very complicated way of copying the data into the buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions