Skip to contentSkip to conversation

fuse: fix io-uring list corruption for terminated non-committed requests

PATCH Applied Joanne Koong 3 participants 4 messages Nov 25, 2025 – Nov 26, 2025

Subsystems (4)
lore
Share & tools
lore

Joanne Koong

author maintainer
#0 lore raw

PATCH 1/1 fuse: fix io-uring list corruption for terminated non-committed requests

When a request is terminated before it has been committed, the request is not removed from the queue's list. This leaves a dangling list entry that leads to list corruption and use-after-free issues.

Remove the request from the queue's list for terminated non-committed requests.

Fixes c090c8abae4b ("fuse: Add io-uring sqe commit and fetch support")
---
 fs/fuse/dev_uring.c | 1 +
 1 file changed, 1 insertion(+)
fs/fuse/dev_uring.c +1 -0
index 0066c9c0a5d5..7760fe4e1f9e 100644
@@ -86,6 +86,7 @@ static void fuse_uring_req_end(struct fuse_ring_ent *ent, struct fuse_req *req,
 	lockdep_assert_not_held(&queue->lock);
 	spin_lock(&queue->lock);
 	ent->fuse_req = NULL;
+	list_del_init(&req->list);
 	if (test_bit(FR_BACKGROUND, &req->flags)) {
 		queue->active_background--;
 		spin_lock(&fc->bg_lock);
Signature · 1 line
2.47.3
author maintainer
#1 lore raw
Quoted 10 lines · Joanne Koong

When a request is terminated before it has been committed, the request is not removed from the queue's list. This leaves a dangling list entry that leads to list corruption and use-after-free issues.

Remove the request from the queue's list for terminated non-committed requests.

Fixes c090c8abae4b ("fuse: Add io-uring sqe commit and fetch support")

Sorry, forgot to add the stable tag. There should be this line:

Quoted 19 lines
---
 fs/fuse/dev_uring.c | 1 +
 1 file changed, 1 insertion(+)
fs/fuse/dev_uring.c +1 -1
index 0066c9c0a5d5..7760fe4e1f9e 100644
@@ -86,6 +86,7 @@ static void fuse_uring_req_end(struct fuse_ring_ent *ent, struct fuse_req *req,
        lockdep_assert_not_held(&queue->lock);
        spin_lock(&queue->lock);
        ent->fuse_req = NULL;
+       list_del_init(&req->list);
        if (test_bit(FR_BACKGROUND, &req->flags)) {
                queue->active_background--;
                spin_lock(&fc->bg_lock);
--

2.47.3

maintainer Reviewed-by
#2 lore raw
Quoted 20 lines · Joanne Koong
Quoted 10 lines · Joanne Koong

When a request is terminated before it has been committed, the request is not removed from the queue's list. This leaves a dangling list entry that leads to list corruption and use-after-free issues.

Remove the request from the queue's list for terminated non-committed requests.

Fixes c090c8abae4b ("fuse: Add io-uring sqe commit and fetch support")

Sorry, forgot to add the stable tag. There should be this line:

Quoted 4 lines
---
 fs/fuse/dev_uring.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 15 lines
Quoted 13 lines
fs/fuse/dev_uring.c +1 -1
index 0066c9c0a5d5..7760fe4e1f9e 100644
@@ -86,6 +86,7 @@ static void fuse_uring_req_end(struct fuse_ring_ent *ent, struct fuse_req *req,
        lockdep_assert_not_held(&queue->lock);
        spin_lock(&queue->lock);
        ent->fuse_req = NULL;
+       list_del_init(&req->list);
        if (test_bit(FR_BACKGROUND, &req->flags)) {
                queue->active_background--;
                spin_lock(&fc->bg_lock);
--
Quoted 2 lines

2.47.3

Thank you, clearly missing in the fuse_uring_prepare_send() -> fuse_uring_req_end() error code path.

maintainer Applied
#3 lore raw
In reply to Joanne Koong
Quoted 10 lines · Joanne Koong

When a request is terminated before it has been committed, the request is not removed from the queue's list. This leaves a dangling list entry that leads to list corruption and use-after-free issues.

Remove the request from the queue's list for terminated non-committed requests.

Fixes c090c8abae4b ("fuse: Add io-uring sqe commit and fetch support")

Applied, thanks.

Miklos