Commit 33d973ad authored by Steven Robertson's avatar Steven Robertson Committed by Greg Kroah-Hartman

USB: resizing usbmon binary interface buffer causes protection faults

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: default avatarSteven Robertson <steven@strobe.cc>
Acked-by: default avatarPete Zaitcev <zaitcev@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 92eb2a5e
...@@ -1004,7 +1004,7 @@ static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg ...@@ -1004,7 +1004,7 @@ static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg
mutex_lock(&rp->fetch_lock); mutex_lock(&rp->fetch_lock);
spin_lock_irqsave(&rp->b_lock, flags); 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); kfree(rp->b_vec);
rp->b_vec = vec; rp->b_vec = vec;
rp->b_size = size; rp->b_size = size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment