Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3298004ybb; Tue, 31 Mar 2020 02:21:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuGHKtdUlUOlFtZG9xz8FqggDpRksqmv2jk1JnLC90DOwT75A10KpqC0IKvzGCHkOpR5psc X-Received: by 2002:a4a:9c86:: with SMTP id z6mr12903103ooj.68.1585646518519; Tue, 31 Mar 2020 02:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585646518; cv=none; d=google.com; s=arc-20160816; b=PpokXFNsUiMvf+mW/oDcaEfogtj+RzLbGTOZulV8h7fhSo0LudLyZJtJgzXrQzczRn I5QTR2o73BA6DmVsaRsBNeT34QoRS3I8kRO2RI+x6nIMSWu/UYarm2W4QinGc4zX6RUT 4+qZwOR5jY3fqloN0W5GG7vrqkh7DPAxMCy5lNbbHAGMb2qRFCMn2BFHLamIo3riBNk4 O9e0wkalHOoPp/kmn2U/W2MzxhF3Uhgqry4jbgIjtEJGha2hb4OCv8FGd/nBE6ZToG4m RjrmNTkQ0oqi2J55g9XJ6XWonT4l7riknLRKC7+E08EZhOmVaVYhSzadfqGc0v/bphxN I7lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vpQ/YZlAcpwO/AHej5swCoQ6gPvIgjyIPin3V38Upik=; b=mgujrPmI+NEEZHqs+sCGlCrN72X3FA9BlebmuhVm87k8Wu+jKavhdEP7ASXG5U6NyN mZvHudnQTCAtlLXF8xN6m/b29HxOh7i7zXxfJ7A2UQ4pklxGtfAd9phGBaddsdG0+SxQ lDWJisQbt01MSbRDOH/pJ2cI/+1CPb7J6/6KrVTiNeNVVuiKtBk3Cb3TjUVM2cnXLnQd D2C3OHKHN2k9SJvpnJRe1b7zuBusAm6wgSU5Z/9N5k7efLyvcf1tVd+eKqU2GnuJa7yn vfnRXvSuHbZslYMK5aolhbst2HqkxMCIE/mbFOrq1KfFPS4/8HfUa3zkByK0qSBmGpK1 alfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PmA+zrc6; 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 c67si7440318oif.5.2020.03.31.02.21.46; Tue, 31 Mar 2020 02:21:58 -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; dkim=pass header.i=@kernel.org header.s=default header.b=PmA+zrc6; 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 S1731100AbgCaJVA (ORCPT + 99 others); Tue, 31 Mar 2020 05:21:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:54366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731579AbgCaJKc (ORCPT ); Tue, 31 Mar 2020 05:10:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C2FE1208E0; Tue, 31 Mar 2020 09:10:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645831; bh=Gyq5CPIWhGyETl7u146YtvZnj20MLETTWKjndr0vl/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PmA+zrc6B8Hok9yuq44PqoyjzOcojHbxy4lJg6vdbavH/g06VYwlkQBqKBOBDoYPB 8lUMI7NYqgSKLLQL5xLCW70LgVzAH1C5mMPg97FZkKs1gCTsVhT2vr+DXxD6V8b8vc m9sULjtc9oZINJzsvi9yBxbyMwcAk4vi7Eq/1rmo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiujun Huang , Johan Hovold , syzbot+37ba33391ad5f3935bbd@syzkaller.appspotmail.com Subject: [PATCH 5.5 153/170] USB: serial: io_edgeport: fix slab-out-of-bounds read in edge_interrupt_callback Date: Tue, 31 Mar 2020 10:59:27 +0200 Message-Id: <20200331085439.348229781@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qiujun Huang commit 57aa9f294b09463492f604feaa5cc719beaace32 upstream. Fix slab-out-of-bounds read in the interrupt-URB completion handler. The boundary condition should be (length - 1) as we access data[position + 1]. Reported-and-tested-by: syzbot+37ba33391ad5f3935bbd@syzkaller.appspotmail.com Signed-off-by: Qiujun Huang Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/io_edgeport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -710,7 +710,7 @@ static void edge_interrupt_callback(stru /* grab the txcredits for the ports if available */ position = 2; portNumber = 0; - while ((position < length) && + while ((position < length - 1) && (portNumber < edge_serial->serial->num_ports)) { txCredits = data[position] | (data[position+1] << 8); if (txCredits) {