Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2038697imm; Mon, 16 Jul 2018 00:39:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc6fGdIh8CxqgfvGo8uv5NMV2vfgUKv1amhgOfmX0gobWNOve9FKi6OwRV3gth2u9DhTmYx X-Received: by 2002:a17:902:4203:: with SMTP id g3-v6mr15449697pld.315.1531726760996; Mon, 16 Jul 2018 00:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531726760; cv=none; d=google.com; s=arc-20160816; b=pJnoNv5TC+vTZTHJ+URNozPk5sw+/hsqUjmTyTOSoUbezqkj2kXXuTGYKqjf9k9aMC SJPxo8AJLXVcqnH6D0WV+GM8jlnIsu0bhYwfMv5WFgzbKM7g33dAvqPSVlxHexigZTzP 7AnkuYvEtIdXEGOdpkU2N1JAcb1fZ+qbUR74oQiYuJRAl7TKqDDR5RJApXzI/KUrqM0E lDuxXf+luIimE9K6/owAVzgde0Gq1O7VvTjcG4Ex5T0Ek2zzH46/U8pM7WVHU6D3TAFm loxqrTngk5EisSLLN+0HaX5z1qqKyFoYqBZsB/WsjKuKgAhnGzjn2meAaI305R4Kgt++ 9ZyQ== 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=lEZoQWSU55MFIaLNwSsfOa+nnOEkPiduSIVwRScxBnk=; b=W39VszvJMuteQ/ZAC3++HNrYvle4I5/8r9T4jTUm8nQgaWuKMCC8FR1UneNqBnLAF8 MeUjQQ0jHFg2CtxT529S7pEkFY3fOdmgm9g4xYxrh3BPAFyuTJzPfKHv+5GMDhI1uhN6 bufLgO5q294APfAKZJgRVhQIFeENoELKcgS2sP6CbwkHSPVQIZJs/NRskhxIhu2ZWY1p RKaBvYIuz+06qNvYdlPv4S6gIWgvvhhNaWwIfHedzwO8Qt+hnXFEa/I0pTOSe/XboH+Z NU57JqX9F2Fi2MTMSPsMLdEXCyh/uBLYS/0zTYyb5UyudicbZjCNzBvYXdcdvSRDSvJo +yrg== 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 p3-v6si29962444pld.408.2018.07.16.00.39.06; Mon, 16 Jul 2018 00:39:20 -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 S1732033AbeGPID4 (ORCPT + 99 others); Mon, 16 Jul 2018 04:03:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46792 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728460AbeGPIDz (ORCPT ); Mon, 16 Jul 2018 04:03:55 -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 3098ACA0; Mon, 16 Jul 2018 07:37:54 +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.17 30/67] xhci: xhci-mem: off by one in xhci_stream_id_to_ring() Date: Mon, 16 Jul 2018 09:34:59 +0200 Message-Id: <20180716073447.900624911@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180716073443.294323458@linuxfoundation.org> References: <20180716073443.294323458@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.17-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 @@ -591,7 +591,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]; }