diff options
author | Bernd Schubert <bschubert@ddn.com> | 2025-03-25 20:29:31 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2025-03-31 15:53:02 +0300 |
commit | 09098e62e4be8f0755e58d6078aaf27cbd9a3a8d (patch) | |
tree | d1c03f07301687a382b7efb94de2160e1f9cf41f /tools/perf/scripts/python/libxed.py | |
parent | 4701f33a10702d5fc577c32434eb62adde0a1ae1 (diff) | |
download | linux-09098e62e4be8f0755e58d6078aaf27cbd9a3a8d.tar.xz |
fuse: {io-uring} Fix a possible req cancellation race
task-A (application) might be in request_wait_answer and
try to remove the request when it has FR_PENDING set.
task-B (a fuse-server io-uring task) might handle this
request with FUSE_IO_URING_CMD_COMMIT_AND_FETCH, when
fetching the next request and accessed the req from
the pending list in fuse_uring_ent_assign_req().
That code path was not protected by fiq->lock and so
might race with task-A.
For scaling reasons we better don't use fiq->lock, but
add a handler to remove canceled requests from the queue.
This also removes usage of fiq->lock from
fuse_uring_add_req_to_ring_ent() altogether, as it was
there just to protect against this race and incomplete.
Also added is a comment why FR_PENDING is not cleared.
Fixes: c090c8abae4b ("fuse: Add io-uring sqe commit and fetch support")
Cc: <stable@vger.kernel.org> # v6.14
Reported-by: Joanne Koong <joannelkoong@gmail.com>
Closes: https://lore.kernel.org/all/CAJnrk1ZgHNb78dz-yfNTpxmW7wtT88A=m-zF0ZoLXKLUHRjNTw@mail.gmail.com/
Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/libxed.py')
0 files changed, 0 insertions, 0 deletions