From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Shichao Lai <phyhac@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
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
Date: Thu, 23 May 2024 08:31:53 +0200 [thread overview]
Message-ID: <2024052315-dwelled-unframed-db34@gregkh> (raw)
In-Reply-To: <CAEk6kZsgMscqmSgsvt9d=z7e69ZGuJAfLuYOV7E6jXJKr+n3Pg@mail.gmail.com>
On Thu, May 23, 2024 at 11:26:48AM +0800, Shichao Lai wrote:
> 在2024年5月23日星期四 UTC+8 03:59:30<Alan Stern> 写道:
>
> > 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 <gre...@linuxfoundation.org
> > <https://groups.google.com/>> 于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
next prev parent reply other threads:[~2024-05-23 6:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-22 7:28 divide error in alauda_transport Shichao Lai
2024-05-22 7:34 ` Greg Kroah-Hartman
[not found] ` <CAEk6kZt4qcV0xUxHFRp3DTdZ0f_3fLE0q4e_AWHGyjba=19g9g@mail.gmail.com>
[not found] ` <CAEk6kZsgEJNSmFFe-tdA+RhM=+Pjm=JvHiNJ4QjZONPXHt-gjw@mail.gmail.com>
[not found] ` <2024052242-hunter-exception-930c@gregkh>
[not found] ` <CAEk6kZsLqJ5RbWYMrcbB+LkRq8jzRgTm3F8kq8FKB14y8ST2GQ@mail.gmail.com>
2024-05-22 13:49 ` Alan Stern
[not found] ` <CAEk6kZsgMscqmSgsvt9d=z7e69ZGuJAfLuYOV7E6jXJKr+n3Pg@mail.gmail.com>
2024-05-23 6:31 ` Greg Kroah-Hartman [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-03-17 8:31 xingwei lee
2024-03-17 15:04 ` Alan Stern
2024-03-17 15:57 ` xingwei lee
2024-03-17 20:59 ` Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2024052315-dwelled-unframed-db34@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=phyhac@gmail.com \
--cc=stern@rowland.harvard.edu \
--cc=syzkaller@googlegroups.com \
--cc=usb-storage@lists.one-eyed-alien.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.