public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH for-next] io_uring: fix ctx refcounting in io_uring_enter()
@ 2020-09-09 15:19 Stefano Garzarella
  2020-09-09 18:30 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Stefano Garzarella @ 2020-09-09 15:19 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Alexander Viro, io-uring, Stefano Garzarella, Kees Cook,
	linux-kernel, linux-fsdevel

If the ring is disabled we don't decrease the 'ctx' refcount since
we wrongly jump to 'out_fput' label.

Instead let's jump to 'out' label where we decrease the 'ctx' refcount.

Fixes: 7ec3d1dd9378 ("io_uring: allow disabling rings during the creation")
Signed-off-by: Stefano Garzarella <[email protected]>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index bd1ac8581d38..8fc44967fd52 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8645,7 +8645,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
 
 	ret = -EBADFD;
 	if (ctx->flags & IORING_SETUP_R_DISABLED)
-		goto out_fput;
+		goto out;
 
 	/*
 	 * For SQ polling, the thread will do all submissions and completions.
-- 
2.26.2


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

end of thread, other threads:[~2020-09-09 18:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-09 15:19 [PATCH for-next] io_uring: fix ctx refcounting in io_uring_enter() Stefano Garzarella
2020-09-09 18:30 ` Jens Axboe

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