public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 5.18] io_uring: fix leaking uid in files registration
@ 2022-03-25 16:36 Pavel Begunkov
  2022-03-25 22:07 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2022-03-25 16:36 UTC (permalink / raw)
  To: io-uring; +Cc: Jens Axboe, asml.silence

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 <[email protected]>
---
 fs/io_uring.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index e5769287b3b8..fd53a8330f43 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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);
 	}
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 5.18] io_uring: fix leaking uid in files registration
  2022-03-25 16:36 [PATCH 5.18] io_uring: fix leaking uid in files registration Pavel Begunkov
@ 2022-03-25 22:07 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-03-25 22:07 UTC (permalink / raw)
  To: io-uring, Pavel Begunkov

On Fri, 25 Mar 2022 16:36:31 +0000, Pavel Begunkov wrote:
> 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,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-25 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-25 16:36 [PATCH 5.18] io_uring: fix leaking uid in files registration Pavel Begunkov
2022-03-25 22:07 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox