From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Arseniy Krasnov <avkrasnov@salutedevices.com>
Cc: Akash M <akash.m5@samsung.com>,
oxffffaa@gmail.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel@salutedevices.com
Subject: Re: [PATCH v1] usb: gadget: f_fs: trim extra bytes from USB req
Date: Wed, 17 Dec 2025 14:35:06 +0100 [thread overview]
Message-ID: <2025121718-paltry-caress-43fd@gregkh> (raw)
In-Reply-To: <20251209134412.577797-1-avkrasnov@salutedevices.com>
On Tue, Dec 09, 2025 at 04:44:11PM +0300, Arseniy Krasnov wrote:
> In '__ffs_epfile_read_data()' number of bytes to copy to user iter is
> returned by USB driver in field 'actual' of structure 'usb_request'
> (see 'ffs_epfile_io_complete()'). Looks like some buggy driver may
> return value larger than actual size of kernel buffer of such USB
> request. This leads to the following crash (produced on 'dwc2' USB
> driver). To prevent this, let's add extra check, which trims reported
> request length.
Why not fix the broken driver instead? That would resolve this
properly, and not force the gadget code to work around obviously-broken
kernel code.
We try to fix bugs at the root, not paper over them elsewhere.
So what driver is causing this?
thanks,
greg k-h
next prev parent reply other threads:[~2025-12-17 13:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 13:44 [PATCH v1] usb: gadget: f_fs: trim extra bytes from USB req Arseniy Krasnov
2025-12-17 13:35 ` Greg Kroah-Hartman [this message]
2025-12-17 13:56 ` Arseniy Krasnov
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=2025121718-paltry-caress-43fd@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=akash.m5@samsung.com \
--cc=avkrasnov@salutedevices.com \
--cc=kernel@salutedevices.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oxffffaa@gmail.com \
/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