]> git.baikalelectronics.ru Git - kernel.git/commit
tpm: fix response size validation in tpm_get_random()
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Mon, 3 Sep 2018 01:01:26 +0000 (04:01 +0300)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fri, 5 Oct 2018 10:47:33 +0000 (13:47 +0300)
commit2b8c27cad60e0858f9fe194247fb81c27331d263
treea028dd73b36a47922eb1867bd6ca95bf0da6a784
parentce7fa75ef8070ed82e63400b3e775c90bb2dd6af
tpm: fix response size validation in tpm_get_random()

When checking whether the response is large enough to be able to contain
the received random bytes in tpm_get_random() and tpm2_get_random(),
they fail to take account the header size, which should be added to the
minimum size. This commit fixes this issue.

Cc: stable@vger.kernel.org
Fixes: 627a3b9af48b ("tpm: Check size of response before accessing data")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm-interface.c
drivers/char/tpm/tpm2-cmd.c