Skip to content

Commit b27de70

Browse files
isilencegregkh
authored andcommitted
io_uring: fix memory leak of uid in files registration
commit c86d18f upstream. When there are no files for __io_sqe_files_scm() to process in the range, it'll free everything and return. However, it forgets to put uid. Fixes: 08a4517 ("io_uring: allow sparse fixed file sets") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/accee442376f33ce8aaebb099d04967533efde92.1648226048.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 20499ed commit b27de70

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/io_uring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7350,6 +7350,7 @@ static int __io_sqe_files_scm(struct io_ring_ctx *ctx, int nr, int offset)
73507350
fput(fpl->fp[i]);
73517351
} else {
73527352
kfree_skb(skb);
7353+
free_uid(fpl->user);
73537354
kfree(fpl);
73547355
}
73557356

0 commit comments

Comments
 (0)