summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_utils.h
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@kernel.org>2025-08-01 14:24:21 -0700
committerJarkko Sakkinen <jarkko@kernel.org>2025-10-10 08:21:45 +0300
commit2c2615c8423890b5ef8e0a186b65607ef5fdeda1 (patch)
tree5c5a8a6c0aaa04ae71f0d0cb5501d1215070a0c6 /drivers/gpu/drm/amd/amdgpu/amdgpu_utils.h
parent4bddf4587c131d7b8ce8952cd32b284dcda0dd1f (diff)
tpm: Compare HMAC values in constant time
In tpm_buf_check_hmac_response(), compare the HMAC values in constant time using crypto_memneq() instead of in variable time using memcmp(). This is worthwhile to follow best practices and to be consistent with MAC comparisons elsewhere in the kernel. However, in this driver the side channel seems to have been benign: the HMAC input data is guaranteed to always be unique, which makes the usual MAC forgery via timing side channel not possible. Specifically, the HMAC input data in tpm_buf_check_hmac_response() includes the "our_nonce" field, which was generated by the kernel earlier, remains under the control of the kernel, and is unique for each call to tpm_buf_check_hmac_response(). Signed-off-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_utils.h')
0 files changed, 0 insertions, 0 deletions