Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2046794imm; Mon, 16 Jul 2018 00:51:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdoHDseYHCUk0pXWuvQu6bezSWRQvQYUaPyWCQoQX2itC5IQ+zk6/zDqzas+1leyBpPf+DX X-Received: by 2002:a63:c00b:: with SMTP id h11-v6mr14235502pgg.279.1531727492690; Mon, 16 Jul 2018 00:51:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531727492; cv=none; d=google.com; s=arc-20160816; b=lHsUlqUlkT8T8p0aeQ0mNpzGpbqG1VPoTz2uXEs1TWvQbPZFvrrdwYAc+U3W+leUSP KyDbmhnPjAvoiifNGMpoU9mOkvSEKa58QSbSOcVLRDgw6e5H//a3Z0Eza+xIbMBDqsKC YvXUYo4fzV9eSZJflYttWDQZgXD/7YX6/BmWePC6/qNoLOtrCEEZrnKWDyZnAZnXut1K U4XtZIOgjYGv4y543AxdDfCm3YizQLmZjoJhphNuDwMfTgIzYVSGSMFeqmk7KQ2uQx78 pieht0pAuKue+JKnzJxSPCxRiwWZ/zbrszLwascZ6wEEE0wO/0XubvprqrhQhOxj6q0T vZ2g== 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=37hT0GiwI9S4lbjNOBi6bbAQCBkBr7+iRMMoH3Me3/Y=; b=akjwWcP6sjCBj1eUM+YTUHJaBKGg5rD0Ep6kAenqKSF7TxKsf6hgO4BElhsbyrZ1WK Zva3T+SAksvMYEXSfbM+ANUlPFYLhbtcZN4B+20PO2QhSY0hGaCyjx3+pEpDNhRhUUsn YqVBjIQ3ToSssaI2cgbb9pR4sZZKcQkJC/0+24J5zpxtY56sDNH6G05T/6onjz+Prg2i VBTVQih9QLGQOcHEp6RmyTTH+PzWmkXKd1XwApj6nOS6ZCEq5rdlVqejm09Xd59yNa3u BPe7N9tAasN4b0/UABXbveQO4OeY91v2Udr2qicOf/Qb9uMIQJWAeYIG8t6c7QUEtQSe utsg== 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 65-v6si19401554pfe.49.2018.07.16.00.51.18; Mon, 16 Jul 2018 00:51: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 S2389126AbeGPIJr (ORCPT + 99 others); Mon, 16 Jul 2018 04:09:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48040 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388311AbeGPIJq (ORCPT ); Mon, 16 Jul 2018 04:09:46 -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 EEBF7C03; Mon, 16 Jul 2018 07:43:42 +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.9 17/32] xhci: xhci-mem: off by one in xhci_stream_id_to_ring() Date: Mon, 16 Jul 2018 09:36:25 +0200 Message-Id: <20180716073506.710782461@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073504.433996952@linuxfoundation.org> References: <20180716073504.433996952@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.9-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 @@ -650,7 +650,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]; }