Skip to contentSkip to conversation

io_uring: fix leaking uid in files registration

PATCH Applied Pavel Begunkov 2 participants 2 messages Mar 25, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: fix leaking 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")
---
 fs/io_uring.c | 1 +
 1 file changed, 1 insertion(+)
fs/io_uring.c +1 -0
index e5769287b3b8..fd53a8330f43 100644
@@ -8834,6 +8834,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);
 	}
 
Signature · 1 line
2.35.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Pavel Begunkov

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.

Applied, thanks!

[1/1] io_uring: fix leaking uid in files registration

      commit: c86d18f4aa93e0e66cda0e55827cd03eea6bc5f8

Best regards,

Signature · 1 line
Jens Axboe