]> begriffs open source - freertos/commit
Added checks for xIndex in ThreadLocalStorage APIs
authorGaurav Aggarwal <aggarg@amazon.com>
Fri, 16 Sep 2022 09:47:39 +0000 (15:17 +0530)
committerGaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
Fri, 16 Sep 2022 16:48:35 +0000 (22:18 +0530)
commit7a98bd8d7831fc6a17c0d8d75d3ff8b19a896b21
tree079120ea2e49479c30929c78dda0aac28532d873
parentda73aa6329740bd3bbdc5f35fd310bf4ec1329c9
Added checks for xIndex in ThreadLocalStorage APIs

It was possible for a third party that already independently gained the
ability to execute injected code to read from or write to arbitrary
addresses by passing a negative argument as the xIndex parameter to
pvTaskGetThreadLocalStoragePointer() or
vTaskSetThreadLocalStoragePointer respectively.

This commit adds checks to ensure that passing a negative argument as
the xIndex parameter does not cause arbitrary read or write.

We thank Certibit Consulting, LLC for reporting this issue.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
tasks.c