Skip to content

Commit

Permalink
USB: resizing usbmon binary interface buffer causes protection faults
Browse files Browse the repository at this point in the history
commit 33d973a 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>
  • Loading branch information
Steven Robertson authored and Greg Kroah-Hartman committed Aug 13, 2010
1 parent 517ba4f commit df9f1d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/mon/mon_bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit df9f1d0

Please sign in to comment.