Skip to content

Commit f3cd485

Browse files
committed
io_uring: ensure open/openat2 name is cleaned on cancelation
If we cancel these requests, we'll leak the memory associated with the filename. Add them to the table of ops that need cleaning, if REQ_F_NEED_CLEANUP is set. Cc: [email protected] Fixes: e62753e ("io_uring: call statx directly") Reviewed-by: Stefano Garzarella <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 4eb8dde commit f3cd485

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/io_uring.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5671,6 +5671,11 @@ static void __io_clean_op(struct io_kiocb *req)
56715671
io_put_file(req, req->splice.file_in,
56725672
(req->splice.flags & SPLICE_F_FD_IN_FIXED));
56735673
break;
5674+
case IORING_OP_OPENAT:
5675+
case IORING_OP_OPENAT2:
5676+
if (req->open.filename)
5677+
putname(req->open.filename);
5678+
break;
56745679
}
56755680
req->flags &= ~REQ_F_NEED_CLEANUP;
56765681
}

0 commit comments

Comments
 (0)