Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1482194ybb; Thu, 26 Mar 2020 01:23:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvybLyXVfHcU8dX2JCQbN9dyTXnvNdIPORZu9SjqlrPYYCYrsSv+7xLncByr6SpXjwNPxIM X-Received: by 2002:aca:3255:: with SMTP id y82mr1078145oiy.44.1585210990130; Thu, 26 Mar 2020 01:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585210990; cv=none; d=google.com; s=arc-20160816; b=090PwEdYH7bc0NhEL3SR4Y+mVgqxXM1iJxazfKLQIb6zWIvGgbhxK9w1qxFasCnkG9 iFMfajD4UlDwB2MrPHACNNF+0wB/kgZszKByObBpJxJY869PBsQbvZbZSWqWhfg+E8Kq Qkc7PtNoY5ltESuMF//uhiV0Waa8jBTiIgQkZOvx2YghKW3dNhwlo9BFT26euztGRwAA Nk2zTum9Y78H6X66FQGw6oJ8RE/nhtLtGDFYOFjFTL3OQchnqsh83dN98Ehr75fEuvDB ahqrMxdoC98N5iqbULCDcPQ85B2ssggk8BXkalA6iOwJoM9Im+cBSXwOz7n0ivCrfB9H BZ7A== 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=sVJJ788lIqUmQp6fGdmkgrlONPOf+ggU84FOgzg9/88=; b=J0FcUhgYR79qnWvZJdfMj00njvquE4M8TUO5MCZQRC/Mbcs10Vo66E/2sZ2cz88Wvt wlQ02zab7zWg8sOvjvzYVuU6udGZleijAgNOIDc/Hbti9peG/fRVEyG3qZQs7cy/rpM2 v5XNz5tQD6933wRAtp7EFv41lVxEGwMBvzAGXIKKOmvSNWxQLKGwUXqObiV6X9dXUWeu XcCGv/U509b9a7GqcQf+mr+CwTKL+Rr7/TmxFTwxr0HYZ5Ur4MfCXQOgD2HjrvNGUqEi gJU+8/rRU5ZCBVOqXp0+pHi+jWJW+k62EpuyZ0Ks0YWJY2j1He93YBXa+GodU0rgVWaS VAUQ== 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 h10si650945oih.231.2020.03.26.01.22.57; Thu, 26 Mar 2020 01:23:10 -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 S1727690AbgCZIVe (ORCPT + 99 others); Thu, 26 Mar 2020 04:21:34 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:42221 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbgCZIVe (ORCPT ); Thu, 26 Mar 2020 04:21:34 -0400 Received: by mail-lj1-f194.google.com with SMTP id q19so5397501ljp.9; Thu, 26 Mar 2020 01:21:32 -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=sVJJ788lIqUmQp6fGdmkgrlONPOf+ggU84FOgzg9/88=; b=JLyiIyboVwYWfFbcZZ7l/1pG5RtnQl55SL3K3wqGYoVhqQUGyfFPp4Dzwx6l3ve1zc JwQWriiW3DyxXRClKsBPIBvg2fKfV9Z4kFG32n4jVQNSneqSBjHiB0QcuDqdGPD/7fFk +xMz9mJcCMwShCPOc/7wcf6GgM1bRGGItxDs9FcVe5Qxl/azGm4K9Mc5oaoqYsMFDEnG ee/uPhzb3oXIFNm2X2jiK2IxBVarRBc93rcYuNzwnNWM5x2xsKnbiGPE9FEXl1MJSoix npEEu0XESu8Nnzegf8wgwtDA/uo+/6BP9XJrnWu6/1V9RSTzYi/fCXqkCSs0z6V76N4u wtLw== X-Gm-Message-State: ANhLgQ35mX3i8T3qcipFn3SDoPxkFqVGAYH4vMgmd7S9hGFHB4202UL6 n2QVhch8GlrZQFOR9xsylcw= X-Received: by 2002:a2e:9e8d:: with SMTP id f13mr4381812ljk.171.1585210891760; Thu, 26 Mar 2020 01:21:31 -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 j6sm966296lfb.13.2020.03.26.01.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 01:21:30 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.3) (envelope-from ) id 1jHNlN-0002pX-UA; Thu, 26 Mar 2020 09:21:17 +0100 Date: Thu, 26 Mar 2020 09:21:17 +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: <20200326082117.GC4899@localhost> References: <1585122757-4528-1-git-send-email-hqjagain@gmail.com> <20200326081433.GA979574@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200326081433.GA979574@kroah.com> 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: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. Johan