]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit62e6899dc12dc602079e1ffee146e05ff2408d46
tree258cf362703fd59e394eefe7697cc952b10c5d5e
parent70b7a1de1a03ffb0b067ecdaa43d4351979cef69
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