diff options
author | Steven Robertson <steven@strobe.cc> | 2010-07-21 16:38:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-13 13:27:25 -0700 |
commit | df9f1d0df4208a41410922114eb73cfeba254803 (patch) | |
tree | f4b56c97cc1f9390905d16a38143f981470ccf07 | |
parent | 517ba4f6111dfd40bb7b4e4e0fe38a0d63545e31 (diff) |
USB: resizing usbmon binary interface buffer causes protection faults
commit 33d973ad88ceb83ed1449592b7574b5b5bb33ac6 upstream.
Enlarging the buffer size via the MON_IOCT_RING_SIZE ioctl causes
general protection faults. It appears the culprit is an incorrect
argument to mon_free_buff: instead of passing the size of the current
buffer being freed, the size of the new buffer is passed.
Use the correct size argument to mon_free_buff when changing the size of
the buffer.
Signed-off-by: Steven Robertson <steven@strobe.cc>
Acked-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/mon/mon_bin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c index 8a7968df278f..6ee9d76d3833 100644 --- a/drivers/usb/mon/mon_bin.c +++ b/drivers/usb/mon/mon_bin.c @@ -1010,7 +1010,7 @@ static int mon_bin_ioctl(struct inode *inode, struct file *file, mutex_lock(&rp->fetch_lock); spin_lock_irqsave(&rp->b_lock, flags); - mon_free_buff(rp->b_vec, size/CHUNK_SIZE); + mon_free_buff(rp->b_vec, rp->b_size/CHUNK_SIZE); kfree(rp->b_vec); rp->b_vec = vec; rp->b_size = size; |