summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpmrm-dev.c
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2020-07-03 01:55:59 +0300
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2020-07-24 09:26:23 +0300
commit6c4e79d99e6f42b79040f1a33cd4018f5425030b (patch)
tree2837a1dfd03cbcc0d543e46c3531197022ae1b18 /drivers/char/tpm/tpmrm-dev.c
parent7f3d176f5f7e3f0477bf82df0f600fcddcdcc4e4 (diff)
downloadlinux-6c4e79d99e6f42b79040f1a33cd4018f5425030b.tar.bz2
tpm: Unify the mismatching TPM space buffer sizes
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>
Diffstat (limited to 'drivers/char/tpm/tpmrm-dev.c')
-rw-r--r--drivers/char/tpm/tpmrm-dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpmrm-dev.c b/drivers/char/tpm/tpmrm-dev.c
index 7a0a7051a06f..eef0fb06ea83 100644
--- a/drivers/char/tpm/tpmrm-dev.c
+++ b/drivers/char/tpm/tpmrm-dev.c
@@ -21,7 +21,7 @@ static int tpmrm_open(struct inode *inode, struct file *file)
if (priv == NULL)
return -ENOMEM;
- rc = tpm2_init_space(&priv->space);
+ rc = tpm2_init_space(&priv->space, TPM2_SPACE_BUFFER_SIZE);
if (rc) {
kfree(priv);
return -ENOMEM;