summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-03-25 19:36:31 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-04-08 15:24:12 +0300
commit0853bd6885c2f293d88aaa7f7f1702c959b31680 (patch)
tree1adf4c9d9c6857251bfe475d6bb05259ac006d4c /fs
parent5b9ac3727e4abb11c9cfbe9c0781fc05dfdd7cfb (diff)
downloadlinux-0853bd6885c2f293d88aaa7f7f1702c959b31680.tar.xz
io_uring: fix memory leak of uid in files registration
commit c86d18f4aa93e0e66cda0e55827cd03eea6bc5f8 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: 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-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 ec0b50940405..5fc3a62eae72 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8130,6 +8130,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);
}