]> git.itanic.dy.fi Git - linux-stable/commit
tpm: Unify the mismatching TPM space buffer sizes
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Thu, 2 Jul 2020 22:55:59 +0000 (01:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:27:01 +0000 (08:27 +0200)
commit32e110843422ba95c7d5be74a5c19b72a77881ca
tree82ba4286c63834aeb6fe3b2f35f3b1ce8aacdf8e
parentec0cf56ee03190bda9477fcc7bffdb92b53d988f
tpm: Unify the mismatching TPM space buffer sizes

commit 6c4e79d99e6f42b79040f1a33cd4018f5425030b upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/tpm/tpm-chip.c
drivers/char/tpm/tpm.h
drivers/char/tpm/tpm2-space.c
drivers/char/tpm/tpmrm-dev.c
include/linux/tpm.h