Skip to content

Commit 07e773d

Browse files
committed
Merge tag 'tpmdd-next-6.11-rc1-roundtwo' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd
Pull tpm fix from Jarkko Sakkinen: "An additional fix that supplements my earlier fixes for handling auth, which I unfortunately missed last time" * tag 'tpmdd-next-6.11-rc1-roundtwo' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: tpm: Use auth only after NULL check in tpm_buf_check_hmac_response()
2 parents c434e25 + 7dc357d commit 07e773d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/char/tpm/tpm2-sessions.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,15 +746,16 @@ int tpm_buf_check_hmac_response(struct tpm_chip *chip, struct tpm_buf *buf,
746746
struct tpm2_auth *auth = chip->auth;
747747
off_t offset_s, offset_p;
748748
u8 rphash[SHA256_DIGEST_SIZE];
749-
u32 attrs;
749+
u32 attrs, cc;
750750
struct sha256_state sctx;
751751
u16 tag = be16_to_cpu(head->tag);
752-
u32 cc = be32_to_cpu(auth->ordinal);
753752
int parm_len, len, i, handles;
754753

755754
if (!auth)
756755
return rc;
757756

757+
cc = be32_to_cpu(auth->ordinal);
758+
758759
if (auth->session >= TPM_HEADER_SIZE) {
759760
WARN(1, "tpm session not filled correctly\n");
760761
goto out;

0 commit comments

Comments
 (0)