public inbox for [email protected]
 help / color / mirror / Atom feed
* [syzbot] possible deadlock in io_poll_double_wake (3)
@ 2021-04-13 21:07 syzbot
       [not found] ` <[email protected]>
  2022-02-11  9:13 ` syzbot
  0 siblings, 2 replies; 4+ messages in thread
From: syzbot @ 2021-04-13 21:07 UTC (permalink / raw)
  To: asml.silence, axboe, io-uring, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    17e7124a Merge tag '5.12-rc6-smb3' of git://git.samba.org/..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=102c3891d00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=9320464bf47598bd
dashboard link: https://syzkaller.appspot.com/bug?extid=e654d4e15e6b3b9deb53
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=15fe3096d00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=147b9431d00000

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

============================================
WARNING: possible recursive locking detected
5.12.0-rc6-syzkaller #0 Not tainted
--------------------------------------------
swapper/0/0 is trying to acquire lock:
ffff88802108c130 (&runtime->sleep){..-.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline]
ffff88802108c130 (&runtime->sleep){..-.}-{2:2}, at: io_poll_double_wake+0x25f/0x6a0 fs/io_uring.c:4988

but task is already holding lock:
ffff888014fd8130 (&runtime->sleep){..-.}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:137

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&runtime->sleep);
  lock(&runtime->sleep);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

2 locks held by swapper/0/0:
 #0: ffff888020d18108 (&group->lock){..-.}-{2:2}, at: _snd_pcm_stream_lock_irqsave+0x9f/0xd0 sound/core/pcm_native.c:170
 #1: ffff888014fd8130 (&runtime->sleep){..-.}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:137

stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.12.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x141/0x1d7 lib/dump_stack.c:120
 print_deadlock_bug kernel/locking/lockdep.c:2829 [inline]
 check_deadlock kernel/locking/lockdep.c:2872 [inline]
 validate_chain kernel/locking/lockdep.c:3661 [inline]
 __lock_acquire.cold+0x14c/0x3b4 kernel/locking/lockdep.c:4900
 lock_acquire kernel/locking/lockdep.c:5510 [inline]
 lock_acquire+0x1ab/0x740 kernel/locking/lockdep.c:5475
 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
 _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151
 spin_lock include/linux/spinlock.h:354 [inline]
 io_poll_double_wake+0x25f/0x6a0 fs/io_uring.c:4988
 __wake_up_common+0x147/0x650 kernel/sched/wait.c:108
 __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:138
 snd_pcm_update_state+0x46a/0x540 sound/core/pcm_lib.c:203
 snd_pcm_update_hw_ptr0+0xa75/0x1a50 sound/core/pcm_lib.c:464
 snd_pcm_period_elapsed+0x160/0x250 sound/core/pcm_lib.c:1805
 dummy_hrtimer_callback+0x94/0x1b0 sound/drivers/dummy.c:377
 __run_hrtimer kernel/time/hrtimer.c:1537 [inline]
 __hrtimer_run_queues+0x609/0xe40 kernel/time/hrtimer.c:1601
 hrtimer_run_softirq+0x17b/0x360 kernel/time/hrtimer.c:1618
 __do_softirq+0x29b/0x9f6 kernel/softirq.c:345
 invoke_softirq kernel/softirq.c:221 [inline]
 __irq_exit_rcu kernel/softirq.c:422 [inline]
 irq_exit_rcu+0x134/0x200 kernel/softirq.c:434
 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1100
 </IRQ>
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:632
RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:29 [inline]
RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline]
RIP: 0010:arch_irqs_disabled arch/x86/include/asm/irqflags.h:137 [inline]
RIP: 0010:acpi_safe_halt drivers/acpi/processor_idle.c:112 [inline]
RIP: 0010:acpi_idle_do_entry+0x1c9/0x250 drivers/acpi/processor_idle.c:517
Code: cd cb 6e f8 84 db 75 ac e8 14 c5 6e f8 e8 1f b4 74 f8 e9 0c 00 00 00 e8 05 c5 6e f8 0f 00 2d 0e 18 c8 00 e8 f9 c4 6e f8 fb f4 <9c> 5b 81 e3 00 02 00 00 fa 31 ff 48 89 de e8 04 cd 6e f8 48 85 db
RSP: 0018:ffffffff8bc07d60 EFLAGS: 00000293
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffffffff8bcbc400 RSI: ffffffff89052c17 RDI: 0000000000000000
RBP: ffff888015078064 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff8179e058 R11: 0000000000000000 R12: 0000000000000001
R13: ffff888015078000 R14: ffff888015078064 R15: ffff888143a48004
 acpi_idle_enter+0x361/0x500 drivers/acpi/processor_idle.c:654
 cpuidle_enter_state+0x1b1/0xc80 drivers/cpuidle/cpuidle.c:237
 cpuidle_enter+0x4a/0xa0 drivers/cpuidle/cpuidle.c:351
 call_cpuidle kernel/sched/idle.c:158 [inline]
 cpuidle_idle_call kernel/sched/idle.c:239 [inline]
 do_idle+0x3e1/0x590 kernel/sched/idle.c:300


---
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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

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

* Re: [syzbot] possible deadlock in io_poll_double_wake (3)
       [not found] ` <[email protected]>
@ 2021-04-15  7:39   ` Dmitry Vyukov
  0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Vyukov @ 2021-04-15  7:39 UTC (permalink / raw)
  To: Hillf Danton
  Cc: syzbot, Pavel Begunkov, Jens Axboe, io-uring, LKML,
	syzkaller-bugs

On Thu, Apr 15, 2021 at 9:23 AM Hillf Danton <[email protected]> wrote:
>
> On Tue, 13 Apr 2021 14:07:16
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > HEAD commit:    17e7124a Merge tag '5.12-rc6-smb3' of git://git.samba.org/..
> > git tree:       upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=102c3891d00000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=9320464bf47598bd
> > dashboard link: https://syzkaller.appspot.com/bug?extid=e654d4e15e6b3b9deb53
> > syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=15fe3096d00000
> > C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=147b9431d00000
> >
> > IMPORTANT: if you fix the issue, please add the following tag to the commit:
> > Reported-by: [email protected]
> >
> > ============================================
> > WARNING: possible recursive locking detected
> > 5.12.0-rc6-syzkaller #0 Not tainted
> > --------------------------------------------
> > swapper/0/0 is trying to acquire lock:
> > ffff88802108c130 (&runtime->sleep){..-.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline]
> > ffff88802108c130 (&runtime->sleep){..-.}-{2:2}, at: io_poll_double_wake+0x25f/0x6a0 fs/io_uring.c:4988
> >
> > but task is already holding lock:
> > ffff888014fd8130 (&runtime->sleep){..-.}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:137
> >
> > other info that might help us debug this:
> >  Possible unsafe locking scenario:
> >
> >        CPU0
> >        ----
> >   lock(&runtime->sleep);
> >   lock(&runtime->sleep);
> >
> >  *** DEADLOCK ***
>
> Wasnt it fixed by 1c3b3e6527e57, given the same call trace at the first
> glance?

1c3b3e6527e57 is present in the tested tree on 17e7124a. So syzbot
just gave the answer to your question.

> >  May be due to missing lock nesting notation
> >
> > 2 locks held by swapper/0/0:
> >  #0: ffff888020d18108 (&group->lock){..-.}-{2:2}, at: _snd_pcm_stream_lock_irqsave+0x9f/0xd0 sound/core/pcm_native.c:170
> >  #1: ffff888014fd8130 (&runtime->sleep){..-.}-{2:2}, at: __wake_up_common_lock+0xb4/0x130 kernel/sched/wait.c:137
> >
> > stack backtrace:
> > CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.12.0-rc6-syzkaller #0
> > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> > Call Trace:
> >  <IRQ>
> >  __dump_stack lib/dump_stack.c:79 [inline]
> >  dump_stack+0x141/0x1d7 lib/dump_stack.c:120
> >  print_deadlock_bug kernel/locking/lockdep.c:2829 [inline]
> >  check_deadlock kernel/locking/lockdep.c:2872 [inline]
> >  validate_chain kernel/locking/lockdep.c:3661 [inline]
> >  __lock_acquire.cold+0x14c/0x3b4 kernel/locking/lockdep.c:4900
> >  lock_acquire kernel/locking/lockdep.c:5510 [inline]
> >  lock_acquire+0x1ab/0x740 kernel/locking/lockdep.c:5475
> >  __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
> >  _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151
> >  spin_lock include/linux/spinlock.h:354 [inline]
> >  io_poll_double_wake+0x25f/0x6a0 fs/io_uring.c:4988
> >  __wake_up_common+0x147/0x650 kernel/sched/wait.c:108
> >  __wake_up_common_lock+0xd0/0x130 kernel/sched/wait.c:138
> >  snd_pcm_update_state+0x46a/0x540 sound/core/pcm_lib.c:203
> >  snd_pcm_update_hw_ptr0+0xa75/0x1a50 sound/core/pcm_lib.c:464
> >  snd_pcm_period_elapsed+0x160/0x250 sound/core/pcm_lib.c:1805
> >  dummy_hrtimer_callback+0x94/0x1b0 sound/drivers/dummy.c:377
> >  __run_hrtimer kernel/time/hrtimer.c:1537 [inline]
> >  __hrtimer_run_queues+0x609/0xe40 kernel/time/hrtimer.c:1601
> >  hrtimer_run_softirq+0x17b/0x360 kernel/time/hrtimer.c:1618
> >  __do_softirq+0x29b/0x9f6 kernel/softirq.c:345
> >  invoke_softirq kernel/softirq.c:221 [inline]
> >  __irq_exit_rcu kernel/softirq.c:422 [inline]
> >  irq_exit_rcu+0x134/0x200 kernel/softirq.c:434
> >  sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1100
> >  </IRQ>
> >  asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:632
> > RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:29 [inline]
> > RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline]
> > RIP: 0010:arch_irqs_disabled arch/x86/include/asm/irqflags.h:137 [inline]
> > RIP: 0010:acpi_safe_halt drivers/acpi/processor_idle.c:112 [inline]
> > RIP: 0010:acpi_idle_do_entry+0x1c9/0x250 drivers/acpi/processor_idle.c:517
> > Code: cd cb 6e f8 84 db 75 ac e8 14 c5 6e f8 e8 1f b4 74 f8 e9 0c 00 00 00 e8 05 c5 6e f8 0f 00 2d 0e 18 c8 00 e8 f9 c4 6e f8 fb f4 <9c> 5b 81 e3 00 02 00 00 fa 31 ff 48 89 de e8 04 cd 6e f8 48 85 db
> > RSP: 0018:ffffffff8bc07d60 EFLAGS: 00000293
> > RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
> > RDX: ffffffff8bcbc400 RSI: ffffffff89052c17 RDI: 0000000000000000
> > RBP: ffff888015078064 R08: 0000000000000001 R09: 0000000000000001
> > R10: ffffffff8179e058 R11: 0000000000000000 R12: 0000000000000001
> > R13: ffff888015078000 R14: ffff888015078064 R15: ffff888143a48004
> >  acpi_idle_enter+0x361/0x500 drivers/acpi/processor_idle.c:654
> >  cpuidle_enter_state+0x1b1/0xc80 drivers/cpuidle/cpuidle.c:237
> >  cpuidle_enter+0x4a/0xa0 drivers/cpuidle/cpuidle.c:351
> >  call_cpuidle kernel/sched/idle.c:158 [inline]
> >  cpuidle_idle_call kernel/sched/idle.c:239 [inline]
> >  do_idle+0x3e1/0x590 kernel/sched/idle.c:300
> >
> >
> > ---
> > 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.
> > syzbot can test patches for this issue, for details see:
> > https://goo.gl/tpsmEJ#testing-patches

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

* Re: [syzbot] possible deadlock in io_poll_double_wake (3)
  2021-04-13 21:07 [syzbot] possible deadlock in io_poll_double_wake (3) syzbot
       [not found] ` <[email protected]>
@ 2022-02-11  9:13 ` syzbot
  2022-02-11 13:24   ` Jens Axboe
  1 sibling, 1 reply; 4+ messages in thread
From: syzbot @ 2022-02-11  9:13 UTC (permalink / raw)
  To: alaaemadhossney.ae, asml.silence, axboe, dvyukov, hdanton,
	io-uring, linux-kernel, syzkaller-bugs

syzbot suspects this issue was fixed by commit:

commit aa43477b040251f451db0d844073ac00a8ab66ee
Author: Pavel Begunkov <[email protected]>
Date:   Wed Dec 15 22:08:48 2021 +0000

    io_uring: poll rework

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=110d0baa700000
start commit:   c9e6606c7fe9 Linux 5.16-rc8
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=4772459294eb89cc
dashboard link: https://syzkaller.appspot.com/bug?extid=e654d4e15e6b3b9deb53
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=10f87335b00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15ac8a73b00000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: io_uring: poll rework

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

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

* Re: [syzbot] possible deadlock in io_poll_double_wake (3)
  2022-02-11  9:13 ` syzbot
@ 2022-02-11 13:24   ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2022-02-11 13:24 UTC (permalink / raw)
  To: syzbot, alaaemadhossney.ae, asml.silence, dvyukov, hdanton,
	io-uring, linux-kernel, syzkaller-bugs

#syz fix: io_uring: poll rework

-- 
Jens Axboe


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

end of thread, other threads:[~2022-02-11 13:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-13 21:07 [syzbot] possible deadlock in io_poll_double_wake (3) syzbot
     [not found] ` <[email protected]>
2021-04-15  7:39   ` Dmitry Vyukov
2022-02-11  9:13 ` syzbot
2022-02-11 13:24   ` Jens Axboe

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