From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
Zwane Mwaikambo <zwane@arm.linux.org.uk>,
"Theodore Ts'o" <tytso@mit.edu>,
Randy Dunlap <rdunlap@xenotime.net>,
Dave Jones <davej@redhat.com>,
Chuck Wolber <chuckw@quantumlinux.com>,
Chris Wedgwood <reviews@ml.cw.f00f.org>,
Michael Krufky <mkrufky@linuxtv.org>,
Chuck Ebbert <cebbert@redhat.com>,
Domenico Andreoli <cavokz@gmail.com>, Willy Tarreau <w@1wt.eu>,
Rodrigo Rubira Branco <rbranco@la.checkpoint.com>,
Jake Edge <jake@lwn.net>, Eugene Teo <eteo@redhat.com>,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk, Ingo van Lil <inguin@gmx.de>,
Pete Zaitcev <zaitcev@redhat.com>
Subject: [patch 003/104] USB: usbmon: fix read(2)
Date: Wed, 3 Dec 2008 11:48:18 -0800 [thread overview]
Message-ID: <20081203194818.GD8950@kroah.com> (raw)
In-Reply-To: <20081203194725.GA8950@kroah.com>
[-- Attachment #1: usb-usbmon-fix-read.patch --]
[-- Type: text/plain, Size: 1384 bytes --]
2.6.27-stable review patch. If anyone has any objections, please let us know.
------------------
From: Pete Zaitcev <zaitcev@redhat.com>
commit f1c0a2a3aff53698f4855968d576464041d49b39 upstream.
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: Ingo van Lil <inguin@gmx.de>
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/mon/mon_bin.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -687,7 +687,10 @@ static ssize_t mon_bin_read(struct file
}
if (rp->b_read >= sizeof(struct mon_bin_hdr)) {
- step_len = min(nbytes, (size_t)ep->len_cap);
+ step_len = ep->len_cap;
+ step_len -= rp->b_read - sizeof(struct mon_bin_hdr);
+ if (step_len > nbytes)
+ step_len = nbytes;
offset = rp->b_out + PKT_SIZE;
offset += rp->b_read - sizeof(struct mon_bin_hdr);
if (offset >= rp->b_size)
next prev parent reply other threads:[~2008-12-03 19:51 UTC|newest]
Thread overview: 190+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081203193901.715896543@mini.kroah.org>
2008-12-03 19:47 ` [patch 000/104] 2.6.27-stable review Greg KH
2008-12-03 19:48 ` [patch 001/104] USB: gadget rndis: send notifications Greg KH
2008-12-03 19:48 ` [patch 002/104] USB: gadget rndis: stop windows self-immolation Greg KH
2008-12-03 19:48 ` Greg KH [this message]
2008-12-03 19:48 ` [patch 004/104] USB: fix SB700 usb subsystem hang bug Greg KH
2008-12-03 19:48 ` [patch 005/104] USB: fix SB600 USB " Greg KH
2008-12-03 19:48 ` [patch 006/104] atl1e: fix broken multicast by removing unnecessary crc inversion Greg KH
2008-12-03 19:48 ` [patch 007/104] cpuset: fix regression when failed to generate sched domains Greg KH
2008-12-03 19:48 ` [patch 008/104] cgroups: fix a serious bug in cgroupstats Greg KH
2008-12-03 19:48 ` [patch 009/104] eCryptfs: Allocate up to two scatterlists for crypto ops on keys Greg KH
2008-12-03 19:48 ` [patch 010/104] pxa2xx_spi: bugfix full duplex dma data corruption Greg KH
2008-12-03 19:48 ` [patch 011/104] fbdev: clean the penguins dirty feet Greg KH
2008-12-05 12:58 ` Pavel Machek
2008-12-05 19:29 ` Henrique de Moraes Holschuh
2008-12-06 0:26 ` Greg KH
2008-12-06 2:44 ` Andrew Morton
2008-12-03 19:48 ` [patch 012/104] gpiolib: extend gpio label column width in debugfs file Greg KH
2008-12-03 19:48 ` [patch 013/104] lib/scatterlist.c: fix kunmap() argument in sg_miter_stop() Greg KH
2008-12-03 19:48 ` [patch 014/104] sysvipc: fix the ipc structures initialization Greg KH
2008-12-03 19:48 ` [patch 015/104] parisc: fix kernel crash when unwinding a userspace process Greg KH
2008-12-03 19:48 ` [patch 016/104] epoll: introduce resource usage limits Greg KH
2009-01-23 4:51 ` Bron Gondwana
2009-01-23 5:16 ` Greg KH
2009-01-23 9:47 ` Bron Gondwana
2009-01-23 17:06 ` Greg KH
2009-01-23 17:24 ` Bastien ROUCARIES
2009-01-23 19:36 ` Davide Libenzi
2009-01-24 3:50 ` Bron Gondwana
2009-01-24 8:36 ` Vegard Nossum
2009-01-24 13:03 ` Bron Gondwana
2009-01-25 11:01 ` Bron Gondwana
2009-01-25 12:20 ` Bron Gondwana
2009-01-28 0:35 ` Greg KH
2009-01-28 3:38 ` Bron Gondwana
2009-01-28 3:46 ` Davide Libenzi
2009-01-28 3:57 ` Bron Gondwana
2009-01-28 4:10 ` Davide Libenzi
2009-01-28 5:26 ` Greg KH
2009-01-28 5:36 ` Willy Tarreau
2009-01-28 5:48 ` Davide Libenzi
2009-01-28 6:20 ` Willy Tarreau
2009-01-28 6:36 ` Davide Libenzi
2009-01-28 6:59 ` Willy Tarreau
2009-01-28 6:38 ` Davide Libenzi
2009-01-28 6:52 ` Bron Gondwana
2009-01-28 7:34 ` Davide Libenzi
2009-01-28 10:45 ` Bron Gondwana
2009-01-28 6:57 ` Davide Libenzi
2009-01-28 9:24 ` Bron Gondwana
2009-01-28 16:56 ` Davide Libenzi
2009-01-28 21:46 ` Chris Adams
2009-01-28 23:54 ` Davide Libenzi
2009-01-28 3:47 ` [PATCH 1/3] epoll: increase default max_user_instances to 1024 Bron Gondwana
2009-01-28 4:00 ` Davide Libenzi
2009-01-28 4:07 ` Ray Lee
2009-01-28 4:14 ` Davide Libenzi
2009-01-28 4:55 ` Bron Gondwana
2009-01-28 5:30 ` Davide Libenzi
2009-01-28 5:38 ` Bron Gondwana
2009-01-28 10:16 ` Alan Cox
2009-01-28 10:59 ` Bron Gondwana
2009-01-28 11:36 ` Alan Cox
2009-01-28 13:28 ` Bron Gondwana
2009-01-28 4:39 ` Bron Gondwana
2009-01-28 5:32 ` Bron Gondwana
2009-01-28 11:08 ` Vegard Nossum
2009-01-28 16:52 ` Davide Libenzi
2009-01-28 20:51 ` Bron Gondwana
2009-01-28 23:51 ` Davide Libenzi
2009-01-29 0:28 ` Bron Gondwana
2009-01-28 3:47 ` [PATCH 2/3] epoll: allow 0 for "unlimited" on epoll limits Bron Gondwana
2009-01-28 3:47 ` [PATCH 3/3] epoll: add /proc/sys/fs/epoll/limits interface Bron Gondwana
2009-01-25 12:03 ` [patch 016/104] epoll: introduce resource usage limits Bron Gondwana
2009-01-23 19:28 ` Davide Libenzi
2008-12-03 19:48 ` [patch 017/104] Fix inotify watch removal/umount races Greg KH
2008-12-03 19:48 ` [patch 018/104] IA64: fix boot panic caused by offline CPUs Greg KH
2008-12-03 19:49 ` [patch 019/104] V4L/DVB (9352): Add some missing compat32 ioctls Greg KH
2008-12-03 19:49 ` [patch 020/104] Input: atkbd - add keymap quirk for Inventec Symphony systems Greg KH
2008-12-03 19:49 ` [patch 021/104] lib/idr.c: fix rcu related race with idr_find Greg KH
2008-12-09 21:40 ` Dave Airlie
2008-12-09 22:47 ` Linus Torvalds
2008-12-10 0:43 ` Dave Airlie
2008-12-10 1:46 ` Dave Airlie
2008-12-10 2:02 ` Andrew Morton
2008-12-10 2:08 ` Dave Airlie
2008-12-10 2:32 ` Andrew Morton
2008-12-10 17:33 ` Manfred Spraul
2008-12-03 19:49 ` [patch 022/104] parport_serial: fix array overflow Greg KH
2008-12-03 19:49 ` [patch 023/104] x86: more general identifier for Phoenix BIOS Greg KH
2008-12-03 19:49 ` [patch 024/104] x86: always define DECLARE_PCI_UNMAP* macros Greg KH
2008-12-03 19:49 ` [patch 025/104] ath9k: Fix SW-IOMMU bounce buffer starvation Greg KH
2008-12-03 19:50 ` [patch 026/104] ath9k: correct expected max RX buffer size Greg KH
2008-12-03 19:50 ` [patch 027/104] axnet_cs / pcnet_cs: moving PCMCIA_DEVICE_PROD_ID for Netgear FA411 Greg KH
2008-12-03 22:06 ` Cord Walter
2008-12-03 19:50 ` [patch 028/104] PCI Hotplug core: add name param pci_hp_register interface Greg KH
2008-12-03 19:50 ` [patch 029/104] PCI: update pci_create_slot() to take a hotplug param Greg KH
2008-12-03 19:50 ` [patch 030/104] PCI Hotplug: serialize pci_hp_register and pci_hp_deregister Greg KH
2008-12-03 19:50 ` [patch 031/104] PCI: prevent duplicate slot names Greg KH
2008-12-04 22:10 ` Alex Chiang
2008-12-05 18:27 ` [stable] " Greg KH
2008-12-09 22:41 ` Jesse Barnes
2008-12-03 19:50 ` [patch 032/104] PCI, PCI Hotplug: introduce slot_name helpers Greg KH
2008-12-03 19:50 ` [patch 033/104] PCI: acpiphp: remove name parameter Greg KH
2008-12-03 19:50 ` [patch 034/104] PCI: cpci_hotplug: stop managing hotplug_slot->name Greg KH
2008-12-03 22:15 ` Scott Murray
2008-12-03 19:50 ` [patch 035/104] PCI: cpqphp: " Greg KH
2008-12-03 19:51 ` [patch 036/104] PCI: fakephp: remove name parameter Greg KH
2008-12-03 19:51 ` [patch 037/104] PCI: ibmphp: stop managing hotplug_slot->name Greg KH
2008-12-03 19:51 ` [patch 038/104] PCI: pciehp: remove name parameter Greg KH
2008-12-03 19:51 ` [patch 039/104] PCI: rpaphp: kmalloc/kfree slot->name directly Greg KH
2008-12-03 19:51 ` [patch 040/104] PCI: SGI Hotplug: stop managing bss_hotplug_slot->name Greg KH
2008-12-03 19:51 ` [patch 041/104] PCI: shcphp: remove name parameter Greg KH
2008-12-03 19:51 ` [patch 042/104] PCI: Hotplug core: remove name Greg KH
2008-12-03 19:51 ` [patch 043/104] CPUFREQ: powernow-k8: ignore out-of-range PstateStatus value Greg KH
2008-12-03 19:51 ` [patch 044/104] xen: do not reserve 2 pages of padding between hypervisor and fixmap Greg KH
2008-12-03 19:51 ` [patch 045/104] x86: Hibernate: Fix breakage on x86_32 with CONFIG_NUMA set Greg KH
2008-12-03 19:51 ` [patch 046/104] x86: SB600: skip ACPI IRQ0 override if it is not routed to INT2 of IOAPIC Greg KH
2008-12-03 19:51 ` [patch 047/104] libata: Avoid overflow in libata when tf->hba_lbal > 127 Greg KH
2008-12-03 19:51 ` [patch 048/104] x86: call dmi-quirks for HP Laptops after early-quirks are executed Greg KH
2008-12-03 19:51 ` [patch 049/104] igb: Use device_set_wakeup_enable Greg KH
2008-12-03 19:51 ` [patch 050/104] e1000: " Greg KH
2008-12-03 19:52 ` [patch 051/104] e1000e: " Greg KH
2008-12-03 19:52 ` [patch 052/104] libata: blacklist Seagate drives which time out FLUSH_CACHE when used with NCQ Greg KH
2008-12-03 19:52 ` [patch 053/104] rtl8187: add device ID 0bda:8198 Greg KH
2008-12-03 19:52 ` [patch 054/104] rtl8187: Add USB ID for Belkin F5D7050 with RTL8187B chip Greg KH
2008-12-03 19:52 ` [patch 055/104] cifs: Reduce number of socket retries in large write path Greg KH
2008-12-03 19:52 ` [patch 056/104] cifs: Fix error in smb_send2 Greg KH
2008-12-03 19:52 ` [patch 057/104] powerpc/spufs: Fix spinning in spufs_ps_fault on signal Greg KH
2008-12-03 19:52 ` [patch 058/104] powerpc/spufs: add a missing mutex_unlock Greg KH
2008-12-03 19:52 ` [patch 059/104] WATCHDOG: hpwdt: set the mapped BIOS address space as executable Greg KH
2008-12-03 19:52 ` [patch 060/104] WATCHDOG: hpwdt: Fix kdump when using hpwdt Greg KH
2008-12-03 19:52 ` [patch 061/104] Remove -mno-spe flags as they dont belong Greg KH
2008-12-03 19:53 ` [patch 062/104] ACPI: EC: count interrupts only if called from interrupt handler Greg KH
2008-12-05 13:06 ` Pavel Machek
2008-12-06 0:26 ` Greg KH
2008-12-03 19:53 ` [patch 063/104] ieee1394: sbp2: another iPod mini quirk entry Greg KH
2008-12-03 19:53 ` [patch 064/104] firewire: fw-sbp2: " Greg KH
2008-12-03 19:53 ` [patch 065/104] IB/mlx4: Fix MTT leakage in resize CQ Greg KH
2008-12-03 19:53 ` [patch 066/104] net: Fix soft lockups/OOM issues w/ unix garbage collector (CVE-2008-5300) Greg KH
2008-12-03 19:53 ` [patch 067/104] libata: improve phantom device detection Greg KH
2008-12-04 4:20 ` Tejun Heo
2008-12-05 18:36 ` [stable] " Greg KH
2008-12-06 5:24 ` Tejun Heo
2008-12-03 19:53 ` [patch 068/104] cifs: Fix cifs reconnection flags Greg KH
2008-12-03 19:53 ` [patch 069/104] cifs: remove unused list, add new cifs sock list to prepare for mount/umount fix Greg KH
2008-12-03 19:53 ` [patch 070/104] cifs: clean up server protocol handling Greg KH
2008-12-03 19:53 ` [patch 071/104] cifs: disable sharing session and tcon and add new TCP sharing code Greg KH
2008-12-03 19:53 ` [patch 072/104] cifs: reinstate sharing of SMB sessions sans races Greg KH
2008-12-03 19:53 ` [patch 073/104] cifs: minor cleanup to cifs_mount Greg KH
2008-12-03 19:53 ` [patch 074/104] cifs: reinstate sharing of tree connections Greg KH
2008-12-03 19:53 ` [patch 075/104] cifs: Fix build break Greg KH
2008-12-03 19:55 ` [patch 076/104] cifs: Fix check for tcon seal setting and fix oops on failed mount from earlier patch Greg KH
2008-12-03 19:56 ` [patch 077/104] cifs: prevent cifs_writepages() from skipping unwritten pages Greg KH
2008-12-03 19:56 ` [patch 078/104] cifs: fix check for dead tcon in smb_init Greg KH
2008-12-03 19:56 ` [patch 079/104] ext4: Update flex_bg free blocks and free inodes counters when resizing Greg KH
2008-12-03 19:56 ` [patch 080/104] ext4: fix #11321: create /proc/ext4/*/stats more carefully Greg KH
2008-12-03 19:56 ` [patch 081/104] jbd2: fix /proc setup for devices that contain / in their names Greg KH
2008-12-03 19:56 ` [patch 082/104] ext4: add missing unlock in ext4_check_descriptors() on error path Greg KH
2008-12-03 19:56 ` [patch 083/104] ext4: elevate write count for migrate ioctl Greg KH
2008-12-03 19:56 ` [patch 084/104] ext4: Renumber EXT4_IOC_MIGRATE Greg KH
2008-12-03 19:56 ` [patch 085/104] ext4/jbd2: Avoid WARN() messages when failing to write to the superblock Greg KH
2008-12-03 19:56 ` [patch 086/104] ext4: fix initialization of UNINIT bitmap blocks Greg KH
2008-12-04 4:10 ` Theodore Tso
2008-12-05 18:36 ` [stable] " Greg KH
2008-12-03 19:56 ` [patch 087/104] jbd2: abort instead of waiting for nonexistent transaction Greg KH
2008-12-03 19:56 ` [patch 088/104] jbd2: Fix buffer head leak when writing the commit block Greg KH
2008-12-03 19:56 ` [patch 089/104] ext4: fix xattr deadlock Greg KH
2008-12-03 19:56 ` [patch 090/104] ext4: Free ext4_prealloc_space using kmem_cache_free Greg KH
2008-12-03 19:56 ` [patch 091/104] ext4: Do mballoc init before doing filesystem recovery Greg KH
2008-12-03 19:56 ` [patch 092/104] ext4: Fix duplicate entries returned from getdents() system call Greg KH
2008-12-03 19:56 ` [patch 093/104] jbd2: dont give up looking for space so easily in __jbd2_log_wait_for_space Greg KH
2008-12-03 19:56 ` [patch 094/104] ext4: Convert to host order before using the values Greg KH
2008-12-03 19:56 ` [patch 095/104] ext4: wait on all pending commits in ext4_sync_fs() Greg KH
2008-12-03 19:56 ` [patch 096/104] ext4: calculate journal credits correctly Greg KH
2008-12-03 19:56 ` [patch 097/104] ext4: Mark the buffer_heads as dirty and uptodate after prepare_write Greg KH
2008-12-03 19:56 ` [patch 098/104] ext4: add checksum calculation when clearing UNINIT flag in ext4_new_inode Greg KH
2008-12-03 19:56 ` [patch 099/104] ext3: fix ext3_dx_readdir hash collision handling Greg KH
2008-12-03 19:56 ` [patch 100/104] ext3: Fix duplicate entries returned from getdents() system call Greg KH
2008-12-03 19:56 ` [patch 101/104] ext3: dont try to resize if there are no reserved gdt blocks left Greg KH
2008-12-04 22:07 ` Valdis.Kletnieks
2008-12-03 19:56 ` [patch 102/104] ext2: fix ext2 block reservation early ENOSPC issue Greg KH
2008-12-03 19:56 ` [patch 103/104] ext3: fix ext3 " Greg KH
2008-12-03 19:56 ` [patch 104/104] jbd: ordered data integrity fix Greg KH
2008-12-03 21:39 ` [patch 000/104] 2.6.27-stable review Rafael J. Wysocki
2008-12-03 22:10 ` Michael Tokarev
2008-12-03 23:18 ` Rafael J. Wysocki
2008-12-05 0:33 ` Rafael J. Wysocki
2008-12-09 17:58 ` [stable] " Greg KH
2008-12-03 22:06 ` Michael Tokarev
2008-12-03 23:19 ` Greg KH
[not found] <bF63r-1nB-59@gated-at.bofh.it>
[not found] ` <bXmsS-4eW-1@gated-at.bofh.it>
[not found] ` <bXmMj-4HC-7@gated-at.bofh.it>
[not found] ` <bXqQ1-2GV-49@gated-at.bofh.it>
[not found] ` <bXxHH-5zl-23@gated-at.bofh.it>
[not found] ` <bXQqZ-1hm-9@gated-at.bofh.it>
[not found] ` <bYb2q-8bp-21@gated-at.bofh.it>
[not found] ` <bYchR-1AT-3@gated-at.bofh.it>
[not found] ` <bZ6Di-6ZV-1@gated-at.bofh.it>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081203194818.GD8950@kroah.com \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=cavokz@gmail.com \
--cc=cebbert@redhat.com \
--cc=chuckw@quantumlinux.com \
--cc=davej@redhat.com \
--cc=eteo@redhat.com \
--cc=inguin@gmx.de \
--cc=jake@lwn.net \
--cc=jmforbes@linuxtx.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkrufky@linuxtv.org \
--cc=rbranco@la.checkpoint.com \
--cc=rdunlap@xenotime.net \
--cc=reviews@ml.cw.f00f.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=w@1wt.eu \
--cc=zaitcev@redhat.com \
--cc=zwane@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox