summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-05-07 19:53:32 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-07 19:53:32 +0200
commit32cf95db22d49cf4a3b421ba9fd156bb5f920ebb (patch)
tree48df4fe0b994c33155c7b19269621f6c122fee60 /drivers/misc
parentMerge tag 'staging-4.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff)
parentnvmem: mxs-ocotp: fix buffer overflow in read (diff)
downloadlinux-32cf95db22d49cf4a3b421ba9fd156bb5f920ebb.tar.xz
linux-32cf95db22d49cf4a3b421ba9fd156bb5f920ebb.zip
Merge tag 'char-misc-4.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull misc driver fixes from Gfreg KH: "Here are three small fixes for some driver problems that were reported. Full details in the shortlog below. All of these have been in linux-next with no reported issues" * tag 'char-misc-4.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: nvmem: mxs-ocotp: fix buffer overflow in read Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read() misc: mic: Fix for double fetch security bug in VOP driver
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/mic/vop/vop_vringh.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/misc/mic/vop/vop_vringh.c b/drivers/misc/mic/vop/vop_vringh.c
index e94c7fb6712a..88e45234d527 100644
--- a/drivers/misc/mic/vop/vop_vringh.c
+++ b/drivers/misc/mic/vop/vop_vringh.c
@@ -945,6 +945,11 @@ static long vop_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
ret = -EFAULT;
goto free_ret;
}
+ /* Ensure desc has not changed between the two reads */
+ if (memcmp(&dd, dd_config, sizeof(dd))) {
+ ret = -EINVAL;
+ goto free_ret;
+ }
mutex_lock(&vdev->vdev_mutex);
mutex_lock(&vi->vop_mutex);
ret = vop_virtio_add_device(vdev, dd_config);