Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1518532ybb; Thu, 26 Mar 2020 02:15:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvj0CmGpYEzEqSO428CgMqHc/t+BwzZNCpg56cJa9YDgY7iUF3YH8Fm3V41I1X+l40QJQcV X-Received: by 2002:a9d:6f07:: with SMTP id n7mr5299316otq.247.1585214109130; Thu, 26 Mar 2020 02:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585214109; cv=none; d=google.com; s=arc-20160816; b=ypYHwT8oZP5Y4aL8o7x+nZM4LCuSp9YEtx6+TWyouB2AtscBVI3YbR3ZI1QzH3INOk hp9+sZjv+z6fQsJ70vAFJTOYaRAXVB5VuTrK2YATbs4mfeEYTXWUjvQaLVhmLz6mJX0e XXj8C3oTSPDC5Y5up9tW/3TnZ3985swF5wp/XHLW3It+QC9Ju6pNfgskvRz01O7HYEJ9 blm84EQVWuUBWa96pD7qT+tc6pHnFy5RDHs2eV3zXhFmYslg7/9P36o6obgoQHJtE44r xIxHSeilRGJzJCnvZSXU4yOPZjrYqVbJygmxI0nHFbJonBgngewvX5y7tJCDii6gNnzv uuBg== 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:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=uyyUQXlsRxfomovzXi3a4kjq7QvbeI6bqADRdDoCJDI=; b=0IsKVlM0iqS2xrQa5pPkFkU6ZLr/2VxuOPG/3wDRvPWzhG6YbrSm8+0/WQvZisIYs4 YHGmSPJ6FWTbGkmxI+evVNT4Sk6VrWYXxl0trvWPBu6gpP9+OtgZxzBymjQrYpIiVVsR 6kcI1hWixcm4mP3a2otNvU8YXaTdu1gEU24y3DnnV58jh7F2vuZGQxcnlHwM6pJKrc52 HL4Io4FeWyv2kBEaeDh3HpCchHqoHUXslZ2eaZx2gW95GkbzcBiIYFVXVUyNrRHFXIm0 9FsJdvU6QwKDQwoxqKqG9aUROXnck61mTi3iDegjRKgsCHdhXz0IRyKYhUxcELscJ9+r airg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si780729oia.194.2020.03.26.02.14.56; Thu, 26 Mar 2020 02:15:09 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727798AbgCZJNm (ORCPT + 99 others); Thu, 26 Mar 2020 05:13:42 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:37615 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726318AbgCZJNm (ORCPT ); Thu, 26 Mar 2020 05:13:42 -0400 Received: by mail-lj1-f194.google.com with SMTP id r24so5605391ljd.4; Thu, 26 Mar 2020 02:13:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uyyUQXlsRxfomovzXi3a4kjq7QvbeI6bqADRdDoCJDI=; b=HVKfRzPKtNDSQgCAR0UEGnT2sOseBT6bcZ5+yHkrlfNjglJKRx7UfnRIbLrAhcZWHh 0aagsu8xKRbTXM/TV5AQupc8DkhVw8toHDUTk3tAIHWmlTOEjt4eOqDKavFeJQpDKQPx /m9OSiqtWGNXxo7TWMNICqRZynNvf6eYG3Egm464IlQmemUVUuCui9ezTCvYoRvfwmNx gIKi78cnGCDJGLRRUPCghUqqOCerqMm//u3aSb07pjvIICL2yCb/zSPvpFCu7MFnQ5rs XdYyazUmREdP6sFZeyy/1P5bEO5yPWVerVGG1i7IMw7sJvLrbNi3BT7aq3CFRlvsuyh8 A+FA== X-Gm-Message-State: AGi0Pub7hJvNQU8GGFs9myMetFU5xInxChM3LsKHQ5L9V+QcbsgwZWBH gpu8QwNjI2ICOfxiNn/xx14= X-Received: by 2002:a2e:8316:: with SMTP id a22mr2062884ljh.70.1585214019931; Thu, 26 Mar 2020 02:13:39 -0700 (PDT) Received: from xi.terra (c-12aae455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.170.18]) by smtp.gmail.com with ESMTPSA id f2sm1036510ljn.101.2020.03.26.02.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 02:13:39 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.3) (envelope-from ) id 1jHOZq-0003Cl-Gx; Thu, 26 Mar 2020 10:13:26 +0100 Date: Thu, 26 Mar 2020 10:13:26 +0100 From: Johan Hovold To: Greg KH Cc: Qiujun Huang , johan@kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, anenbupt@gmail.com Subject: Re: [PATCH] USB: io_edgeport: fix slab-out-of-bounds Read in edge_interrupt_callback Message-ID: <20200326091326.GD4899@localhost> References: <1585122757-4528-1-git-send-email-hqjagain@gmail.com> <20200326081433.GA979574@kroah.com> <20200326082117.GC4899@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200326082117.GC4899@localhost> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2020 at 09:21:17AM +0100, Johan Hovold wrote: > On Thu, Mar 26, 2020 at 09:14:33AM +0100, Greg Kroah-Hartman wrote: > > On Wed, Mar 25, 2020 at 03:52:37PM +0800, Qiujun Huang wrote: > > > 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 > > > --- > > > drivers/usb/serial/io_edgeport.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c > > > index 5737add..4cca0b8 100644 > > > --- a/drivers/usb/serial/io_edgeport.c > > > +++ b/drivers/usb/serial/io_edgeport.c > > > @@ -710,7 +710,7 @@ static void edge_interrupt_callback(struct urb *urb) > > > /* 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) { > > > -- > > > 1.8.3.1 > > > > > > > Johan, any objection from me taking this in my tree now? > > Just let me take a look at it first. > > Are sending another PR to Linus for 5.6? Otherwise I can include this > in my 5.7 PR to you. Will try to get it to you today. This issue predates git so I'd add Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Acked-by: Johan Hovold if you want to take it yourself. Just let me know, otherwise I'll include in my PR. Johan