From: sashiko-bot@kernel.org
To: "Jaegyun Lee" <dreams200260@g.skku.edu>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] usb: gadget: f_fs: fix UAF read in INTERFACE_REVMAP ioctl
Date: Thu, 26 Nov 2026 07:52:37 +0000 [thread overview]
Message-ID: <sashiko-outbox-234972@kernel.org> (raw)
In-Reply-To: <20261126-ffs-revmap-v2-1-445e86b561dc@g.skku.edu>
> From: Jaegyun Lee <dreams200260@g.skku.edu>
>
> ffs_ep0_ioctl() snapshots ffs->func without any lock or reference:
>
> struct ffs_function *func = ffs->func;
> ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV;
>
> ffs_func_revmap_intf() then walks func->interfaces_nums for
> interfaces_count iterations. ffs_func_unbind() first sets
> ffs->func = NULL, then after drain_workqueue() kfrees func->eps --
> the allocation chunk that also holds interfaces_nums -- and later
> still writes func->interfaces_nums = NULL.
>
> An ioctl that read ffs->func before the NULL write can therefore be
> inside the revmap walk while the chunk is freed.
> [ ... ]
>
> Fixes: ddf8abd25994 ("USB: f_fs: the FunctionFS driver")
> Cc: stable@vger.kernel.org
> Assisted-by: ZCode:GLM-5.4
> Signed-off-by: Jaegyun Lee <dreams200260@g.skku.edu>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261126-ffs-revmap-v2-1-445e86b561dc@g.skku.edu?part=1
prev parent reply other threads:[~2026-11-26 7:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 7:43 [PATCH v2] usb: gadget: f_fs: fix UAF read in INTERFACE_REVMAP ioctl Jaegyun Lee via B4 Relay
2026-11-26 7:52 ` 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-234972@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dreams200260@g.skku.edu \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox