commit | 1bda66c8cffb52039af43fcd5a26adfca17e37e6 | [log] [tgz] |
---|---|---|
author | zhonghong.pzh <zhonghong.pzh@alibaba-inc.com> | Wed Nov 16 21:01:29 2016 +0800 |
committer | Philip Tricca <philip.b.tricca@intel.com> | Mon Nov 21 11:38:41 2016 -0800 |
tree | 01f262c4f3b829a13e9d89b3cb0f44865cde81f2 | |
parent | 4271dd6a863b9fa721c954367dc6993ec8cad519 [diff] |
resourcemgr: Fix race condition caused by global data / cmdBuffer. The global buffer holding TPM command buffers from clients is populated by server threads outside the global lock / critical section. When two clients send commands at the same time the server thread servicing each client will be writing to this global buffer at the same time and possibly overwriting eachother. This patch solves this problem by making the buffer used by server threads local to the thread. An alternative approach would be to increase the scope of the global lock / critical section to include all accesses to the global buffer. In this specific case though, doing so would effectively make the resourcemgr single threaded as no server threads would be able to receive any client data until the lock was available. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
This stack consists of the following layers from top to bottom:
Since the FAPI and ESAPI haven't been implemented yet, this repository only contains the SAPI and layers below it, plus a test application for exercising the SAPI.
The test application, tpmclient, tests many of the commands against the TPM 2.0 simulator. The tpmclient application can be altered and used as a sandbox to test and develop any TPM 2.0 command sequences, and provides an excellent development and learning vehicle.
TPM 2.0 specifications can be found at Trusted Computing Group.