summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-03-25 16:36:31 +0000
committerJens Axboe <axboe@kernel.dk>2022-03-25 16:07:06 -0600
commitc86d18f4aa93e0e66cda0e55827cd03eea6bc5f8 (patch)
treee40e3457c300917787897f7b9509bc70119f0419 /fs/io_uring.c
parent8197b053a83335dd1b7eb7581a933924e25c1025 (diff)
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: 08a451739a9b5 ("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>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index cc3a22d60fb4..39a9ff31dbc5 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8845,6 +8845,7 @@ static int __io_sqe_files_scm(struct io_ring_ctx *ctx, int nr, int offset)
fput(fpl->fp[i]);
} else {
kfree_skb(skb);
+ free_uid(fpl->user);
kfree(fpl);
}