Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2042980imm; Mon, 16 Jul 2018 00:45:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeA12E2i9CVWwgqsHOTmQGlib/qR9KqeE0uCo3yV1f4ANmOOH1SttnyC04UwVUPSMmCTS0x X-Received: by 2002:a63:6383:: with SMTP id x125-v6mr14537129pgb.127.1531727132419; Mon, 16 Jul 2018 00:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727132; cv=none; d=google.com; s=arc-20160816; b=hUNaeKlLA1lKXOzaKvQTOlNX8CjUI4QIvg0I6DxIU52xN40JmTuahjU3FwEkDGiSHq zOYmYLY1JpshgSOf4lWIBV4glUKokfoxGcdPi+wltLiVdhPu+0khGOgCLnoBkKpmK0Ze Ik/1Cglz9Sy7R5HeKNwObvADwbMfsnw1VdFcaYKKwsLRjMKFNq4vBJB0IVmDKW/HPLOw db+4CeGjx6QihULeuhHzGyLws6m9xoF9oCT2HDA8UYYIUY3Yt61N45cb9URpOs36K8DQ GWQ4j29iNiCgISVExyE0e1DI6dovfGSR5O7IaNO9l0hz1ioW3Xor27tgJRCO5Ycfv9Ta fIPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=GqJgbX520ELAAVJAKu41YWX1mm5kgc/2pq61sDS9yug=; b=dXc9k8ChscYOlentrpY2Ggh6svBnAuOSBxbaJg3gVhylXO1/AIPediFdwzp6taMCbD qN92HyZoRtjUKGLS1cNPW/zbuNjb4MRsOU+phW37+DSwmJ8r/MbEvORMX50pcVQkZONI 4Czvd0fTec4BlsjBaxtzlmbSJbOEcbr5ZNEPT17wcnjmIUKVB5qkZzVo5kIBB3q/SmPJ Mxpmbz0/u35s4Ygck4gIQFRrVvsO3ArEFDeGLng0FuJffDjS5TKhY0EeZmCBy2yRQHQG HEyuXMkAgogR/VAGhjC0QSOy3Cw3Dx0+wN1C6d5t/BUqi7sSGdW86WFadxjT8c7IWaJ9 cpZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g85-v6si34908261pfa.271.2018.07.16.00.45.17; Mon, 16 Jul 2018 00:45:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389233AbeGPIKF (ORCPT + 99 others); Mon, 16 Jul 2018 04:10:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48104 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388375AbeGPIKF (ORCPT ); Mon, 16 Jul 2018 04:10:05 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 549D8CA1; Mon, 16 Jul 2018 07:44:02 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter Subject: [PATCH 4.4 11/43] xhci: xhci-mem: off by one in xhci_stream_id_to_ring() Date: Mon, 16 Jul 2018 09:36:16 +0200 Message-Id: <20180716073513.014511963@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073511.796555857@linuxfoundation.org> References: <20180716073511.796555857@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter commit 313db3d6488bb03b61b99de9dbca061f1fd838e1 upstream. The > should be >= here so that we don't read one element beyond the end of the ep->stream_info->stream_rings[] array. Fixes: e9df17eb1408 ("USB: xhci: Correct assumptions about number of rings per endpoint.") Signed-off-by: Dan Carpenter Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -638,7 +638,7 @@ struct xhci_ring *xhci_stream_id_to_ring if (!ep->stream_info) return NULL; - if (stream_id > ep->stream_info->num_streams) + if (stream_id >= ep->stream_info->num_streams) return NULL; return ep->stream_info->stream_rings[stream_id]; }