android_kernel_motorola_sm6375/drivers/usb
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Forest Crossman e9d2ab8795 usb: mon: Increase BUFF_MAX to 64 MiB to support multi-MB URBs
[ Upstream commit 368ed48a5ef52e384f54d5809f0a0b79ac567479 ]

The usbmon binary interface currently truncates captures of large
transfers from higher-speed USB devices. Because a single event capture
is limited to one-fifth of the total buffer size, the current maximum
size of a captured URB is around 240 KiB. This is insufficient when
capturing traffic from modern devices that use transfers of several
hundred kilobytes or more, as truncated URBs can make it impossible for
user-space USB analysis tools like Wireshark to properly defragment and
reassemble higher-level protocol packets in the captured data.

The root cause of this issue is the 1200 KiB BUFF_MAX limit, which has
not been changed since the binary interface was introduced in 2006.

To resolve this issue, this patch increases BUFF_MAX to 64 MiB. The
original comment for BUFF_MAX based the limit's calculation on a
saturated 480 Mbit/s bus. Applying the same logic to a modern USB 3.2
Gen 2×2 20 Gbit/s bus (~2500 MB/s over a 20ms window) indicates the
buffer should be at least 50 MB. The new limit of 64 MiB covers that,
plus a little extra for any overhead.

With this change, both users and developers should now be able to debug
and reverse engineer modern USB devices even when running unmodified
distro kernels.

Please note that this change does not affect the default buffer size. A
larger buffer is only allocated when a user explicitly requests it via
the MON_IOCT_RING_SIZE ioctl, so the change to the maximum buffer size
should not unduly increase memory usage for users that don't
deliberately request a larger buffer.

Link: https://lore.kernel.org/CAO3ALPzdUkmMr0YMrODLeDSLZqNCkWcAP8NumuPHLjNJ8wC1kQ@mail.gmail.com
Signed-off-by: Forest Crossman <cyrozap@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/CAO3ALPxU5RzcoueC454L=WZ1qGMfAcnxm+T+p+9D8O9mcrUbCQ@mail.gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-12-03 12:45:12 +01:00
..
atm usb: atm: cxacru: Merge cxacru_upload_firmware() into cxacru_heavy_init() 2025-08-28 16:21:30 +02:00
c67x00
cdns3 usb: cdns3: Fix deadlock when using NCM gadget 2025-05-02 07:39:27 +02:00
chipidea usb: chipidea: udc: fix sleeping function called from invalid context 2025-08-28 16:21:22 +02:00
class cdc-acm: fix race between initial clearing halt and open 2025-08-28 16:21:34 +02:00
common
core usb/core/quirks: Add Huawei ME906S to wakeup quirk 2025-10-29 14:00:00 +01:00
dwc2
dwc3 usb: dwc3: Ignore late xferNotReady event to prevent halt timeout 2025-08-28 16:21:32 +02:00
early usb: early: xhci-dbc: Fix early_ioremap leak 2025-08-28 16:21:19 +02:00
gadget usb: gadget: f_hid: Fix zero length packet transfer 2025-12-03 12:45:11 +01:00
host xhci: dbc: enable back DbC in resume if it was enabled before suspend 2025-10-29 14:00:00 +01:00
image
isp1760
misc
mon usb: mon: Increase BUFF_MAX to 64 MiB to support multi-MB URBs 2025-12-03 12:45:12 +01:00
mtu3
musb usb: musb: omap2430: fix device leak at unbind 2025-08-28 16:21:35 +02:00
phy usb: phy: twl6030: Fix incorrect type for ret 2025-10-29 13:59:47 +01:00
renesas_usbhs usb: renesas_usbhs: Reorder clock handling and power management in probe 2025-06-27 11:02:48 +01:00
roles
serial USB: serial: option: add Telit FN920C04 ECM compositions 2025-10-29 14:00:00 +01:00
storage USB: storage: Ignore driver CD mode for Realtek multi-mode Wi-Fi dongles 2025-08-28 16:21:32 +02:00
typec usb: typec: fusb302: cache PD RX state 2025-08-28 16:21:34 +02:00
usbip usb: vhci-hcd: Prevent suspending virtually attached devices 2025-10-29 13:59:49 +01:00
Kconfig
Makefile
usb-skeleton.c