tpm: add check for minimum buffer size in tpm_transmit()
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Mon, 12 Sep 2016 10:43:30 +0000 (13:43 +0300)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Thu, 15 Sep 2016 13:04:21 +0000 (16:04 +0300)
commitebfd7532e985818a327906e011f3e43c8ddfdd74
tree33c2acaeeba0454ace929e77fd7ab228e7870edc
parent0014777f989b54193bec95a0a153fa4a139183c7
tpm: add check for minimum buffer size in tpm_transmit()

tpm_transmit() does not check that bufsiz is at least TPM_HEADER_SIZE
before accessing data. This commit adds this check and returns -EINVAL
if it fails.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm-interface.c