Re: [PATCH v3] tpm: Actually fail on TPM errors during "get random"

2019-05-29 Thread Jarkko Sakkinen
On Tue, May 28, 2019 at 03:02:49PM -0400, Laura Abbott wrote: > > Great, I'll add it. Thank you. Just want to be explicit with these > > things as I consider them as if I was asking a signature from someone > > :-) > > > > /Jarkko > > > Was this intended to go in for 5.2? I still don't see it in

Re: [PATCH v3] tpm: Actually fail on TPM errors during "get random"

2019-05-28 Thread Laura Abbott
On 4/3/19 1:52 PM, Jarkko Sakkinen wrote: On Tue, Apr 02, 2019 at 07:13:52PM +, Winkler, Tomas wrote: On Tue, Apr 02, 2019 at 02:46:25AM +0300, Jarkko Sakkinen wrote: On Mon, Apr 01, 2019 at 12:06:07PM -0700, Kees Cook wrote: A "get random" may fail with a TPM error, but those codes

Re: [PATCH v3] tpm: Actually fail on TPM errors during "get random"

2019-04-03 Thread Jarkko Sakkinen
On Tue, Apr 02, 2019 at 07:13:52PM +, Winkler, Tomas wrote: > > > > On Tue, Apr 02, 2019 at 02:46:25AM +0300, Jarkko Sakkinen wrote: > > > On Mon, Apr 01, 2019 at 12:06:07PM -0700, Kees Cook wrote: > > > > A "get random" may fail with a TPM error, but those codes were > > > > returned as-is

RE: [PATCH v3] tpm: Actually fail on TPM errors during "get random"

2019-04-02 Thread Winkler, Tomas
> On Tue, Apr 02, 2019 at 02:46:25AM +0300, Jarkko Sakkinen wrote: > > On Mon, Apr 01, 2019 at 12:06:07PM -0700, Kees Cook wrote: > > > A "get random" may fail with a TPM error, but those codes were > > > returned as-is to the caller, which assumed the result was the > > > number of bytes that

Re: [PATCH v3] tpm: Actually fail on TPM errors during "get random"

2019-04-02 Thread Jarkko Sakkinen
On Tue, Apr 02, 2019 at 02:46:25AM +0300, Jarkko Sakkinen wrote: > On Mon, Apr 01, 2019 at 12:06:07PM -0700, Kees Cook wrote: > > A "get random" may fail with a TPM error, but those codes were returned > > as-is to the caller, which assumed the result was the number of bytes > > that had been

Re: [PATCH v3] tpm: Actually fail on TPM errors during "get random"

2019-04-01 Thread Jarkko Sakkinen
On Mon, Apr 01, 2019 at 12:06:07PM -0700, Kees Cook wrote: > A "get random" may fail with a TPM error, but those codes were returned > as-is to the caller, which assumed the result was the number of bytes > that had been written to the target buffer, which could lead to a kernel > heap memory

RE: [PATCH v3] tpm: Actually fail on TPM errors during "get random"

2019-04-01 Thread Winkler, Tomas
> > A "get random" may fail with a TPM error, but those codes were returned as-is > to the caller, which assumed the result was the number of bytes that had been > written to the target buffer, which could lead to a kernel heap memory > exposure and over-read. > > This fixes tpm1_get_random() to

Re: [PATCH v3] tpm: Actually fail on TPM errors during "get random"

2019-04-01 Thread Kees Cook
On Mon, Apr 1, 2019 at 12:09 PM Jason Gunthorpe wrote: > > + * -errno otherwise ((positive TPM return codes are masked to -EIO) > > Extra bracket, but otherwise looks fine to me Thanks! (And I guess it's time for lunch so I can take a break and learn how to type again...) -- Kees Cook

Re: [PATCH v3] tpm: Actually fail on TPM errors during "get random"

2019-04-01 Thread Jason Gunthorpe
On Mon, Apr 01, 2019 at 12:06:07PM -0700, Kees Cook wrote: > A "get random" may fail with a TPM error, but those codes were returned > as-is to the caller, which assumed the result was the number of bytes > that had been written to the target buffer, which could lead to a kernel > heap memory