linux/drivers/char/tpm
Jarkko Sakkinen e13cd21ffd tpm: Wrap the buffer from the caller to tpm_buf in tpm_send()
tpm_send() does not give anymore the result back to the caller. This
would require another memcpy(), which kind of tells that the whole
approach is somewhat broken. Instead, as Mimi suggested, this commit
just wraps the data to the tpm_buf, and thus the result will not go to
the garbage.

Obviously this assumes from the caller that it passes large enough
buffer, which makes the whole API somewhat broken because it could be
different size than @buflen but since trusted keys is the only module
using this API right now I think that this fix is sufficient for the
moment.

In the near future the plan is to replace the parameters with a tpm_buf
created by the caller.

Reported-by: Mimi Zohar <zohar@linux.ibm.com>
Suggested-by: Mimi Zohar <zohar@linux.ibm.com>
Cc: stable@vger.kernel.org
Fixes: 412eb58558 ("use tpm_buf in tpm_transmit_cmd() as the IO parameter")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
2019-09-25 02:43:57 +03:00
..
eventlog tpm: Don't duplicate events from the final event log in the TCG2 log 2019-06-24 23:57:50 +03:00
st33zp24
Kconfig tpm/tpm_ftpm_tee: A driver for firmware TPM running inside TEE 2019-09-02 17:08:35 +03:00
Makefile tpm/tpm_ftpm_tee: A driver for firmware TPM running inside TEE 2019-09-02 17:08:35 +03:00
tpm1-cmd.c tpm: tpm_ibm_vtpm: Fix unallocated banks 2019-08-05 00:55:00 +03:00
tpm2-cmd.c tpm: tpm_ibm_vtpm: Fix unallocated banks 2019-08-05 00:55:00 +03:00
tpm2-space.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_atmel.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_atmel.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_crb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_ftpm_tee.c tpm/tpm_ftpm_tee: A driver for firmware TPM running inside TEE 2019-09-02 17:08:35 +03:00
tpm_ftpm_tee.h tpm/tpm_ftpm_tee: A driver for firmware TPM running inside TEE 2019-09-02 17:08:35 +03:00
tpm_i2c_atmel.c
tpm_i2c_infineon.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_i2c_nuvoton.c
tpm_ibmvtpm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_ibmvtpm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_infineon.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_nsc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_ppi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_tis_core.c tpm_tis_core: Set TPM_CHIP_FLAG_IRQ before probing for interrupts 2019-09-02 17:08:35 +03:00
tpm_tis_core.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_tis_spi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_tis.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm_vtpm_proxy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm-chip.c tpm: Remove a deprecated comments about implicit sysfs locking 2019-09-02 17:08:35 +03:00
tpm-dev-common.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm-dev.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
tpm-dev.h
tpm-interface.c tpm: Wrap the buffer from the caller to tpm_buf in tpm_send() 2019-09-25 02:43:57 +03:00
tpm-sysfs.c tpm: Remove a deprecated comments about implicit sysfs locking 2019-09-02 17:08:35 +03:00
tpm.h tpm: tpm_ibm_vtpm: Fix unallocated banks 2019-08-05 00:55:00 +03:00
tpmrm-dev.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 505 2019-06-19 17:11:22 +02:00
xen-tpmfront.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00