]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tpm: Unify the mismatching TPM space buffer sizes
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Mon, 31 Aug 2020 18:58:49 +0000 (14:58 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:22:34 +0000 (11:22 +0200)
commit0a221a7442cc3a0da05cf97603ada6dcd6f33beb
treebad500ae62b7345a89ea63125c5c4df00c3cfd76
parent24ae96c55221bca12a01c136833419c4a8eb5250
tpm: Unify the mismatching TPM space buffer sizes

[ Upstream commit 6c4e79d99e6f42b79040f1a33cd4018f5425030b ]

The size of the buffers for storing context's and sessions can vary from
arch to arch as PAGE_SIZE can be anything between 4 kB and 256 kB (the
maximum for PPC64). Define a fixed buffer size set to 16 kB. This should be
enough for most use with three handles (that is how many we allow at the
moment). Parametrize the buffer size while doing this, so that it is easier
to revisit this later on if required.

Cc: stable@vger.kernel.org
Reported-by: Stefan Berger <stefanb@linux.ibm.com>
Fixes: 745b361e989a ("tpm: infrastructure for TPM spaces")
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Tested-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/char/tpm/tpm-chip.c
drivers/char/tpm/tpm.h
drivers/char/tpm/tpm2-space.c
drivers/char/tpm/tpmrm-dev.c