diff options
| author | Neill Kapron <nkapron@google.com> | 2026-06-19 04:06:04 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-06-25 15:24:00 +0100 |
| commit | 8bdcf96eb135aebacac319667f87db034fb38406 (patch) | |
| tree | 6142800dca4148bb0d3da626d140f2cfb00a299d /rust/kernel/drm | |
| parent | 82cfd4739011bdc7e87b5d585703427e89ddfaa5 (diff) | |
usb: gadget: f_fs: Tie read_buffer lifetime to ffs_epfile
Currently, ffs_epfile_release unconditionally frees the endpoint's
read_buffer when a file descriptor is closed. If userspace explicitly
opens the endpoint multiple times and closes one, the read_buffer is
destroyed. This can lead to silent data loss if other file descriptors
are still actively reading from the endpoint.
By tying the lifetime of the read_buffer to the ffs_epfile structure itself
(which is destroyed when the functionfs instance is torn down in
ffs_epfiles_destroy), we eliminate the brittle dependency on open/release
calls while correctly matching the conceptual lifetime of unread data on
the hardware endpoint.
Fixes: 9353afbbfa7b ("usb: gadget: f_fs: buffer data from ‘oversized’ OUT requests")
Cc: stable <stable@kernel.org>
Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Neill Kapron <nkapron@google.com>
Link: https://patch.msgid.link/20260619040609.4010746-3-nkapron@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/kernel/drm')
0 files changed, 0 insertions, 0 deletions
