Platform: Check NV counter read length
The description of tfm_platform_nv_counter_read() says that it is used
to read a single NV counter, but the API accepts a size in bytes and the
implementation will currently pass that through. This means that it can
be used to read multiple NV counters, while also possibly overwriting
platform partition data because platform_sp_nv_read_psa_api() reads it
into an array of NV_COUNTER_SIZE bytes.
Note that the sample implementation of tfm_plat_read_nv_counter() does
check the size, but that's much later and the check would be better in
the core partition code.
Change-Id: I7898a863a9f1a4ee47d3fa1cf8db5dab5ac4d531
Signed-off-by: Kostiantyn Tkachov <kostiantyn.tkachov@infineon.com>
Signed-off-by: Chris Brand <chris.brand@cypress.com>
1 file changed