| commit | dc58de2f6d93a181def3bb11b6c4fc541457818f | [log] [tgz] |
|---|---|---|
| author | Jens Wiklander <jens.wiklander@linaro.org> | Fri May 20 07:51:01 2022 +0200 |
| committer | Jérôme Forissier <jerome@forissier.org> | Fri May 20 11:34:02 2022 +0200 |
| tree | 413f7f0ee72c124fe22b5076839daf4d1920d83a | |
| parent | f2a7c942393c6383ac89d9264999cd9c93a70b80 [diff] |
tee-supplicant: close shm fd before freeing memory
The resources of a shm is released in process_free(), this includes the
file descriptor and the memory buffer which was registered. Closing
the file descriptor unregisters the memory buffer.
The memory buffer was, prior to this patch, freed before the file
descriptor was closed. This could lead to another thread reusing this
memory buffer before it has been unregistered. This is normally not a
problem since the buffer will not be read or modified after it has been
freed. However, FF-A mandates that a physical memory isn't registered
already when registering. Son in the case we can have occasional failures.
Fixes: 075c56eebdc9 ("tee_supplicant: add register memory feature")
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
This git contains source code for the non-secure side implementation of the OP-TEE project making up the client library and tee-supplicant.
All official OP-TEE documentation has moved to http://optee.readthedocs.io. The information that used to be here in this git can be found under optee_client.
// OP-TEE core maintainers