summaryrefslogtreecommitdiffstats
path: root/ipc/mqueue.c
diff options
context:
space:
mode:
authorGuus Sliepen <guus@sliepen.org>2009-07-22 17:39:42 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-23 06:46:30 -0700
commit665d7662d15441b4b3e54131a9418a1a198d0d31 (patch)
tree029c210e11d5f9befee6a51457a9dcd79b7934b6 /ipc/mqueue.c
parenta9d43091c5be1e7a60d5abe84be4f3050236b26a (diff)
downloadlinux-665d7662d15441b4b3e54131a9418a1a198d0d31.tar.gz
linux-665d7662d15441b4b3e54131a9418a1a198d0d31.tar.bz2
linux-665d7662d15441b4b3e54131a9418a1a198d0d31.zip
USB: usbtmc: sanity checks for DEV_DEP_MSG_IN urbs
According to the specifications, an instrument should not return more data in a DEV_DEP_MSG_IN urb than requested. However, some instruments can send more than requested. This could cause the kernel to write the extra data past the end of the buffer provided by read(). Fix this by checking that the value of the TranserSize field is not larger than the urb itself and not larger than the size of the userspace buffer. Also correctly decrement the remaining size of the buffer when userspace read()s more than USBTMC_SIZE_IOBUFFER. Signed-off-by: Guus Sliepen <guus@sliepen.org> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'ipc/mqueue.c')
0 files changed, 0 insertions, 0 deletions