awful TPM fix
awful TPM fix
Posted Jan 28, 2026 10:24 UTC (Wed) by johill (subscriber, #25196)Parent article: A critical GnuPG security update
Some of this might be baked into the TPM APIs, but e.g. the TPM fix still seems awful to me.
No mention of sizeof(), even if it seems that something like
if (len > sizeof(VAL_2B (inPoint.point.x, buffer))
return GPG_ERR_TOO_LARGE;
should be sufficient to avoid the memcpy() overflow, and the TPM must be doing input validation as well, so shouldn't that be sufficient? For the Intel stack I checked and point.x.buffer is that size (TPM2_MAX_ECC_KEY_BYTES).
Also, it seems that even simple static checkers could have found this, so don't they use those, or at least not with TPM enabled?
