]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
tpm: Return the actual size when receiving an unsupported command
authorRicardo Schwarzmeier <Ricardo.Schwarzmeier@infineon.com>
Tue, 26 Jun 2018 15:31:45 +0000 (17:31 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:45:15 +0000 (19:45 -0600)
commit989cc417144327991dd93b220363af1ab55fbffc
tree38903da3554be021904e550ff65d9a9d6b3f8314
parent0e751f981a84e31f0317be2eab71c613031e1f16
tpm: Return the actual size when receiving an unsupported command

BugLink: https://bugs.launchpad.net/bugs/1835972
commit 36a11029b07ee30bdc4553274d0efea645ed9d91 upstream.

The userpace expects to read the number of bytes stated in the header.
Returning the size of the buffer instead would be unexpected.

Cc: stable@vger.kernel.org
Fixes: 095531f891e6 ("tpm: return a TPM_RC_COMMAND_CODE response if command is not implemented")
Signed-off-by: Ricardo Schwarzmeier <Ricardo.Schwarzmeier@infineon.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/char/tpm/tpm-interface.c