Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3335074imu; Sun, 11 Nov 2018 12:37:40 -0800 (PST) X-Google-Smtp-Source: AJdET5e5zNBkl6n5vvWfuMfR7AT/E6slZ9K6lW9sQvMgIpGiXEjPuPSq4ighyuqLlPPX2S55lFMR X-Received: by 2002:a63:a35c:: with SMTP id v28mr14990555pgn.205.1541968660663; Sun, 11 Nov 2018 12:37:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968660; cv=none; d=google.com; s=arc-20160816; b=D1/ek8vkBUOT6VFqxVsmtBam275kFxH6rYaKpOJqpI9N46QSqOgihmiFs43z0AR42a i0yHF8j1kE9fF8l1hEke4Ul3e+SOkWdUq1eGC3c+GrnaovJUCYKSDyEMN/yP4D/S0Gmz Snl59Q6j11t0R2b4m00S6i7JEUZxn4JbTqqoGkc+bqE2X1DL10O/7F2n8wa6jUDGqErp qJVroL6t7t4fEx12dOChMGNaZTTrgQoyFS/k3LKl5On8X2u0cyVUIvFl+NEAO5JSYky0 f17rc3h/Tz9Ertx3ohwL4y5UClfeRlDQnVvACB11kVIxGnKj9CRPP9qbcpAzSk4HzQcw YRuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=6b2uxrld/KXQMeSqd9cLjSj0tmLFJjN2v1PTXbeyOKw=; b=wKLwXH68zwoi2oSALw6weE9bydxlSP5MeLYYnbA3J4M7GLItkigIFE1Hnd+rXWCBwY z2MgQEuIUB0iO9AEvV61Nax3Bpe3MlOTwxROSHn95VumdosOakmG3+WrgJu2gD2S75K6 CZ4lnV28+mVoCiw0rtbmQ3KlqPOf143PCLAlJ+qzIl8EKXzcQRCayfjKup2IIEly1usC 9ETnlnf6oFw6NdbMz7EuHsB6NIsRYvgTlOPRGln9x0BesbCiBE1gbRjvKdUJzLL4CBz1 5pCOuHSYriHNPCpZYjq8JXNqniC1IqFzjQIJSlwUzPs8Qtpkk/ZXld6ApzIx2udnWB0l IOMA== 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 f34si5324402pgm.318.2018.11.11.12.37.25; Sun, 11 Nov 2018 12:37:40 -0800 (PST) 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 S1730393AbeKLG0a (ORCPT + 99 others); Mon, 12 Nov 2018 01:26:30 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49792 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730082AbeKLFsL (ORCPT ); Mon, 12 Nov 2018 00:48:11 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsY-0000oG-8w; Sun, 11 Nov 2018 19:58:42 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsV-0001hq-Qo; Sun, 11 Nov 2018 19:58:39 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Greg Kroah-Hartman" , "Dan Carpenter" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 237/366] xhci: xhci-mem: off by one in xhci_stream_id_to_ring() In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Ben Hutchings --- 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]; }