<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/fuse, branch v7.1.8</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1.8</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1.8'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-08-03T09:26:03+00:00</updated>
<entry>
<title>fuse-uring: fix race between registration and connection abortion</title>
<updated>2026-08-03T09:26:03+00:00</updated>
<author>
<name>Joanne Koong</name>
<email>joannelkoong@gmail.com</email>
</author>
<published>2026-07-22T11:24:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2cd945492bc5b472e814272e88b731bb9bb17629'/>
<id>urn:sha1:2cd945492bc5b472e814272e88b731bb9bb17629</id>
<content type='text'>
[ Upstream commit 952b5d36f6a298f57c52a59e72076c69386a8aaf ]

This fixes this race:
- thread a: io_uring_enter -&gt; register sqe -&gt;
  fuse_uring_create_ring_ent -&gt; allocate ent but doesn't grab queue_ref
  yet
- thread b: fuse_conn_destroy() -&gt; fuse_chan_abort() -&gt;
  fuse_uring_abort() is a no-op due to queue ref being 0
- thread a: grabs the queue_ref, queue_ref is now 1, rest of
  fuse_uring_do_register() logic executes
- thread b: fuse_chan_abort() returns, fuse_chan_wait_aborted() now runs
  and calls
  "wait_event(ring-&gt;stop_waitq, atomic_read(&amp;ring-&gt;queue_refs) == 0);"
The abort/unmount thread will hang indefinitely in unkillable state as
nothing will decrement queue_refs or wake stop_waitq, and the ring,
queue, and ent are leaked.

Fix this by checking fch-&gt;connected under fch-&gt;lock after the created
ent has grabbed a ref count on the queue. This ensures that in the
scenario above, it is guaranteed that we either release the queue ref
and wake up stop_waitq (in case fuse_chan_wait_aborted() is already
waiting) in fuse_uring_do_register() when we detect !fch-&gt;connected, or
if the connection is aborted after the check, it is guaranteed that the
async teardown worker will be running in the background cleaning up ents
and decrementing the ent's ref on the queue, which will unblock the
eventual queue and ring teardown.

Fixes: 24fe962c86f5 ("fuse: {io-uring} Handle SQEs - register commands")
Cc: stable@vger.kernel.org
Reviewed-by: Bernd Schubert &lt;bernd@bsbernd.com&gt;
Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
[ changed fch-&gt;lock/fch-&gt;connected references to fc-&gt;lock/fc-&gt;connected since struct fuse_chan does not exist in this tree ]
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse-uring: remove request-less entries from ent_w_req_queue to fix NULL deref</title>
<updated>2026-07-18T14:55:51+00:00</updated>
<author>
<name>Joanne Koong</name>
<email>joannelkoong@gmail.com</email>
</author>
<published>2026-06-09T21:36:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0a7f33010c0e4cd92937e088a54350381fd0fbf2'/>
<id>urn:sha1:0a7f33010c0e4cd92937e088a54350381fd0fbf2</id>
<content type='text'>
commit 1c57a69be962d459c5e705f5cb4355b841b3461c upstream.

If a copy into the userspace ring buffer fails, a request will be
terminated and fuse_uring_req_end() will set ent-&gt;fuse_req to NULL but
it will leave the entry on ent_w_req_queue in FRRS_FUSE_REQ state. This
can lead to a NULL deref if the request expiration logic scans
ent_w_req_queue in the window before the entry is moved off it.

Fix this by taking the entry off ent_w_req_queue and changing its state
from FRRS_FUSE_REQ to FRRS_INVALID before terminating the request.

Fixes: 4fea593e625c ("fuse: optimize over-io-uring request expiration check")
Cc: stable@kernel.org
Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse-uring: make a fuse_req on SQE commit only findable after memcpy</title>
<updated>2026-07-18T14:55:51+00:00</updated>
<author>
<name>Bernd Schubert</name>
<email>bernd@bsbernd.com</email>
</author>
<published>2026-06-08T21:03:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a635f427d57e2012102ae4886b48d8955c59fb86'/>
<id>urn:sha1:a635f427d57e2012102ae4886b48d8955c59fb86</id>
<content type='text'>
commit 1efd3d474fc0ba74dfd984249bca78807d739812 upstream.

Bad userspace might try to trick us and send commit SQEs request
unique / commit-id of requests that are not even send to
fuse-server (io_uring_cmd_done() not called) yet.

fuse_uring_commit_fetch() ends the fuse request when the ring entry
has a wrong state, but that could have caused a use-after-free
with the memcpy operations in fuse_uring_send_in_task().
In order to avoid such races the call of fuse_uring_add_to_pq()
is moved after the copy operations and just before completing
the io-uring request - malicious userspace cannot find the request
anymore until all prepration work in fuse-client/kernel is completed.

This also moves fuse_uring_add_to_pq() a bit up in the code to
avoid a forward declaration. Also not with a preparation commit,
to make it easier to back port to older kernels.

Reported-by: xlabai &lt;xlabai@tencent.com&gt;
Reported-by: Berkant Koc &lt;me@berkoc.com&gt;
Fixes: c090c8abae4b6b ("fuse: Add io-uring sqe commit and fetch support")
Cc: stable@kernel.org # 6.14
Signed-off-by: Bernd Schubert &lt;bernd@bsbernd.com&gt;
Reviewed-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse-uring: Avoid queue-&gt;stopped races and set/read that value under lock</title>
<updated>2026-07-18T14:55:51+00:00</updated>
<author>
<name>Bernd Schubert</name>
<email>bernd@bsbernd.com</email>
</author>
<published>2026-06-08T21:03:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4021a3a79eee551d95fe1e1e7c1b195d34ba8c08'/>
<id>urn:sha1:4021a3a79eee551d95fe1e1e7c1b195d34ba8c08</id>
<content type='text'>
commit b70a3aca16934c196f92abb17b01c1647b9bb63c upstream.

There are several readers of queue-&gt;stopped that check the value
under lock, but fuse_uring_commit_fetch() did not and actually
the value was not set under the lock in fuse_uring_abort_end_requests()
either. Especially in fuse_uring_commit_fetch it is important
to check under a lock, because due to races 'struct fuse_req'
might be freed with fuse_request_end, but another thread/cpu
might already do teardown work.

Cc: stable@kernel.org # 6.14
Fixes: 4a9bfb9b6850fec ("fuse: {io-uring} Handle teardown of ring entries")
Reported-by: Berkant Koc &lt;me@berkoc.com&gt;
Reported-by: xlabai &lt;xlabai@tencent.com&gt;
Signed-off-by: Bernd Schubert &lt;bernd@bsbernd.com&gt;
Reviewed-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse-uring: Avoid use-after-free in fuse_uring_async_stop_queues</title>
<updated>2026-07-18T14:55:51+00:00</updated>
<author>
<name>Bernd Schubert</name>
<email>bernd@bsbernd.com</email>
</author>
<published>2026-06-08T21:03:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=95d7f50aff2a5f71557263ff25b97b2951f32bf8'/>
<id>urn:sha1:95d7f50aff2a5f71557263ff25b97b2951f32bf8</id>
<content type='text'>
commit d351da75066955144515cb2f9aa959f24a04287a upstream.

fuse_uring_async_stop_queues() might run when the last reference
on ring-&gt;queue_refs was already dropped.

In order to avoid an early destruction a reference on struct fuse_conn
is now taken before starting fuse_uring_async_stop_queues() and that
reference is only released when that delayed work queue terminates.

Fixes: 4a9bfb9b6850 ("fuse: {io-uring} Handle teardown of ring entries")
Cc: stable@kernel.org # 6.14
Reported-by: Berkant Koc &lt;me@berkoc.com&gt;
Signed-off-by: Bernd Schubert &lt;bernd@bsbernd.com&gt;
Reviewed-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse-uring: end fuse_req on io-uring cancel task work</title>
<updated>2026-07-18T14:55:51+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@meta.com</email>
</author>
<published>2026-06-09T00:28:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4f45f276d5b4412eade6f74f2e37f3adba0473ed'/>
<id>urn:sha1:4f45f276d5b4412eade6f74f2e37f3adba0473ed</id>
<content type='text'>
commit bea4fe98204b6ce7eb8e29f7bf867dd7619b3ddd upstream.

When io_uring delivers task work with tw.cancel set (PF_EXITING,
PF_KTHREAD fallback, or percpu_ref_is_dying on the ring context),
fuse_uring_send_in_task() takes the cancel branch, assigns
-ECANCELED, and falls through to fuse_uring_send(). That path only
flips the entry to FRRS_USERSPACE and completes the io_uring cmd;
it never discharges the ring entry's owning reference to the
fuse_req that fuse_uring_add_req_to_ring_ent() handed it at
dispatch time.

    fuse_uring_send_in_task()
      tw.cancel == true
        err = -ECANCELED
      fuse_uring_send(ent, cmd, err, issue_flags)
        ent-&gt;state = FRRS_USERSPACE
        list_move(&amp;ent-&gt;list, &amp;queue-&gt;ent_in_userspace)
        ent-&gt;cmd = NULL
        io_uring_cmd_done(-ECANCELED)
        /* ent-&gt;fuse_req still set, req still hashed */

The fuse_req stays linked on fpq-&gt;processing[hash] and
fuse_request_end() is never invoked. The originating syscall
thread blocks in D-state in request_wait_answer() until
fuse_abort_conn() runs, which can be the entire connection
lifetime. For FR_BACKGROUND requests fc-&gt;num_background is never
decremented either, so repeated cancels inflate the counter until
max_background is hit and all later background ops stall. tw.cancel does
not imply a connection abort (e.g. a single io_uring worker thread exits
while the fuse connection stays up), so this cannot be left for
fuse_abort_conn() to clean up.

Ending the req but still routing the entry through fuse_uring_send()
is not enough: that leaves a req-less entry on ent_in_userspace, and
ent_list_request_expired() dereferences ent-&gt;fuse_req unconditionally
on the head of that list, which would then NULL-deref.

Fix the cancel branch to release the entry directly. Remove it from the
queue, complete the io_uring cmd, end the fuse_req, free the entry, and
drop its queue_refs (waking the teardown waiter if it was the last).

Fixes: c2c9af9a0b13 ("fuse: Allow to queue fg requests through io-uring")
Cc: stable@vger.kernel.org
Reviewed-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Assisted-by: kres (claude-opus-4-7)
Signed-off-by: Chris Mason &lt;clm@meta.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse-uring: fix moving cancelled entry to ent_in_userspace list</title>
<updated>2026-07-18T14:55:51+00:00</updated>
<author>
<name>Joanne Koong</name>
<email>joannelkoong@gmail.com</email>
</author>
<published>2026-06-08T19:21:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e8afc85acdf329361b2d8df2ad9b52364686235f'/>
<id>urn:sha1:e8afc85acdf329361b2d8df2ad9b52364686235f</id>
<content type='text'>
commit 198f45eeb9f78b2a2d6d8be95e4e43468eb2c6bc upstream.

fuse_uring_cancel() moves entries that are available (these have no reqs
attached) to the ent_in_userspace list. ent_list_request_expired()
checks the first entry on ent_in_userspace and dereferences
ent-&gt;fuse_req unconditionally, which will crash on a cancelled entry
that was moved to this list.

Fix this by freeing the entry and dropping queue_refs directly in
fuse_uring_cancel(). This is safe because cancel is the cancel handler
itself - after io_uring_cmd_done(), no more cancels will be dispatched
for this command, and teardown serializes with cancel via queue-&gt;lock.

Since cancel now decrements queue_refs, fuse_uring_abort() must no
longer gate fuse_uring_abort_end_requests() on queue_refs &gt; 0, as
cancelled entries may have already dropped queue_refs while requests are
still queued. Remove the gate so abort always flushes requests and stops
queues.

Reported-by: Heechan Kang &lt;gganji11@naver.com&gt;
Tested-by: Heechan Kang &lt;gganji11@naver.com&gt;
Reviewed-by: Bernd Schubert &lt;bernd@bsbernd.com&gt;
Fixes: 4fea593e625c ("fuse: optimize over-io-uring request expiration check")
Cc: stable@vger.kernel.org
Suggested-by: Jian Huang Li &lt;ali@ddn.com&gt;
Suggested-by: Horst Birthelmer &lt;horst@birthelmer.de&gt;
Signed-off-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse-uring: fix data races on ring-&gt;ready</title>
<updated>2026-07-18T14:55:50+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@meta.com</email>
</author>
<published>2026-06-05T19:27:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d01a09b442cb786cd44ccc7c84d57e2856d6737c'/>
<id>urn:sha1:d01a09b442cb786cd44ccc7c84d57e2856d6737c</id>
<content type='text'>
commit 46725a0056c884cf58a6897f222892807327d82d upstream.

On weakly-ordered architectures, the store to fiq-&gt;ops can be
reordered past the store to ring-&gt;ready, allowing a CPU that sees
ring-&gt;ready == true via fuse_uring_ready() to dispatch requests
through a stale fiq-&gt;ops pointer. Upgrade the store to
smp_store_release() and the load in fuse_uring_ready() to
smp_load_acquire() so that the preceding WRITE_ONCE(fiq-&gt;ops, ...)
is visible to any CPU that observes ring-&gt;ready == true.

Additionally, fuse_uring_do_register() publishes ring-&gt;ready with
WRITE_ONCE() but the fast-path check reads it with a plain load.
This is a marked-vs-unmarked access that KCSAN will flag. Wrap it in
READ_ONCE() to mark it without adding unnecessary ordering.

Also wrap the fc-&gt;ring load in fuse_uring_ready() in READ_ONCE() to
prevent the compiler from reloading it between the NULL check and the
dereference.

Fixes: c2c9af9a0b13 ("fuse: Allow to queue fg requests through io-uring")
Cc: stable@vger.kernel.org
Reviewed-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Assisted-by: kres (claude-opus-4-7)
Signed-off-by: Chris Mason &lt;clm@meta.com&gt;
Reviewed-by: Bernd Schubert &lt;bernd@bsbernd.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse-uring: fix EFAULT clobber in fuse_uring_commit</title>
<updated>2026-07-18T14:55:50+00:00</updated>
<author>
<name>Chris Mason</name>
<email>clm@meta.com</email>
</author>
<published>2026-06-05T19:27:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fe604c08d874648a69187f6380e5c7858627dc04'/>
<id>urn:sha1:fe604c08d874648a69187f6380e5c7858627dc04</id>
<content type='text'>
commit 3a0a8bc51a13951c5141262bf770eeea3e0b6228 upstream.

copy_from_user() returns the number of bytes not copied as an unsigned
residual on failure (1..sizeof(struct fuse_out_header)). fuse_uring_commit
stores that residual in ssize_t err, sets req-&gt;out.h.error to -EFAULT,
then jumps to out: with err still holding the positive residual.

    err = copy_from_user(&amp;req-&gt;out.h, &amp;ent-&gt;headers-&gt;in_out,
                         sizeof(req-&gt;out.h));
    if (err) {
        req-&gt;out.h.error = -EFAULT;
        goto out;          /* err is the positive residual */
    }
    ...
    out:
        fuse_uring_req_end(ent, req, err);

fuse_uring_req_end() then runs

    if (error)
        req-&gt;out.h.error = error;

which overwrites the just-assigned -EFAULT with the positive residual.
FUSE callers such as fuse_simple_request() test err &lt; 0 to detect
failure, so the positive value is interpreted as success and the
caller proceeds with an uninitialised or partial req-&gt;out.args.

Fix by assigning err = -EFAULT in the failure branch before jumping
to out, so fuse_uring_req_end() receives a negative errno and sets
req-&gt;out.h.error to -EFAULT.

Fixes: c090c8abae4b ("fuse: Add io-uring sqe commit and fetch support")
Cc: stable@vger.kernel.org
Reviewed-by: Joanne Koong &lt;joannelkoong@gmail.com&gt;
Assisted-by: kres (claude-opus-4-7)
Signed-off-by: Chris Mason &lt;clm@meta.com&gt;
Reviewed-by: Bernd Schubert &lt;bernd@bsbernd.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>fuse: clear intr_entry in fuse_resend and fuse_remove_pending_req</title>
<updated>2026-07-18T14:55:50+00:00</updated>
<author>
<name>Ji'an Zhou</name>
<email>eilaimemedsnaimel@gmail.com</email>
</author>
<published>2026-06-09T09:58:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=893479015cb6442fd389d3b553ab3036c9541715'/>
<id>urn:sha1:893479015cb6442fd389d3b553ab3036c9541715</id>
<content type='text'>
commit f8fce75fedf73ac72aa09163deb8f4291fdcaad2 upstream.

When fuse_resend() moves a request from fpq-&gt;processing back to
fiq-&gt;pending, it sets FR_PENDING and clears FR_SENT but does not
remove the requests intr_entry from fiq-&gt;interrupts.  If the
request had FR_INTERRUPTED set from a prior signal, intr_entry
remains dangling on fiq-&gt;interrupts.  When the requesting task
then receives a fatal signal, fuse_remove_pending_req() sees
FR_PENDING=1, removes the request from fiq-&gt;pending and frees it
via the refcount path, also without cleaning intr_entry.  The
stale intr_entry causes use-after-free when fuse_read_interrupt()
iterates fiq-&gt;interrupts:
  - list_del_init(&amp;req-&gt;intr_entry) -&gt; UAF write on freed slab
  - req-&gt;in.h.unique -&gt; UAF read, data leaked to userspace

Remove intr_entry from fiq-&gt;interrupts in fuse_resend() for
interrupted requests before they are placed back on fiq-&gt;pending.

Add a WARN_ON if the intr_entry is not empty on request destruction.

Fixes: 760eac73f9f6 ("fuse: Introduce a new notification type for resend pending requests")
Cc: stable@vger.kernel.org # 6.9
Signed-off-by: Ji'an Zhou &lt;eilaimemedsnaimel@gmail.com&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
