tpmdd updates for Linux v5.13-rc2
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.

Fixes: 58472f5cd4f6("tpm: validate TPM 2.0 commands")
Reported-by: Hulk Robot <>
Signed-off-by: Zhen Lei <>
Reviewed-by: Jarkko Sakkinen <>
Signed-off-by: Jarkko Sakkinen <>
1 file changed