USB: fix usbmon BUG trigger
authorPete Zaitcev <zaitcev@redhat.com>
Mon, 8 Jan 2018 21:46:41 +0000 (15:46 -0600)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:50:57 +0000 (15:50 +0000)
commitd1168c13578d3b6645c41314c8e0ce0ee0c85f6a
tree96f602a3f38384a0e53d5a849024051671e401f9
parent84f7438d82337ab4cbb9f04d031a0005514f78b3
USB: fix usbmon BUG trigger

commit 46eb14a6e1585d99c1b9f58d0e7389082a5f466b upstream.

Automated tests triggered this by opening usbmon and accessing the
mmap while simultaneously resizing the buffers. This bug was with
us since 2006, because typically applications only size the buffers
once and thus avoid racing. Reported by Kirill A. Shutemov.

Reported-by: <syzbot+f9831b881b3e849829fc@syzkaller.appspotmail.com>
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/mon/mon_bin.c