Re: [tpmdd-devel] [PATCH RFC 2/4] tpm: validate TPM 2.0 commands

2017-01-04 Thread Jason Gunthorpe
On Wed, Jan 04, 2017 at 01:04:59PM -0500, Stefan Berger wrote: >> @@ -943,7 +943,9 @@ EXPORT_SYMBOL_GPL(tpm2_probe); >> */ >> int tpm2_auto_startup(struct tpm_chip *chip) >> { >> + u32 nr_commands; >> int rc; >> + int i; >> >> rc = tpm_get_timeou

Re: [tpmdd-devel] [PATCH RFC 2/4] tpm: validate TPM 2.0 commands

2017-01-04 Thread James Bottomley
On Wed, 2017-01-04 at 13:04 -0500, Stefan Berger wrote: > Jarkko Sakkinen wrote on 01/02/2017 > 08:22:08 AM: > > > --- a/drivers/char/tpm/tpm2-cmd.c > > +++ b/drivers/char/tpm/tpm2-cmd.c > > @@ -943,7 +943,9 @@ EXPORT_SYMBOL_GPL(tpm2_probe); > > */ > > int tpm2_auto_startup(struct tpm_chip *ch

[PATCH RFC 2/4] tpm: validate TPM 2.0 commands

2017-01-02 Thread Jarkko Sakkinen
Check for every TPM 2.0 command that the command code is supported and the command buffer has at least the length that can contain the header and the handle area. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 32 +- drivers/char/tpm/tpm.h