Re: [PATCH 1/2] tpm: Move tpm_get_random api into the TPM devicedriver

From: H. Peter Anvin
Date: Fri Jul 27 2012 - 11:08:48 EST


On 07/27/2012 07:49 AM, Kent Yoder wrote:

case Opt_new:
- ret = my_get_random(payload->key, payload->key_len);
+ ret = tpm_get_random(TPM_ANY_NUM, payload->key,
+ &payload->key_len);

payload->key_len is unsigned int, not size_t; this causes an
overwrite of blob_len on 64-bit platforms.

Good catch.


It generated a compiler warning, so that one was trivial to spot.

-hpa


--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/