2021-06-04 09:15:30

by syzbot

[permalink] [raw]
Subject: [syzbot] WARNING in io_wqe_enqueue

Hello,

syzbot found the following issue on:

HEAD commit: f88cd3fb Merge tag 'vfio-v5.13-rc5' of git://github.com/aw..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=175c1577d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=82d85e75046e5e64
dashboard link: https://syzkaller.appspot.com/bug?extid=ea2f1484cffe5109dc10

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

------------[ cut here ]------------
WARNING: CPU: 1 PID: 11749 at fs/io-wq.c:244 io_wqe_wake_worker fs/io-wq.c:244 [inline]
WARNING: CPU: 1 PID: 11749 at fs/io-wq.c:244 io_wqe_enqueue+0x7f6/0x910 fs/io-wq.c:751
Modules linked in:
CPU: 1 PID: 11749 Comm: syz-executor.0 Not tainted 5.13.0-rc4-syzkaller #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
RIP: 0010:io_wqe_wake_worker fs/io-wq.c:244 [inline]
RIP: 0010:io_wqe_enqueue+0x7f6/0x910 fs/io-wq.c:751
Code: ef e8 3e a3 d8 ff e9 2d f9 ff ff 4c 89 ef e8 31 a3 d8 ff e9 53 f9 ff ff 48 89 ef e8 24 a3 d8 ff e9 9f fa ff ff e8 aa 1a 94 ff <0f> 0b e9 08 fb ff ff 48 8b 7c 24 08 e8 19 a3 d8 ff e9 ca fd ff ff
RSP: 0018:ffffc90000e3fc78 EFLAGS: 00010212
RAX: 0000000000003811 RBX: 0000000000000001 RCX: ffffc90001639000
RDX: 0000000000040000 RSI: ffffffff81dff6b6 RDI: 0000000000000003
RBP: ffff88801494a810 R08: 0000000000000000 R09: ffff88801494a8a3
R10: ffffffff81dff1bc R11: 0000000000000002 R12: ffff88801494a800
R13: ffff88801494a898 R14: ffff88801494a8e8 R15: 0000000000000000
FS: 00007fe134468700(0000) GS:ffff88802cb00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000040c0e0 CR3: 0000000072963000 CR4: 0000000000150ee0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
io_queue_async_work+0x2d0/0x5f0 fs/io_uring.c:1274
__io_queue_sqe+0x806/0x10f0 fs/io_uring.c:6438
__io_req_task_submit+0x103/0x120 fs/io_uring.c:2039
io_async_task_func+0x23e/0x4c0 fs/io_uring.c:5074
__tctx_task_work fs/io_uring.c:1910 [inline]
tctx_task_work+0x24e/0x550 fs/io_uring.c:1924
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
tracehook_notify_signal include/linux/tracehook.h:212 [inline]
handle_signal_work kernel/entry/common.c:145 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x24a/0x280 kernel/entry/common.c:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:57
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x4665d9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe134468188 EFLAGS: 00000246 ORIG_RAX: 0000000000000030
RAX: 0000000000000000 RBX: 000000000056bf80 RCX: 00000000004665d9
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000004
RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf80
R13: 00007ffe2f2a5b4f R14: 00007fe134468300 R15: 0000000000022000


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at [email protected].

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.


2021-06-04 09:26:48

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] WARNING in io_wqe_enqueue

syzbot has found a reproducer for the following issue on:

HEAD commit: f88cd3fb Merge tag 'vfio-v5.13-rc5' of git://github.com/aw..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1629ab6bd00000
kernel config: https://syzkaller.appspot.com/x/.config?x=8a9e9956ca52a5f6
dashboard link: https://syzkaller.appspot.com/bug?extid=ea2f1484cffe5109dc10
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16ecfd60300000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=110abf2fd00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

------------[ cut here ]------------
WARNING: CPU: 0 PID: 8435 at fs/io-wq.c:244 io_wqe_wake_worker fs/io-wq.c:244 [inline]
WARNING: CPU: 0 PID: 8435 at fs/io-wq.c:244 io_wqe_enqueue+0x7f6/0x910 fs/io-wq.c:751
Modules linked in:
CPU: 0 PID: 8435 Comm: syz-executor703 Not tainted 5.13.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:io_wqe_wake_worker fs/io-wq.c:244 [inline]
RIP: 0010:io_wqe_enqueue+0x7f6/0x910 fs/io-wq.c:751
Code: ef e8 4e a5 d8 ff e9 2d f9 ff ff 4c 89 ef e8 41 a5 d8 ff e9 53 f9 ff ff 48 89 ef e8 34 a5 d8 ff e9 9f fa ff ff e8 fa 9e 93 ff <0f> 0b e9 08 fb ff ff 48 8b 7c 24 08 e8 29 a5 d8 ff e9 ca fd ff ff
RSP: 0018:ffffc9000cb17c78 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000000000000
RDX: ffff888015de3880 RSI: ffffffff81e13d86 RDI: 0000000000000003
RBP: ffff88802a622010 R08: 0000000000000000 R09: ffff88802a6220a3
R10: ffffffff81e1388c R11: 1ffffffff1f34fda R12: ffff88802a622000
R13: ffff88802a622098 R14: ffff88802a6220e8 R15: 0000000000000000
FS: 0000000000bc0300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000180 CR3: 0000000027ebb000 CR4: 0000000000350ef0
Call Trace:
io_queue_async_work+0x2d0/0x5f0 fs/io_uring.c:1274
__io_queue_sqe+0x806/0x10f0 fs/io_uring.c:6438
__io_req_task_submit+0x103/0x120 fs/io_uring.c:2039
io_async_task_func+0x23e/0x4c0 fs/io_uring.c:5074
__tctx_task_work fs/io_uring.c:1910 [inline]
tctx_task_work+0x24e/0x550 fs/io_uring.c:1924
task_work_run+0xdd/0x1a0 kernel/task_work.c:164
tracehook_notify_signal include/linux/tracehook.h:212 [inline]
handle_signal_work kernel/entry/common.c:145 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x24a/0x280 kernel/entry/common.c:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301
do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:57
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x43f109
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffde115a118 EFLAGS: 00000246 ORIG_RAX: 0000000000000030
RAX: 0000000000000000 RBX: 0000000000000003 RCX: 000000000043f109
RDX: 000000000043f109 RSI: 0000000000000001 RDI: 0000000000000004
RBP: 00000000004030f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000403180
R13: 0000000000000000 R14: 00000000004ad018 R15: 0000000000400488

2021-06-04 20:25:58

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] WARNING in io_wqe_enqueue

syzbot has bisected this issue to:

commit 24369c2e3bb06d8c4e71fd6ceaf4f8a01ae79b7c
Author: Pavel Begunkov <[email protected]>
Date: Tue Jan 28 00:15:48 2020 +0000

io_uring: add io-wq workqueue sharing

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=17934777d00000
start commit: f88cd3fb Merge tag 'vfio-v5.13-rc5' of git://github.com/aw..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=14534777d00000
console output: https://syzkaller.appspot.com/x/log.txt?x=10534777d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=82d85e75046e5e64
dashboard link: https://syzkaller.appspot.com/bug?extid=ea2f1484cffe5109dc10
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16d5772fd00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10525947d00000

Reported-by: [email protected]
Fixes: 24369c2e3bb0 ("io_uring: add io-wq workqueue sharing")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

2021-06-08 09:49:39

by Hao Xu

[permalink] [raw]
Subject: Re: [syzbot] WARNING in io_wqe_enqueue

在 2021/6/5 上午4:22, syzbot 写道:
> syzbot has bisected this issue to:
>
> commit 24369c2e3bb06d8c4e71fd6ceaf4f8a01ae79b7c
> Author: Pavel Begunkov <[email protected]>
> Date: Tue Jan 28 00:15:48 2020 +0000
>
> io_uring: add io-wq workqueue sharing
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=17934777d00000
> start commit: f88cd3fb Merge tag 'vfio-v5.13-rc5' of git://github.com/aw..
> git tree: upstream
> final oops: https://syzkaller.appspot.com/x/report.txt?x=14534777d00000
> console output: https://syzkaller.appspot.com/x/log.txt?x=10534777d00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=82d85e75046e5e64
> dashboard link: https://syzkaller.appspot.com/bug?extid=ea2f1484cffe5109dc10
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16d5772fd00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10525947d00000
>
> Reported-by: [email protected]
> Fixes: 24369c2e3bb0 ("io_uring: add io-wq workqueue sharing")
>
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection
>
This is not a bug, the repro program first set RLIMIT_NPROC to 0, then
submits an unbound work whcih raises a warning of
WARN_ON_ONCE(!acct->max_workers). Since unbound->max_workers is
task_rlimit(current, RLIMIT_NPROC), so it is expected.

2021-06-09 00:56:03

by Dmitry Vyukov

[permalink] [raw]
Subject: Re: [syzbot] WARNING in io_wqe_enqueue

On Tue, Jun 8, 2021 at 11:47 AM Hao Xu <[email protected]> wrote:
>
> 在 2021/6/5 上午4:22, syzbot 写道:
> > syzbot has bisected this issue to:
> >
> > commit 24369c2e3bb06d8c4e71fd6ceaf4f8a01ae79b7c
> > Author: Pavel Begunkov <[email protected]>
> > Date: Tue Jan 28 00:15:48 2020 +0000
> >
> > io_uring: add io-wq workqueue sharing
> >
> > bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=17934777d00000
> > start commit: f88cd3fb Merge tag 'vfio-v5.13-rc5' of git://github.com/aw..
> > git tree: upstream
> > final oops: https://syzkaller.appspot.com/x/report.txt?x=14534777d00000
> > console output: https://syzkaller.appspot.com/x/log.txt?x=10534777d00000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=82d85e75046e5e64
> > dashboard link: https://syzkaller.appspot.com/bug?extid=ea2f1484cffe5109dc10
> > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16d5772fd00000
> > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10525947d00000
> >
> > Reported-by: [email protected]
> > Fixes: 24369c2e3bb0 ("io_uring: add io-wq workqueue sharing")
> >
> > For information about bisection process see: https://goo.gl/tpsmEJ#bisection
> >
> This is not a bug, the repro program first set RLIMIT_NPROC to 0, then
> submits an unbound work whcih raises a warning of
> WARN_ON_ONCE(!acct->max_workers). Since unbound->max_workers is
> task_rlimit(current, RLIMIT_NPROC), so it is expected.

Hi Hao,

Then this is a mis-use of WARN_ON. If this check is intended for end
users, it needs to use pr_err (also print understandable message and
no stack trace which is most likely not useful for end users):
https://elixir.bootlin.com/linux/v5.13-rc5/source/include/asm-generic/bug.h#L71

2021-06-10 03:05:25

by Hao Xu

[permalink] [raw]
Subject: Re: [syzbot] WARNING in io_wqe_enqueue

在 2021/6/8 下午8:01, Dmitry Vyukov 写道:
> On Tue, Jun 8, 2021 at 11:47 AM Hao Xu <[email protected]> wrote:
>>
>> 在 2021/6/5 上午4:22, syzbot 写道:
>>> syzbot has bisected this issue to:
>>>
>>> commit 24369c2e3bb06d8c4e71fd6ceaf4f8a01ae79b7c
>>> Author: Pavel Begunkov <[email protected]>
>>> Date: Tue Jan 28 00:15:48 2020 +0000
>>>
>>> io_uring: add io-wq workqueue sharing
>>>
>>> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=17934777d00000
>>> start commit: f88cd3fb Merge tag 'vfio-v5.13-rc5' of git://github.com/aw..
>>> git tree: upstream
>>> final oops: https://syzkaller.appspot.com/x/report.txt?x=14534777d00000
>>> console output: https://syzkaller.appspot.com/x/log.txt?x=10534777d00000
>>> kernel config: https://syzkaller.appspot.com/x/.config?x=82d85e75046e5e64
>>> dashboard link: https://syzkaller.appspot.com/bug?extid=ea2f1484cffe5109dc10
>>> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16d5772fd00000
>>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10525947d00000
>>>
>>> Reported-by: [email protected]
>>> Fixes: 24369c2e3bb0 ("io_uring: add io-wq workqueue sharing")
>>>
>>> For information about bisection process see: https://goo.gl/tpsmEJ#bisection
>>>
>> This is not a bug, the repro program first set RLIMIT_NPROC to 0, then
>> submits an unbound work whcih raises a warning of
>> WARN_ON_ONCE(!acct->max_workers). Since unbound->max_workers is
>> task_rlimit(current, RLIMIT_NPROC), so it is expected.
>
> Hi Hao,
>
> Then this is a mis-use of WARN_ON. If this check is intended for end
> users, it needs to use pr_err (also print understandable message and
> no stack trace which is most likely not useful for end users):
> https://elixir.bootlin.com/linux/v5.13-rc5/source/include/asm-generic/bug.h#L71
>
Agree, pr_err/pr_warn is better here.