linux/drivers/char/tpm
Joe Hattori 558e339b16 char: tpm: Fix possible memory leak in tpm_bios_measurements_open()
commit 5d8e2971e8 upstream.

In tpm_bios_measurements_open(), get_device() is called on the device
embedded in struct tpm_chip. In the error path, however, put_device() is
not called. This results in a reference count leak, which prevents the
device from being properly released. This commit makes sure to call
put_device() when the seq_open() call fails.

Cc: stable@vger.kernel.org # +v4.18
Fixes: 9b01b53566 ("tpm: Move shared eventlog functions to common.c")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-08-19 05:45:11 +02:00
..
eventlog char: tpm: Fix possible memory leak in tpm_bios_measurements_open() 2024-08-19 05:45:11 +02:00
st33zp24 tpm/st33zp24: fix spelling mistake "drescription" -> "description" 2020-07-02 17:49:00 +03:00
Kconfig char: tpm: Kconfig: remove bad i2c cr50 select 2021-08-23 19:55:42 +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-04-08 14:22:48 +02:00
tpm-dev-common.c tpm: Fix error handling in async work 2022-03-28 09:58:42 +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 char: tpm: Protect tpm_pm_suspend with locks 2022-12-08 11:28:45 +01:00
tpm-sysfs.c tpm: add sysfs exports for all banks of PCR registers 2021-02-16 10:40:27 +02:00
tpm.h tpm: fix reference counting for struct tpm_chip 2022-04-08 14:22:48 +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: Fix buffer access in tpm2_get_tpm_pt() 2022-06-06 08:43:41 +02:00
tpm2-space.c tpm: fix reference counting for struct tpm_chip 2022-04-08 14:22:48 +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: tpm_crb: Add the missed acpi_put_table() to fix memory leak 2023-01-12 11:58:48 +01:00
tpm_ftpm_tee.c tpm/tpm_ftpm_tee: Fix error handling in ftpm_mod_init() 2022-12-31 13:14:00 +01: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: Correct the return value in tpm_ibmvtpm_probe() 2022-06-06 08:43:41 +02: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/tpm_tis: Disable interrupts for more Lenovo devices 2023-05-24 17:36:55 +01:00
tpm_tis_core.c tpm_tis: Resend command to recover from data transfer errors 2023-09-23 11:09:56 +02:00
tpm_tis_core.h tpm, tpm: Implement usage counter for locality 2023-05-11 23:00:19 +09:00
tpm_tis_i2c_cr50.c char: tpm: cr50_i2c: Suppress duplicated error message in .remove() 2022-06-09 10:22:40 +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 tpm: tpm_tis_spi_cr50: use new structure for SPI transfer delays 2020-03-13 03:53:16 +02:00
tpm_tis_spi_main.c tpm_tis_spi: Add missing SPI ID 2021-11-18 19:16:41 +01: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 tpm: tpm_vtpm_proxy: fix a race condition in /dev/vtpmx creation 2023-07-23 13:47:47 +02:00
tpmrm-dev.c tpm: Unify the mismatching TPM space buffer sizes 2020-07-24 09:26:23 +03:00
xen-tpmfront.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00