linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	io-uring@vger.kernel.org,
	Stefano Garzarella <sgarzare@redhat.com>,
	Kees Cook <keescook@chromium.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH for-next] io_uring: fix ctx refcounting in io_uring_enter()
Date: Wed,  9 Sep 2020 17:19:00 +0200	[thread overview]
Message-ID: <20200909151900.60321-1-sgarzare@redhat.com> (raw)

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 <sgarzare@redhat.com>
---
 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


             reply	other threads:[~2020-09-09 15:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 15:19 Stefano Garzarella [this message]
2020-09-09 18:30 ` [PATCH for-next] io_uring: fix ctx refcounting in io_uring_enter() Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200909151900.60321-1-sgarzare@redhat.com \
    --to=sgarzare@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).