Skip to content
  • Pete Zaitcev's avatar
    USB: usbmon: fix read(2) · f1c0a2a3
    Pete Zaitcev authored
    
    
    There's a bug in the usbmon binary reader: When using read() to fetch
    the packets and a packet's data is partially read, the next read call
    will once again return up to len_cap bytes of data. The b_read counter
    is not regarded when determining the remaining chunk size.
    
    So, when dumping USB data with "cat /dev/usbmon0 > usbmon.trace" while
    reading from a USB storage device and analyzing the dump file
    afterwards it will get out of sync after a couple of packets.
    
    Signed-off-by: default avatarIngo van Lil <inguin@gmx.de>
    Signed-off-by: default avatarPete Zaitcev <zaitcev@redhat.com>
    Cc: stable <stable@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    f1c0a2a3