Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp802708lqp; Wed, 22 May 2024 23:32:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV0bJsUNxvYjE/uU4u/bZeFSBXLCz0QPbEw9lT6hD7fHO/7GfhkAZjzUvUKHfoWgvObp38wUSbEzLVHGSldK1GIW75847n8pNa50ZK79g== X-Google-Smtp-Source: AGHT+IElfK6x8ZZPowh5U9oXdbReg88Oul0sNLa+Bqe0N+w6RWhj1XLDA/wqIhUnwxvjtlBKLiYw X-Received: by 2002:a05:6358:c612:b0:197:974d:33e with SMTP id e5c5f4694b2df-197974d0383mr310883555d.28.1716445961270; Wed, 22 May 2024 23:32:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716445961; cv=pass; d=google.com; s=arc-20160816; b=cq7YHcha5R2DT3Pontvb/f8qgtleh5v6D58yPgaHQImgFjWeAXlS70gqQGUgY2WVd0 lGoe9qPVv7pdHvGjHlrBvHZRJMqETawy39M7MGTYboeLFiiJRwUymwR3xLxXLz4igsk4 PS/Q4YihHsyHEmABT/ujcffny5QyWFbsnyElWLn9IOKHfHRfqItMp0rOK4Ug9FVtH3Cx GDYbRg5dpe68xbm4OPS92/CKFT9tB4kHCRHzicY/5uRjIOoZ22Fx4i6kdhBlpQNOVZu1 8oMNA5tgRyBmozqD1B97GNavsWhq7cYkYhqi7iXATq3mIxf9HBix9ggeBJSnShrXmlkl kV0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Hg7KsI4+yjCYzblT3og7FuDs9M5bEKNAbg7gdDS1SdY=; fh=W3CtdeGGCHP8JS0pQ+YOGoZaf5UniFfF5rvgC83SXcQ=; b=N/pmu5gIT/yifVqW648KLXnynvDArx8tDf7cNbYAkw3p7MYKdK1kPIOWzFxkAOmekj LCYfziUgd/aAdaVtzw3lLOuIQShZuD6k33Eg6P75ZP//FFfVX5T3dAXbOYchi1k6F6it +W3M2sL0iSBV48RYomaBQ36IqP+xrwK5eDQrfLqp/miHJMc/dc5Z+UCw4lnFzF68kDaK 943AIuybr+avvYi69JPQ3x1j/norJG2RrdOMRqFiyuU1LOQTLSPQ3VYR8to56cpntFhk MRnBxLfN3ZA+F0IWcRx8JsL6Fzrmh2M+LJF3tf6bevTkJJ+lluKUa2VGLHjibvE8Yxpi 2wUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Bl8JF7RO; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-187051-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187051-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63409e83907si9696149a12.174.2024.05.22.23.32.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 23:32:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187051-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Bl8JF7RO; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-187051-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187051-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7D576B21777 for ; Thu, 23 May 2024 06:32:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D6B313C677; Thu, 23 May 2024 06:31:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Bl8JF7RO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7410B1869; Thu, 23 May 2024 06:31:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716445916; cv=none; b=K2bo35jMM4mH5lYWpdEEcC8smeJukBB4outwOld4waGvJehlCWhB3dckoP3nqEuMVbUecZhBXM75d3B3i4JY2ViPcpANOuZMKOyni259JDKKNIsPiFtsNij43ZFQ2FCVci9YBuCUhXMEby6/f0RvyXtyLgGDg/DWrGoOaMij6pg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716445916; c=relaxed/simple; bh=o+/cvrJE76RZcQYv9bvFvctskXTaIx6Tfj38u9fplMU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g/uh4xlcNFU5/0ZsomEbo52EE1H3u70JNV/f8JD/d+nBh0Wp93ZFIPKZrLyqFMGEnrG7DBqFyStW9EtmJJJaPXyp9H3gVfg8iEzLeaf3NP7kIbh+Dailqh1HWRiuvTvYDWWU68ggWmh7l+PXR7mdM7mmVH9UbGPVJB/FgS1QKWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Bl8JF7RO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A365BC2BD10; Thu, 23 May 2024 06:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716445916; bh=o+/cvrJE76RZcQYv9bvFvctskXTaIx6Tfj38u9fplMU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Bl8JF7ROdvbbOaly//hU3B3zSJy+GOWSaNFEAMjhY87o8cMhHqWwGXTucuejT9gJ3 lZpqavbh74Q+Za632mZ82f1dv08YRa63RK4oy0yn/5VAmLoRwrX3Dep1kkyWeKaNts RvpkHISzVC1PNvnWqPzZnXSzj40HEu59YXe0spgM= Date: Thu, 23 May 2024 08:31:53 +0200 From: Greg Kroah-Hartman To: Shichao Lai Cc: Alan Stern , linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org, syzkaller@googlegroups.com Subject: Re: divide error in alauda_transport Message-ID: <2024052315-dwelled-unframed-db34@gregkh> References: <2024052224-motion-perish-82cd@gregkh> <2024052242-hunter-exception-930c@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, May 23, 2024 at 11:26:48AM +0800, Shichao Lai wrote: > 在2024年5月23日星期四 UTC+8 03:59:30 写道: > > > On Wed, May 22, 2024 at 06:01:57PM +0800, Shichao Lai wrote: > > > Thanks for your patience. I am a beginner and initially attempted to > > report > > > errors to the community. > > > However, I have just discovered that the issue mentioned above has > > already > > > been proposed in the previous three months of the article, and there is > > an > > > ongoing discussion. > > > > To call the discussion "ongoing" is optimistic. There hasn't been any > > reply to my last post, which was made on March 17, more than two months > > ago. > > > > Maybe you can carry out the tests I described in that post. That > > would be a big help. > > > > Alan Stern > > > > > I think this post can be closed later. > > > > > > https://groups.google.com/g/syzkaller-bugs/c/m8CuxSpLKoQ/m/JfUy1xGnAwAJ > > > > > > Greg Kroah-Hartman > > 于2024年5月22日周三 16:59写道: > > > > > > > On Wed, May 22, 2024 at 04:22:18PM +0800, Shichao Lai wrote: > > > > > patch like this: > > > > > ```c > > > > > while (sectors > 0) { > > > > > if (!uzonesize) { > > > > > return USB_STOR_TRANSPORT_ERROR; > > > > > } > > > > > unsigned int zone = lba / uzonesize; /* integer division */ > > > > > unsigned int lba_offset = lba - (zone * uzonesize); > > > > > unsigned int pages; > > > > > ``` > > > > > > > > Please submit this properly and we will be glad to review it. > > > > > > > > thanks, > > > > > > > > greg k-h > > > > > > > > Hello Dear Maintainer! > I found the same divide error yestoday as > https://groups.google.com/g/syzkaller-bugs/c/m8CuxSpLKoQ > And I add a patch before drivers/usb/storage/alauda.c:950 in > alauda_read_data(). > The true cause of this error is that the variable uzonesize may be set to 0. > Here is my patch: > =========== > > diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c > index 115f05a6201a..fb54af37efd5 100644 > --- a/drivers/usb/storage/alauda.c > +++ b/drivers/usb/storage/alauda.c > @@ -947,6 +947,9 @@ static int alauda_read_data(struct us_data *us, > unsigned long address, > sg = NULL; > > while (sectors > 0) { > + if (!uzonesize) { > + return USB_STOR_TRANSPORT_ERROR; > + } > unsigned int zone = lba / uzonesize; /* integer division */ > unsigned int lba_offset = lba - (zone * uzonesize); > unsigned int pages; > Great! Can you turn this into a real patch and send it to us so that we can apply it properly? Directions for how to do so are in the Documentation/process/submitting_patches file. thanks, greg k-h