linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, "Bjørn Mork" <bjorn@mork.no>,
	"Jakub Kicinski" <jakub.kicinski@netronome.com>
Subject: [PATCH 4.9 032/129] usbnet: ignore endpoints with invalid wMaxPacketSize
Date: Thu,  3 Oct 2019 17:52:35 +0200	[thread overview]
Message-ID: <20191003154333.680194033@linuxfoundation.org> (raw)
In-Reply-To: <20191003154318.081116689@linuxfoundation.org>

From: Bjørn Mork <bjorn@mork.no>

[ Upstream commit 8d3d7c2029c1b360f1a6b0a2fca470b57eb575c0 ]

Endpoints with zero wMaxPacketSize are not usable for transferring
data. Ignore such endpoints when looking for valid in, out and
status pipes, to make the drivers more robust against invalid and
meaningless descriptors.

The wMaxPacketSize of these endpoints are used for memory allocations
and as divisors in many usbnet minidrivers. Avoiding zero is therefore
critical.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/usb/usbnet.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -114,6 +114,11 @@ int usbnet_get_endpoints(struct usbnet *
 			int				intr = 0;
 
 			e = alt->endpoint + ep;
+
+			/* ignore endpoints which cannot transfer data */
+			if (!usb_endpoint_maxp(&e->desc))
+				continue;
+
 			switch (e->desc.bmAttributes) {
 			case USB_ENDPOINT_XFER_INT:
 				if (!usb_endpoint_dir_in(&e->desc))



  parent reply	other threads:[~2019-10-03 16:01 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 15:52 [PATCH 4.9 000/129] 4.9.195-stable review Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 001/129] Revert "Bluetooth: validate BLE connection interval updates" Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 002/129] IB/core: Add an unbound WQ type to the new CQ API Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 003/129] HID: prodikeys: Fix general protection fault during probe Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 004/129] HID: logitech: Fix general protection fault caused by Logitech driver Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 005/129] HID: hidraw: Fix invalid read in hidraw_ioctl Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 006/129] mtd: cfi_cmdset_0002: Use chip_good() to retry in do_write_oneword() Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 007/129] crypto: talitos - fix missing break in switch statement Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 008/129] media: tvp5150: fix switch exit in set control handler Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 009/129] ASoC: fsl: Fix of-node refcount unbalance in fsl_ssi_probe_from_dt() Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 010/129] ALSA: hda - Add laptop imic fixup for ASUS M9V laptop Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 011/129] objtool: Clobber user CFLAGS variable Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 012/129] mac80211: Print text for disassociation reason Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 013/129] mac80211: handle deauthentication/disassociation from TDLS peer Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 014/129] power: supply: sysfs: ratelimit property read error message Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 015/129] locking/lockdep: Add debug_locks check in __lock_downgrade() Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 016/129] irqchip/gic-v3-its: Fix LPI release for Multi-MSI devices Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 017/129] f2fs: check all the data segments against all node ones Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 018/129] Revert "f2fs: avoid out-of-range memory access" Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 019/129] f2fs: fix to do sanity check on segment bitmap of LFS curseg Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 020/129] drm: Flush output polling on shutdown Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 021/129] xfs: dont crash on null attr fork xfs_bmapi_read Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 022/129] Bluetooth: btrtl: Additional Realtek 8822CE Bluetooth devices Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 023/129] arcnet: provide a buffer big enough to actually receive packets Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 024/129] cdc_ncm: fix divide-by-zero caused by invalid wMaxPacketSize Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 025/129] macsec: drop skb sk before calling gro_cells_receive Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 026/129] net/phy: fix DP83865 10 Mbps HDX loopback disable function Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 027/129] net: qrtr: Stop rx_worker before freeing node Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 028/129] openvswitch: change type of UPCALL_PID attribute to NLA_UNSPEC Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 029/129] ppp: Fix memory leak in ppp_write Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 030/129] sch_netem: fix a divide by zero in tabledist() Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 031/129] skge: fix checksum byte order Greg Kroah-Hartman
2019-10-03 15:52 ` Greg Kroah-Hartman [this message]
2019-10-03 15:52 ` [PATCH 4.9 033/129] usbnet: sanity checking of packet sizes and device mtu Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 034/129] mISDN: enforce CAP_NET_RAW for raw sockets Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 035/129] appletalk: " Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 036/129] ax25: " Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 037/129] ieee802154: " Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 038/129] nfc: " Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 039/129] ALSA: hda: Flush interrupts on disabling Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 040/129] regulator: lm363x: Fix off-by-one n_voltages for lm3632 ldo_vpos/ldo_vneg Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 041/129] ASoC: sgtl5000: Fix charge pump source assignment Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 042/129] dmaengine: bcm2835: Print error in case setting DMA mask fails Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 043/129] leds: leds-lp5562 allow firmware files up to the maximum length Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 044/129] media: dib0700: fix link error for dibx000_i2c_set_speed Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 045/129] media: exynos4-is: fix leaked of_node references Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 046/129] media: hdpvr: Add device num check and handling Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 047/129] sched/fair: Fix imbalance due to CPU affinity Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 048/129] sched/core: Fix CPU controller for !RT_GROUP_SCHED Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 049/129] x86/reboot: Always use NMI fallback when shutdown via reboot vector IPI fails Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 050/129] x86/apic: Soft disable APIC before initializing it Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 051/129] ALSA: hda - Show the fatal CORB/RIRB error more clearly Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 052/129] ALSA: i2c: ak4xxx-adda: Fix a possible null pointer dereference in build_adc_controls() Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 053/129] media: iguanair: add sanity checks Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 054/129] base: soc: Export soc_device_register/unregister APIs Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 055/129] ALSA: usb-audio: Skip bSynchAddress endpoint check if it is invalid Greg Kroah-Hartman
2019-10-03 15:52 ` [PATCH 4.9 056/129] ia64:unwind: fix double free for mod->arch.init_unw_table Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 057/129] EDAC/altera: Use the proper type for the IRQ status bits Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 058/129] md: dont call spare_active in md_reap_sync_thread if all member devices cant work Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 059/129] md: dont set In_sync if array is frozen Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 060/129] efi: cper: print AER info of PCIe fatal error Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 061/129] media: gspca: zero usb_buf on error Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 062/129] dmaengine: iop-adma: use correct printk format strings Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 063/129] media: omap3isp: Dont set streaming state on random subdevs Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 064/129] net: lpc-enet: fix printk format strings Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 065/129] ARM: dts: imx7d: cl-som-imx7: make ethernet work again Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 066/129] media: radio/si470x: kill urb on error Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 067/129] media: hdpvr: add terminating 0 at end of string Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 068/129] media: dvb-core: fix a memory leak bug Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 069/129] PM / devfreq: passive: Use non-devm notifiers Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 070/129] PM / devfreq: exynos-bus: Correct clock enable sequence Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 071/129] media: saa7146: add cleanup in hexium_attach() Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 072/129] media: cpia2_usb: fix memory leaks Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 073/129] media: saa7134: fix terminology around saa7134_i2c_eeprom_md7134_gate() Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 074/129] media: ov9650: add a sanity check Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 075/129] ACPI / CPPC: do not require the _PSD method Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 076/129] arm64: kpti: ensure patched kernel text is fetched from PoU Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 077/129] nvmet: fix data units read and written counters in SMART log Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 078/129] iommu/amd: Silence warnings under memory pressure Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 079/129] libtraceevent: Change users plugin directory Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 080/129] ARM: dts: exynos: Mark LDO10 as always-on on Peach Pit/Pi Chromebooks Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 081/129] ACPI: custom_method: fix memory leaks Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 082/129] ACPI / PCI: fix acpi_pci_irq_enable() memory leak Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 083/129] hwmon: (acpi_power_meter) Change log level for unsafe software power cap Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 084/129] md/raid1: fail run raid1 array when active disk less than one Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 085/129] dmaengine: ti: edma: Do not reset reserved paRAM slots Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 086/129] kprobes: Prohibit probing on BUG() and WARN() address Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 087/129] s390/crypto: xts-aes-s390 fix extra run-time crypto self tests finding Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 088/129] ASoC: dmaengine: Make the pcm->name equal to pcm->id if the name is not set Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 089/129] mmc: sdhci: Fix incorrect switch to HS mode Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 090/129] libertas: Add missing sentinel at end of if_usb.c fw_table Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 091/129] e1000e: add workaround for possible stalled packet Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 092/129] drm/amd/powerplay/smu7: enforce minimal VBITimeout (v2) Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 093/129] media: ttusb-dec: Fix info-leak in ttusb_dec_send_command() Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 094/129] ALSA: hda/realtek - Blacklist PC beep for Lenovo ThinkCentre M73/93 Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 095/129] btrfs: extent-tree: Make sure we only allocate extents from block groups with the same type Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 096/129] media: omap3isp: Set device on omap3isp subdevs Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 097/129] PM / devfreq: passive: fix compiler warning Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 098/129] ALSA: firewire-tascam: handle error code when getting current source of clock Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 099/129] ALSA: firewire-tascam: check intermediate state of clock status and retry Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 100/129] IB/hfi1: Define variables as unsigned long to fix KASAN warning Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 101/129] printk: remove games with previous record flags Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 102/129] printk: Do not lose last line in kmsg buffer dump Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 103/129] fuse: fix missing unlock_page in fuse_writepage() Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 104/129] parisc: Disable HP HSC-PCI Cards to prevent kernel crash Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 105/129] KVM: x86: always stop emulation on page fault Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 106/129] KVM: x86: set ctxt->have_exception in x86_decode_insn() Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 107/129] KVM: x86: Manually calculate reserved bits when loading PDPTRS Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 108/129] media: sn9c20x: Add MSI MS-1039 laptop to flip_dmi_table Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 109/129] ASoC: Intel: NHLT: Fix debug print format Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 110/129] ASoC: Intel: Fix use of potentially uninitialized variable Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 111/129] ARM: zynq: Use memcpy_toio instead of memcpy on smp bring-up Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 112/129] alarmtimer: Use EOPNOTSUPP instead of ENOTSUPP Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 113/129] regulator: Defer init completion for a while after late_initcall Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 114/129] memcg, kmem: do not fail __GFP_NOFAIL charges Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 115/129] ovl: filter of trusted xattr results in audit Greg Kroah-Hartman
2019-10-03 15:53 ` [PATCH 4.9 116/129] Btrfs: fix use-after-free when using the tree modification log Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 117/129] btrfs: Relinquish CPUs in btrfs_compare_trees Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 118/129] md/raid6: Set R5_ReadError when there is read failure on parity disk Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 119/129] cfg80211: Purge frame registrations on iftype change Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 120/129] /dev/mem: Bail out upon SIGKILL Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 121/129] ext4: fix warning inside ext4_convert_unwritten_extents_endio Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 122/129] ext4: fix punch hole for inline_data file systems Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 123/129] quota: fix wrong condition in is_quota_modification() Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 124/129] hwrng: core - dont wait on add_early_randomness() Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 125/129] i2c: riic: Clear NACK in tend isr Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 126/129] CIFS: fix max ea value size Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 127/129] CIFS: Fix oplock handling for SMB 2.1+ protocols Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 128/129] btrfs: qgroup: Drop quota_root and fs_info parameters from update_qgroup_status_item Greg Kroah-Hartman
2019-10-03 15:54 ` [PATCH 4.9 129/129] Btrfs: fix race setting up and completing qgroup rescan workers Greg Kroah-Hartman
2019-10-03 23:53 ` [PATCH 4.9 000/129] 4.9.195-stable review shuah
2019-10-04  7:01 ` kernelci.org bot
2019-10-04  7:37 ` Jon Hunter
2019-10-04 15:07 ` Dan Rue
2019-10-04 22:56 ` Guenter Roeck

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=20191003154333.680194033@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=bjorn@mork.no \
    --cc=jakub.kicinski@netronome.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).