2024-06-07 17:12:07

by chase xd

[permalink] [raw]
Subject: [io-uring] WARNING in io_rsrc_ref_quiesce

Dear Linux kernel maintainers,

Syzkaller reports this previously unknown bug on Linux
6.8.0-rc3-00043-ga69d20885494-dirty #4. Seems like the bug was
silently or unintendedly fixed in the latest version.

```
------------[ cut here ]------------
do not call blocking ops when !TASK_RUNNING; state=1 set at
[<ffffffff815d2494>] prepare_to_wait+0xa4/0x380
kernel/sched/wait.c:237
WARNING: CPU: 2 PID: 397056 at kernel/sched/core.c:10099
__might_sleep+0x114/0x160 kernel/sched/core.c:10099
Modules linked in:
CPU: 2 PID: 397056 Comm: syz-executor.2 Not tainted
6.8.0-rc3-00043-ga69d20885494-dirty #50
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
RIP: 0010:__might_sleep+0x114/0x160 kernel/sched/core.c:10099
Code: 03 00 48 8d bb 50 17 00 00 48 89 fa 48 c1 ea 03 80 3c 02 00 75
37 48 8b 93 50 17 00 00 48 c7 c7 a0 55 0b 8a e8 9d d4 f4 ff 90 <0f> 0b
90 90 e9 71 ff ff ff e8 4e 28 78 00 e9 22 ff ff ff 89 34 24
RSP: 0018:ffffc9000bf5fb40 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffff888053524880 RCX: 0000000000000000
RDX: 0000000000000002 RSI: 0000000000000004 RDI: 0000000000000001
RBP: ffffffff8a0bc600 R08: 0000000000000001 R09: ffffed1017315171
R10: ffff8880b98a8b8b R11: 0000000000000000 R12: 0000000000000249
R13: 0000000000000000 R14: dffffc0000000000 R15: ffffc9000bf5fd20
FS: 00007fe4ffdcc640(0000) GS:ffff8880b9880000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa501ba3098 CR3: 0000000022b8c000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
<TASK>
__mutex_lock_common kernel/locking/mutex.c:585 [inline]
__mutex_lock+0xb4/0x940 kernel/locking/mutex.c:752
io_rsrc_ref_quiesce+0x590/0x940 io_uring/rsrc.c:253
io_sqe_buffers_unregister+0xa2/0x340 io_uring/rsrc.c:799
__io_uring_register io_uring/register.c:424 [inline]
__do_sys_io_uring_register+0x5b9/0x2400 io_uring/register.c:613
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xd8/0x270 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7fe4ff0902ed
Code: c3 e8 97 2b 00 00 0f 1f 80 00 00 00 00 f3 0f 1e fa 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fe4ffdcc028 EFLAGS: 00000246 ORIG_RAX: 00000000000001ab
RAX: ffffffffffffffda RBX: 00007fe4ff1cbf80 RCX: 00007fe4ff0902ed
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003
RBP: 00007fe4ff0f150e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fe4ff1cbf80 R15: 00007fe4ffdac000
</TASK>

```

crepro is in the attachment.

Best Regards
Xdchase


Attachments:
repro.c (16.49 kB)

2024-06-12 01:13:26

by Pavel Begunkov

[permalink] [raw]
Subject: Re: [io-uring] WARNING in io_rsrc_ref_quiesce

On 6/7/24 18:11, chase xd wrote:
> Dear Linux kernel maintainers,
>
> Syzkaller reports this previously unknown bug on Linux
> 6.8.0-rc3-00043-ga69d20885494-dirty #4. Seems like the bug was
> silently or unintendedly fixed in the latest version.

Thanks for reports, this one looks legit. I'll fix
it up. Do you have a name I can put as "reported-by"?


--
Pavel Begunkov

2024-06-12 06:53:47

by chase xd

[permalink] [raw]
Subject: Re: [io-uring] WARNING in io_rsrc_ref_quiesce

Thanks for the reply, “xdchase” is ok for the credit.

chase xd <[email protected]> 于2024年6月12日周三 08:38写道:
>
> Thanks for the reply, “xdchase” is ok.
>
> On Wed, Jun 12, 2024 at 03:13 Pavel Begunkov <[email protected]> wrote:
>>
>> On 6/7/24 18:11, chase xd wrote:
>> > Dear Linux kernel maintainers,
>> >
>> > Syzkaller reports this previously unknown bug on Linux
>> > 6.8.0-rc3-00043-ga69d20885494-dirty #4. Seems like the bug was
>> > silently or unintendedly fixed in the latest version.
>>
>> Thanks for reports, this one looks legit. I'll fix
>> it up. Do you have a name I can put as "reported-by"?
>>
>>
>> --
>> Pavel Begunkov

2024-06-12 12:39:13

by Pavel Begunkov

[permalink] [raw]
Subject: Re: [io-uring] WARNING in io_rsrc_ref_quiesce

On 6/12/24 07:53, chase xd wrote:
> Thanks for the reply, “xdchase” is ok for the credit.

They require a real name though, and "xdchase" doesn't seem
to qualify.


> chase xd <[email protected]> 于2024年6月12日周三 08:38写道:
>>
>> Thanks for the reply, “xdchase” is ok.
>>
>> On Wed, Jun 12, 2024 at 03:13 Pavel Begunkov <[email protected]> wrote:
>>>
>>> On 6/7/24 18:11, chase xd wrote:
>>>> Dear Linux kernel maintainers,
>>>>
>>>> Syzkaller reports this previously unknown bug on Linux
>>>> 6.8.0-rc3-00043-ga69d20885494-dirty #4. Seems like the bug was
>>>> silently or unintendedly fixed in the latest version.
>>>
>>> Thanks for reports, this one looks legit. I'll fix
>>> it up. Do you have a name I can put as "reported-by"?
>>>
>>>
>>> --
>>> Pavel Begunkov

--
Pavel Begunkov