summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm-dev-common.c
diff options
context:
space:
mode:
authorThomas Gleixner2017-11-14 10:01:49 +0100
committerThomas Gleixner2017-11-14 10:01:49 +0100
commitd4bfeabe9ff7967f4b8c24aabf2de1ce3a909cd9 (patch)
tree6b419b8497c7d57ddec20a3558697ef36ea37b11 /drivers/char/tpm/tpm-dev-common.c
parenttimekeeping: Eliminate the stale declaration of ktime_get_raw_and_real_ts64() (diff)
parentx86 / CPU: Avoid unnecessary IPIs in arch_freq_get_on_cpu() (diff)
downloadkernel-qcow2-linux-d4bfeabe9ff7967f4b8c24aabf2de1ce3a909cd9.tar.gz
kernel-qcow2-linux-d4bfeabe9ff7967f4b8c24aabf2de1ce3a909cd9.tar.xz
kernel-qcow2-linux-d4bfeabe9ff7967f4b8c24aabf2de1ce3a909cd9.zip
Merge branch 'linus' into timers/urgent
Get upstream changes so dependent patches can be applied.
Diffstat (limited to 'drivers/char/tpm/tpm-dev-common.c')
-rw-r--r--drivers/char/tpm/tpm-dev-common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c
index 610638a80383..461bf0b8a094 100644
--- a/drivers/char/tpm/tpm-dev-common.c
+++ b/drivers/char/tpm/tpm-dev-common.c
@@ -110,6 +110,12 @@ ssize_t tpm_common_write(struct file *file, const char __user *buf,
return -EFAULT;
}
+ if (in_size < 6 ||
+ in_size < be32_to_cpu(*((__be32 *) (priv->data_buffer + 2)))) {
+ mutex_unlock(&priv->buffer_mutex);
+ return -EINVAL;
+ }
+
/* atomic tpm command send and result receive. We only hold the ops
* lock during this period so that the tpm can be unregistered even if
* the char dev is held open.