linux/drivers/char/tpm
James Bottomley fb5abce6b2 tpm: use try_get_ops() in tpm-space.c
As part of the series conversion to remove nested TPM operations:

https://lore.kernel.org/all/20190205224723.19671-1-jarkko.sakkinen@linux.intel.com/

exposure of the chip->tpm_mutex was removed from much of the upper
level code.  In this conversion, tpm2_del_space() was missed.  This
didn't matter much because it's usually called closely after a
converted operation, so there's only a very tiny race window where the
chip can be removed before the space flushing is done which causes a
NULL deref on the mutex.  However, there are reports of this window
being hit in practice, so fix this by converting tpm2_del_space() to
use tpm_try_get_ops(), which performs all the teardown checks before
acquring the mutex.

Cc: stable@vger.kernel.org # 5.4.x
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2022-03-10 01:47:25 +02:00
..
eventlog tpm: vtpm_proxy: Avoid reading host log when using a virtual device 2021-04-14 16:30:30 +03:00
st33zp24 tpm/st33zp24: drop unneeded over-commenting 2022-01-09 00:18:37 +02:00
Kconfig tpm: tis: Kconfig: Add helper dependency on COMPILE_TEST 2021-10-26 05:03:33 +03:00
Makefile char: tpm: add i2c driver for cr50 2021-02-16 10:40:27 +02:00
tpm-chip.c tpm: fix reference counting for struct tpm_chip 2022-03-08 13:55:52 +02:00
tpm-dev-common.c tpm: Fix error handling in async work 2022-03-08 10:33: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: Handle negative priv->response_len in tpm_common_read() 2020-01-08 18:11:09 +02:00
tpm-interface.c tpm: fix wrong return value in tpm_pcr_extend 2020-04-21 00:06:13 +03:00
tpm-sysfs.c tpm: Add Upgrade/Reduced mode support for TPM2 modules 2022-01-09 00:18:47 +02:00
tpm.h tpm: fix reference counting for struct tpm_chip 2022-03-08 13:55:52 +02:00
tpm1-cmd.c tpm: fix some doc warnings in tpm1-cmd.c 2021-06-23 16:51:03 +03:00
tpm2-cmd.c tpm: Add Upgrade/Reduced mode support for TPM2 modules 2022-01-09 00:18:47 +02:00
tpm2-space.c tpm: use try_get_ops() in tpm-space.c 2022-03-10 01:47:25 +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 tpm_crb: Use IOMEM_ERR_PTR when function returns iomem 2021-06-23 16:51:03 +03:00
tpm_ftpm_tee.c tpm_ftpm_tee: Free and unregister TEE shared memory during kexec 2021-07-21 07:55:50 +02: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 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
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 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
tpm_ibmvtpm.c tpm: ibmvtpm: Avoid error message when process gets signal while waiting 2021-08-23 19:55:42 +03:00
tpm_ibmvtpm.h tpm: ibmvtpm: Avoid error message when process gets signal while waiting 2021-08-23 19:55:42 +03: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 tpm/ppi: Constify static struct attribute_group 2021-02-16 10:40:27 +02:00
tpm_tis.c tpm_tis: Use DEFINE_RES_MEM() to simplify code 2021-06-23 16:51:03 +03:00
tpm_tis_core.c tpm: fix NPE on probe for missing device 2022-01-09 00:18:51 +02:00
tpm_tis_core.h tpm: fix Atmel TPM crash caused by too frequent queries 2021-10-26 05:03:34 +03:00
tpm_tis_i2c_cr50.c char: tpm: cr50: Set TPM_FIRMWARE_POWER_MANAGED based on device property 2022-01-09 00:18:45 +02:00
tpm_tis_spi.h tpm: tpm_tis_spi: Support cr50 devices 2019-11-12 21:45:37 +02:00
tpm_tis_spi_cr50.c char: tpm: cr50: Set TPM_FIRMWARE_POWER_MANAGED based on device property 2022-01-09 00:18:45 +02:00
tpm_tis_spi_main.c tpm_tis_spi: Add missing SPI ID 2021-10-26 05:03:34 +03:00
tpm_tis_synquacer.c tpm: tis: add support for MMIO TPM on SynQuacer 2020-10-02 00:21:02 +03:00
tpm_vtpm_proxy.c compat_ioctl: move drivers to compat_ptr_ioctl 2019-10-23 17:23:43 +02:00
tpmrm-dev.c tpm: Unify the mismatching TPM space buffer sizes 2020-07-24 09:26:23 +03:00
xen-tpmfront.c tpm: xen-tpmfront: Use struct_size() helper 2022-03-08 10:33:18 +02:00