All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dickson Wu" <dickson.wu@certik.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH 5.10.y-cip] usb: gadget: f_fs: copy only received bytes on short ep0 read
Date: Fri, 27 Nov 2026 13:15:57 +0000	[thread overview]
Message-ID: <sashiko-outbox-237477@kernel.org> (raw)
In-Reply-To: <20261127-cip-ffs-510b-v1-1-740c3a4fb9b3@certik.com>

> From: Michael Bommarito <michael.bommarito@gmail.com>
> 
> commit 4e036c10e7f4df5d951c69cc3697bc8e209c6d02 upstream.
> 
> ffs_ep0_read() allocates its control-OUT data buffer with
> kmalloc() (not kzalloc) at the Length value from the Setup
> packet, then copies that full len to userspace regardless of
> how many bytes were actually received:
> 
>     data = kmalloc(len, GFP_KERNEL);
>     ...
>     ret = __ffs_ep0_queue_wait(ffs, data, len);
>     if ((ret > 0) && (copy_to_user(buf, data, len)))
>             ret = -EFAULT;
> 
> [ ... ]
> Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
> Link: https://patch.msgid.link/20260419160359.1577270-1-michael.bommarito@gmail.com
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> [ adapted to 5.10.y-cip: keep the branch's likely/unlikely wrappers around the EP0 copy ]
> Signed-off-by: Dickson Wu <dickson.wu@certik.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261127-cip-ffs-510b-v1-1-740c3a4fb9b3@certik.com?part=1

      reply	other threads:[~2026-11-27 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 13:09 [PATCH 5.10.y-cip] usb: gadget: f_fs: copy only received bytes on short ep0 read Dickson Wu
2026-11-27 13:09 ` Dickson Wu via B4 Relay
2026-11-27 13:15 ` sashiko-bot [this message]

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=sashiko-outbox-237477@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dickson.wu@certik.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.