[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5011C0C3.4090009@zytor.com>
Date: Thu, 26 Jul 2012 15:12:19 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Kent Yoder <key@...ux.vnet.ibm.com>
CC: linux-kernel@...r.kernel.org, tpmdd-devel@...ts.sourceforge.net,
m.selhorst@...rix.com, safford@...ibm.com
Subject: Re: [PATCH 1/2] tpm: Move tpm_get_random api into the TPM device
driver
On 06/07/2012 11:47 AM, Kent Yoder wrote:
> Move the tpm_get_random api from the trusted keys code into the TPM
> device driver itself so that other callers can make use of it. Also,
> change the api slightly so that the number of bytes read is returned in
> the call, since the TPM command can potentially return fewer bytes than
> requested.
>
> Signed-off-by: Kent Yoder <key@...ux.vnet.ibm.com>
> +int tpm_get_random(u32 chip_num, u8 *out, size_t *max)
/* ... */
> 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.
-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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists