stable.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,
	Masakazu Mokuno <masakazu.mokuno@gmail.com>,
	Mathias Nyman <mathias.nyman@linux.intel.com>
Subject: [PATCH 4.9 67/75] USB: Fix off by one in type-specific length check of BOS SSP capability
Date: Mon,  1 Jan 2018 15:32:44 +0100	[thread overview]
Message-ID: <20180101140107.638781095@linuxfoundation.org> (raw)
In-Reply-To: <20180101140056.475827799@linuxfoundation.org>

4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mathias Nyman <mathias.nyman@linux.intel.com>

commit 07b9f12864d16c3a861aef4817eb1efccbc5d0e6 upstream.

USB 3.1 devices are not detected as 3.1 capable since 4.15-rc3 due to a
off by one in commit 81cf4a45360f ("USB: core: Add type-specific length
check of BOS descriptors")

It uses USB_DT_USB_SSP_CAP_SIZE() to get SSP capability size which takes
the zero based SSAC as argument, not the actual count of sublink speed
attributes.

USB3 spec 9.6.2.5 says "The number of Sublink Speed Attributes = SSAC + 1."

The type-specific length check patch was added to stable and needs to be
fixed there as well

Fixes: 81cf4a45360f ("USB: core: Add type-specific length check of BOS descriptors")
CC: Masakazu Mokuno <masakazu.mokuno@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/core/config.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -1002,7 +1002,7 @@ int usb_get_bos_descriptor(struct usb_de
 		case USB_SSP_CAP_TYPE:
 			ssp_cap = (struct usb_ssp_cap_descriptor *)buffer;
 			ssac = (le32_to_cpu(ssp_cap->bmAttributes) &
-				USB_SSP_SUBLINK_SPEED_ATTRIBS) + 1;
+				USB_SSP_SUBLINK_SPEED_ATTRIBS);
 			if (length >= USB_DT_USB_SSP_CAP_SIZE(ssac))
 				dev->bos->ssp_cap = ssp_cap;
 			break;

  parent reply	other threads:[~2018-01-01 14:32 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01 14:31 [PATCH 4.9 00/75] 4.9.74-stable review Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 01/75] sync objtools copy of x86-opcode-map.txt Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 02/75] tracing: Remove extra zeroing out of the ring buffer page Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 03/75] tracing: Fix possible double free on failure of allocating trace buffer Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 04/75] tracing: Fix crash when it fails to alloc ring buffer Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 05/75] ring-buffer: Mask out the info bits when returning buffer page length Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 06/75] iw_cxgb4: Only validate the MSN for successful completions Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 07/75] ASoC: wm_adsp: Fix validation of firmware and coeff lengths Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 08/75] ASoC: da7218: fix fix child-node lookup Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 09/75] ASoC: fsl_ssi: AC97 ops need regmap, clock and cleaning up on failure Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 10/75] ASoC: twl4030: fix child-node lookup Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 11/75] ASoC: tlv320aic31xx: Fix GPIO1 register definition Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 12/75] ALSA: hda: Drop useless WARN_ON() Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 13/75] ALSA: hda - fix headset mic detection issue on a Dell machine Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 14/75] x86/vm86/32: Switch to flush_tlb_mm_range() in mark_screen_rdonly() Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 15/75] x86/mm: Remove flush_tlb() and flush_tlb_current_task() Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 16/75] x86/mm: Make flush_tlb_mm_range() more predictable Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 17/75] x86/mm: Reimplement flush_tlb_page() using flush_tlb_mm_range() Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 18/75] x86/mm: Remove the UP asm/tlbflush.h code, always use the (formerly) SMP code Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 19/75] x86/mm: Disable PCID on 32-bit kernels Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 20/75] x86/mm: Add the nopcid boot option to turn off PCID Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 21/75] x86/mm: Enable CR4.PCIDE on supported systems Greg Kroah-Hartman
2018-01-01 14:31 ` [PATCH 4.9 22/75] x86/mm/64: Fix reboot interaction with CR4.PCIDE Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 25/75] ipv6: mcast: better catch silly mtu values Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 26/75] net: fec: unmap the xmit buffer that are not transferred by DMA Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 27/75] net: igmp: Use correct source address on IGMPv3 reports Greg Kroah-Hartman
2018-01-16  3:50   ` Sebastian Gottschall
2018-01-16  3:58     ` Kevin Cernekee
2018-01-16  4:26       ` Sebastian Gottschall
2018-01-16  4:32         ` Kevin Cernekee
2018-01-16  4:44           ` Sebastian Gottschall
2018-01-16  5:16             ` Kevin Cernekee
2018-01-16  9:18               ` Sebastian Gottschall
2018-01-16 15:31                 ` Kevin Cernekee
2018-01-16 15:40                   ` Sebastian Gottschall
2018-01-16  9:21               ` Sebastian Gottschall
2018-01-16  4:55     ` Sebastian Gottschall
2018-01-16  5:55     ` Greg Kroah-Hartman
2018-01-16  7:34       ` Sebastian Gottschall
2018-01-16  8:15         ` Greg Kroah-Hartman
2018-01-16 15:25     ` David Miller
2018-01-16 15:34       ` Sebastian Gottschall
2018-01-01 14:32 ` [PATCH 4.9 28/75] netlink: Add netns check on taps Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 30/75] net: reevalulate autoflowlabel setting after sysctl setting Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 31/75] ptr_ring: add barriers Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 32/75] RDS: Check cmsg_len before dereferencing CMSG_DATA Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 33/75] tcp_bbr: record "full bw reached" decision in new full_bw_reached bit Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 34/75] tcp md5sig: Use skbs saddr when replying to an incoming segment Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 35/75] tg3: Fix rx hang on MTU change with 5717/5719 Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 36/75] net: ipv4: fix for a race condition in raw_sendmsg Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 37/75] net: mvmdio: disable/unprepare clocks in EPROBE_DEFER case Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 38/75] sctp: Replace use of sockets_allocated with specified macro Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 39/75] adding missing rcu_read_unlock in ipxip6_rcv Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 40/75] ipv4: Fix use-after-free when flushing FIB tables Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 41/75] net: bridge: fix early call to br_stp_change_bridge_id and plug newlink leaks Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 42/75] net: fec: Allow reception of frames bigger than 1522 bytes Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 43/75] net: Fix double free and memory corruption in get_net_ns_by_id() Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 44/75] net: phy: micrel: ksz9031: reconfigure autoneg after phy autoneg workaround Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 45/75] sock: free skb in skb_complete_tx_timestamp on error Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 46/75] tcp: invalidate rate samples during SACK reneging Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 47/75] net/mlx5: Fix rate limit packet pacing naming and struct Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 48/75] net/mlx5e: Fix features check of IPv6 traffic Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 49/75] net/mlx5e: Fix possible deadlock of VXLAN lock Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 50/75] net/mlx5e: Add refcount to VXLAN structure Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 51/75] net/mlx5e: Prevent possible races in VXLAN control flow Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 52/75] net/mlx5: Fix error flow in CREATE_QP command Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 53/75] s390/qeth: apply takeover changes when mode is toggled Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 54/75] s390/qeth: dont apply takeover changes to RXIP Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 55/75] s390/qeth: lock IP table while applying takeover changes Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 56/75] s390/qeth: update takeover IPs after configuration change Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 57/75] usbip: fix usbip bind writing random string after command in match_busid Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 58/75] usbip: prevent leaking socket pointer address in messages Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 59/75] usbip: stub: stop printing kernel pointer addresses " Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 60/75] usbip: vhci: " Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 61/75] USB: serial: ftdi_sio: add id for Airbus DS P8GR Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 63/75] USB: serial: option: add support for Telit ME910 PID 0x1101 Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 65/75] usb: Add device quirk for Logitech HD Pro Webcam C925e Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 66/75] usb: add RESET_RESUME for ELSA MicroLink 56K Greg Kroah-Hartman
2018-01-01 14:32 ` Greg Kroah-Hartman [this message]
2018-01-01 14:32 ` [PATCH 4.9 68/75] usb: xhci: Add XHCI_TRUST_TX_LENGTH for Renesas uPD720201 Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 69/75] timers: Use deferrable base independent of base::nohz_active Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 70/75] timers: Invoke timer_start_debug() where it makes sense Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 71/75] timers: Reinitialize per cpu bases on hotplug Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 72/75] nohz: Prevent a timer interrupt storm in tick_nohz_stop_sched_tick() Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 73/75] x86/smpboot: Remove stale TLB flush invocations Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 74/75] n_tty: fix EXTPROC vs ICANON interaction with TIOCINQ (aka FIONREAD) Greg Kroah-Hartman
2018-01-01 14:32 ` [PATCH 4.9 75/75] tty: fix tty_ldisc_receive_buf() documentation Greg Kroah-Hartman
2018-01-01 20:38 ` [PATCH 4.9 00/75] 4.9.74-stable review Naresh Kamboju
2018-01-02 16:49 ` Guenter Roeck
2018-01-02 18:22   ` Greg Kroah-Hartman
2018-01-02 16:57 ` Neal Cardwell
2018-01-02 18:21   ` Greg Kroah-Hartman
2018-01-02 18:32   ` David Miller
2018-01-02 19:11     ` Neal Cardwell
2018-01-02 19:12       ` David Miller
2018-01-02 20:08       ` Greg KH
2018-01-02 22:31         ` Neal Cardwell
2018-01-02 22:23 ` Shuah Khan

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=20180101140107.638781095@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masakazu.mokuno@gmail.com \
    --cc=mathias.nyman@linux.intel.com \
    --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).