Linux-Aspeed Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: linux-aspeed@lists.ozlabs.org
Subject: [PATCH] usb: gadget: aspeed: fix buffer overflow
Date: Wed, 26 Oct 2022 09:29:23 +1100	[thread overview]
Message-ID: <49d97f97e63edb70392279845186547d73b2290e.camel@kernel.crashing.org> (raw)
In-Reply-To: <CAGm54UE1oS1N_hn4RKuF8a+OWgfvJ-OCc0-uju4mXbtz-jw8VA@mail.gmail.com>

On Tue, 2022-10-25 at 14:21 +0800, Lei Yu wrote:
> 

> This case is treated as an error and we do not care about the
> following data.
> Similarly, if we change the MTU in BMC and let BMC ping the OS, the
> OS
> kernel does not crash and it gets RX errors, and the ping fails.
> 
> ?# ifconfig usb0
> ?usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>? mtu 1500
> ???????? ...
> ???????? RX packets 85? bytes 15380 (15.0 KiB)
> ???????? RX errors 51? dropped 0? overruns 0? frame 51
> 
> With this patch, we get the similar behavior on BMC that the RX
> errors
> are increasing.
> 
> > Additionally, I'm curious, why in this specific case is the device
> > sending more data than
> > the buffer can hold ? The MTU change should have resulted in
> > buffers being re-allocated no ?
> 
> The issue is found in a rare case during BIOS boot, we assume that
> BIOS is sending unexpected data to BMC for unknown reasons.

Ok thanks.

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


> > Or did you change the MTU on the remote and not on the local device
> > ?
> > 
> 
> Yes, the MTU is changed to 2000 in OS and kept 1500 on BMC, then the
> issue is reproduced. (see detailed steps in the above email).
> 
> The reason we made the above test is because we are trying to
> reproduce the behavior as BIOS, and from the logs it looks like it's
> sending a packet larger than MTU. Then we tried to adjust the MTU on
> the OS side and reproduced the issue.


  reply	other threads:[~2022-10-25 22:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24  9:48 [PATCH] usb: gadget: aspeed: fix buffer overflow Lei YU
2022-10-24 21:59 ` Benjamin Herrenschmidt
2022-10-25  6:21   ` Lei Yu
2022-10-25 22:29     ` Benjamin Herrenschmidt [this message]
2022-10-28  6:59 ` Neal Liu
2022-10-28  7:41   ` Lei Yu
2022-10-28  9:04     ` Neal Liu
2022-10-28  9:17       ` Greg Kroah-Hartman
2022-10-28  9:55         ` Neal Liu
2022-10-28 10:45           ` Greg Kroah-Hartman
2022-12-20 10:51             ` Lei Yu
2022-12-21  2:17               ` Neal Liu
2022-12-21  2:26                 ` Lei Yu
2023-06-21 12:02                   ` Lei Yu
2023-06-21 15:59                     ` Greg Kroah-Hartman
2023-06-25  3:07                       ` [External] " Lei Yu

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=49d97f97e63edb70392279845186547d73b2290e.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox