]> Gentwo Git Trees - linux/.git/commit
tpm: Cap the number of PCR banks
authorJarkko Sakkinen <jarkko.sakkinen@opinsys.com>
Tue, 30 Sep 2025 12:58:02 +0000 (15:58 +0300)
committerJarkko Sakkinen <jarkko@kernel.org>
Wed, 3 Dec 2025 20:55:28 +0000 (22:55 +0200)
commitfaf07e611dfa464b201223a7253e9dc5ee0f3c9e
tree239138fcda38788beab52044d316f14e8e5d2176
parent020a0d8feac0fd8a6f6c545c55f5990875226a0b
tpm: Cap the number of PCR banks

tpm2_get_pcr_allocation() does not cap any upper limit for the number of
banks. Cap the limit to eight banks so that out of bounds values coming
from external I/O cause on only limited harm.

Cc: stable@vger.kernel.org # v5.10+
Fixes: bcfff8384f6c ("tpm: dynamically allocate the allocated_banks array")
Tested-by: Lai Yi <yi1.lai@linux.intel.com>
Reviewed-by: Jonathan McDowell <noodles@meta.com>
Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@opinsys.com>
drivers/char/tpm/tpm-chip.c
drivers/char/tpm/tpm1-cmd.c
drivers/char/tpm/tpm2-cmd.c
include/linux/tpm.h