diff options
author | Thomas Gleixner | 2017-11-14 10:01:49 +0100 |
---|---|---|
committer | Thomas Gleixner | 2017-11-14 10:01:49 +0100 |
commit | d4bfeabe9ff7967f4b8c24aabf2de1ce3a909cd9 (patch) | |
tree | 6b419b8497c7d57ddec20a3558697ef36ea37b11 /drivers/char/tpm/tpm-dev-common.c | |
parent | timekeeping: Eliminate the stale declaration of ktime_get_raw_and_real_ts64() (diff) | |
parent | x86 / CPU: Avoid unnecessary IPIs in arch_freq_get_on_cpu() (diff) | |
download | kernel-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.c | 6 |
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. |