All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: syzbot <syzbot+3c23789ea938faaef049@syzkaller.appspotmail.com>
Cc: axboe@kernel.dk, io-uring@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk
Subject: Re: INFO: task hung in io_sq_thread_stop
Date: Wed, 9 Sep 2020 12:03:55 +0200	[thread overview]
Message-ID: <20200909100355.ibz4jc5ctnwbmy5v@steredhat> (raw)
In-Reply-To: <00000000000030a45905aedd879d@google.com>

On Wed, Sep 09, 2020 at 01:49:22AM -0700, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    dff9f829 Add linux-next specific files for 20200908
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=112f880d900000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=37b3426c77bda44c
> dashboard link: https://syzkaller.appspot.com/bug?extid=3c23789ea938faaef049
> compiler:       gcc (GCC) 10.1.0-syz 20200507
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17c082a5900000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1474f5f9900000
> 
> Bisection is inconclusive: the first bad commit could be any of:
> 
> d730b1a2 io_uring: add IOURING_REGISTER_RESTRICTIONS opcode
> 7ec3d1dd io_uring: allow disabling rings during the creation

I'm not sure it is related, but while rebasing I forgot to update the
right label in the error path.

Since the check of ring state is after the increase of ctx refcount, we
need to decrease it jumping to 'out' label instead of 'out_fput':
diff --git a/fs/io_uring.c b/fs/io_uring.c
index d00eb6bf6ce9..f35da516095a 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8649,7 +8649,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
                goto out_fput;

        if (ctx->flags & IORING_SETUP_R_DISABLED)
-               goto out_fput;
+               goto out;

        /*
         * For SQ polling, the thread will do all submissions and completions.

I'll send a patch ASAP and check if it solves this issue.

Thanks,
Stefano


  reply	other threads:[~2020-09-09 10:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09  8:49 INFO: task hung in io_sq_thread_stop syzbot
2020-09-09 10:03 ` Stefano Garzarella [this message]
2020-09-09 14:03   ` Jens Axboe
2020-09-09 15:07     ` Stefano Garzarella
     [not found] ` <20200909134317.19732-1-hdanton@sina.com>
2020-09-09 14:05   ` Jens Axboe
2020-09-09 15:32     ` Stefano Garzarella
2020-10-30 10:06       ` Dmitry Vyukov

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=20200909100355.ibz4jc5ctnwbmy5v@steredhat \
    --to=sgarzare@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+3c23789ea938faaef049@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.