]> git.ipfire.org Git - thirdparty/strongswan.git/commit
libtpmtss: Protect TPM 2.0 context by mutex
authorkrinfels <kornel@duleba.com.pl>
Wed, 26 Jun 2019 13:32:29 +0000 (15:32 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 26 Jun 2019 14:30:01 +0000 (16:30 +0200)
commit4b2588502516d828f97c277aa1b55f7119acf03f
tree30d9d7fa02e900aefc75985f6bce4ef8953722b2
parent07a6e59b1cd2ce1bc66e716dc4caebe120c365b7
libtpmtss: Protect TPM 2.0 context by mutex

Each private key object created to access a key residing in a TPM 2.0
creates a context structure used for communication with the TSS.
When multiple IKE SAs are established at the same time and using the
same private key, it is possible to make concurrent calls to the
TSS with the same context which results in multiple threads writing
to the same place in memory causing undefined behaviour.

Fix this by protecting calls to the TSS with a mutex unique for
each TPM 2.0 context object.
src/libtpmtss/tpm_tss_tss2_v1.c
src/libtpmtss/tpm_tss_tss2_v2.c