diff options
| author | Jiangshan Yi <yijiangshan@kylinos.cn> | 2026-09-01 17:30:49 +0300 |
|---|---|---|
| committer | Jarkko Sakkinen <jarkko@kernel.org> | 2026-09-29 22:15:20 +0300 |
| commit | 1a70f0b71826fb764e8490dda55bb1b853e0d1de (patch) | |
| tree | 172d17ffb430f0cf552be02ca30507fa76d21833 /tools/lib/python | |
| parent | 6f8319e3e9a44dd537d17f41565a8453c560a581 (diff) | |
| download | linux-next-1a70f0b71826fb764e8490dda55bb1b853e0d1de.tar.gz linux-next-1a70f0b71826fb764e8490dda55bb1b853e0d1de.zip | |
tpm: Fix heap buffer overflow in tpm_transmit_cmd()
struct tpm_buf now uses an embedded flexible array for data, which is
6 bytes shorter than TPM_BUFSIZE due to the struct header. But
tpm_transmit_cmd() still passes PAGE_SIZE to tpm_transmit(), and after
clamping to TPM_BUFSIZE in tpm_try_transmit(), chip->ops->recv() can
write past the end of data[] by 6 bytes.
Pass buf->capacity to tpm_transmit() instead.
Fixes: 3d9e043dab0a ("tpm-buf: Memory-safe allocations")
Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>
Link: https://lore.kernel.org/r/20260901062850.379870-1-yijiangshan@kylinos.cn
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
