linux-stable/drivers/char
Roberto Sassu dc10e4181c tpm: Initialize crypto_id of allocated_banks to HASH_ALGO__LAST
chip->allocated_banks, an array of tpm_bank_info structures, contains the
list of TPM algorithm IDs of allocated PCR banks. It also contains the
corresponding ID of the crypto subsystem, so that users of the TPM driver
can calculate a digest for a PCR extend operation.

However, if there is no mapping between TPM algorithm ID and crypto ID, the
crypto_id field of tpm_bank_info remains set to zero (the array is
allocated and initialized with kcalloc() in tpm2_get_pcr_allocation()).
Zero should not be used as value for unknown mappings, as it is a valid
crypto ID (HASH_ALGO_MD4).

Thus, initialize crypto_id to HASH_ALGO__LAST.

Cc: stable@vger.kernel.org # 5.1.x
Fixes: 879b589210 ("tpm: retrieve digest size of unknown algorithms with PCR read")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
2020-02-17 20:47:06 +02:00
..
agp remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
hw_random treewide: remove redundant IS_ERR() before error code check 2020-02-04 03:05:27 +00:00
ipmi drivers: ipmi: fix off-by-one bounds check that leads to a out-of-bounds write 2020-01-20 11:01:00 -06:00
mwave
pcmcia netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
tpm tpm: Initialize crypto_id of allocated_banks to HASH_ALGO__LAST 2020-02-17 20:47:06 +02:00
xilinx_hwicap
xillybus char: xillybus: use devm_platform_ioremap_resource() to simplify code 2019-11-05 18:29:21 +01:00
adi.c
apm-emulation.c
applicom.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
applicom.h
bsr.c
ds1620.c
dsp56k.c
dtlk.c
efirtc.c
hangcheck-timer.c
hpet.c char: hpet: Fix out-of-bounds read bug 2020-01-30 06:58:33 +01:00
Kconfig char: Fix Kconfig indentation 2019-11-20 15:09:48 +01:00
lp.c lp: fix sparc64 LPSETTIMEOUT ioctl 2019-11-13 19:08:22 +08:00
Makefile
mem.c
misc.c
mspec.c
nsc_gpio.c
nvram.c
nwbutton.c
nwbutton.h
nwflash.c
pc8736x_gpio.c
powernv-op-panel.c
ppdev.c compat_ioctl: remove most of fs/compat_ioctl.c 2019-12-01 13:46:15 -08:00
ps3flash.c
random.c random: remove some dead code of poolinfo 2020-01-07 17:08:13 -05:00
raw.c
rtc.c
scx200_gpio.c
sonypi.c
tb0219.c
tlclk.c
toshiba.c
ttyprintk.c ttyprintk: fix a potential deadlock in interrupt context issue 2020-01-14 14:37:54 +01:00
uv_mmtimer.c
virtio_console.c Pipework for general notification queue 2019-11-30 14:12:13 -08:00