tpm: vtpm_proxy: Prevent userspace from sending driver command
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Wed, 24 May 2017 21:39:41 +0000 (17:39 -0400)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tue, 13 Jun 2017 19:02:09 +0000 (22:02 +0300)
commitd8b5d94538eb1cb18be36048b0ddb9bd2e80a252
tree258cf362703fd59e394eefe7697cc952b10c5d5e
parentbe4c9acfe2976b6e024d15656254d2eb207b83a8
tpm: vtpm_proxy: Prevent userspace from sending driver command

To prevent userspace from sending the TPM driver command to set
the locality, we need to check every command that is sent from
user space. To distinguish user space commands from internally
sent commands we introduce an additional state flag
STATE_DRIVER_COMMAND that is set while the driver sends this
command. Similar to the TPM 2 space commands we return an error
code when this command is detected.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/tpm_vtpm_proxy.c