OpenCloudOS-Kernel/drivers/char/tpm
Zhen Lei 1df83992d9 tpm: fix error return code in tpm2_get_cc_attrs_tbl()
If the total number of commands queried through TPM2_CAP_COMMANDS is
different from that queried through TPM2_CC_GET_CAPABILITY, it indicates
an unknown error. In this case, an appropriate error code -EFAULT should
be returned. However, we currently do not explicitly assign this error
code to 'rc'. As a result, 0 was incorrectly returned.

Cc: stable@vger.kernel.org
Fixes: 58472f5cd4f6("tpm: validate TPM 2.0 commands")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
2021-05-12 22:36:50 +03:00
..
eventlog tpm: vtpm_proxy: Avoid reading host log when using a virtual device 2021-04-14 16:30:30 +03:00
st33zp24
Kconfig char: tpm: add i2c driver for cr50 2021-02-16 10:40:27 +02:00
Makefile char: tpm: add i2c driver for cr50 2021-02-16 10:40:27 +02:00
tpm-chip.c tpm: Remove unintentional dump_stack() call 2021-03-03 17:43:52 +02:00
tpm-dev-common.c tpm: Remove tpm_dev_wq_lock 2021-02-16 10:40:27 +02:00
tpm-dev.c
tpm-dev.h
tpm-interface.c
tpm-sysfs.c tpm: add sysfs exports for all banks of PCR registers 2021-02-16 10:40:27 +02:00
tpm.h KEYS: trusted: Reserve TPM for seal and unseal operations 2021-02-16 10:40:28 +02:00
tpm1-cmd.c
tpm2-cmd.c tpm: fix error return code in tpm2_get_cc_attrs_tbl() 2021-05-12 22:36:50 +03:00
tpm2-space.c
tpm_atmel.c
tpm_atmel.h
tpm_crb.c
tpm_ftpm_tee.c
tpm_ftpm_tee.h
tpm_i2c_atmel.c
tpm_i2c_infineon.c
tpm_i2c_nuvoton.c
tpm_ibmvtpm.c vio: make remove callback return void 2021-03-02 22:41:23 +11:00
tpm_ibmvtpm.h
tpm_infineon.c
tpm_nsc.c
tpm_ppi.c tpm/ppi: Constify static struct attribute_group 2021-02-16 10:40:27 +02:00
tpm_tis.c
tpm_tis_core.c tpm, tpm_tis: Reserve locality in tpm_tis_resume() 2021-05-12 22:36:42 +03:00
tpm_tis_core.h
tpm_tis_i2c_cr50.c char: tpm: fix error return code in tpm_cr50_i2c_tis_recv() 2021-04-14 16:30:30 +03:00
tpm_tis_spi.h
tpm_tis_spi_cr50.c
tpm_tis_spi_main.c
tpm_tis_synquacer.c
tpm_vtpm_proxy.c
tpmrm-dev.c
xen-tpmfront.c