Skip to content

Commit c86d18f

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix memory leak of uid in files registration
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>
1 parent 8197b05 commit c86d18f

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
@@ -8845,6 +8845,7 @@ static int __io_sqe_files_scm(struct io_ring_ctx *ctx, int nr, int offset)
88458845
fput(fpl->fp[i]);
88468846
} else {
88478847
kfree_skb(skb);
8848+
free_uid(fpl->user);
88488849
kfree(fpl);
88498850
}
88508851

0 commit comments

Comments
 (0)