Y�4��`Ҙ: renamed from lo
======================================================
WARNING: possible circular locking dependency detected
4.14.304-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.0/9694 is trying to acquire lock:
 (&(&gsm->tx_lock)->rlock){-...}, at: [<ffffffff8357507e>] gsmld_write_wakeup+0x4e/0xd0 drivers/tty/n_gsm.c:2490

but task is already holding lock:
 (&port_lock_key){-.-.}, at: [<ffffffff835ca920>] serial8250_handle_irq.part.0+0x20/0x390 drivers/tty/serial/8250/8250_port.c:1894

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&port_lock_key){-.-.}:
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:160
       uart_write_room+0xd5/0x340 drivers/tty/serial/serial_core.c:643
       tty_write_room+0x61/0x80 drivers/tty/tty_ioctl.c:78
       gsmld_write+0x69/0x120 drivers/tty/n_gsm.c:2546
       do_tty_write drivers/tty/tty_io.c:959 [inline]
       tty_write+0x410/0x740 drivers/tty/tty_io.c:1043
       __vfs_write+0xe4/0x630 fs/read_write.c:480
       __kernel_write+0xf5/0x330 fs/read_write.c:501
       write_pipe_buf+0x143/0x1c0 fs/splice.c:797
       splice_from_pipe_feed fs/splice.c:502 [inline]
       __splice_from_pipe+0x326/0x7a0 fs/splice.c:626
       splice_from_pipe fs/splice.c:661 [inline]
       default_file_splice_write+0xc5/0x150 fs/splice.c:809
       do_splice_from fs/splice.c:851 [inline]
       direct_splice_actor+0x115/0x160 fs/splice.c:1018
       splice_direct_to_actor+0x27c/0x730 fs/splice.c:973
       do_splice_direct+0x164/0x210 fs/splice.c:1061
       do_sendfile+0x47f/0xb30 fs/read_write.c:1441
       SYSC_sendfile64 fs/read_write.c:1502 [inline]
       SyS_sendfile64+0xff/0x110 fs/read_write.c:1488
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x5e/0xd3

-> #0 (&(&gsm->tx_lock)->rlock){-...}:
       lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
       __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
       _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:160
       gsmld_write_wakeup+0x4e/0xd0 drivers/tty/n_gsm.c:2490
       tty_wakeup+0xc3/0xf0 drivers/tty/tty_io.c:533
       tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:49
       serial8250_tx_chars+0x3fe/0xc70 drivers/tty/serial/8250/8250_port.c:1828
       serial8250_handle_irq.part.0+0x2c7/0x390 drivers/tty/serial/8250/8250_port.c:1918
       serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1891 [inline]
       serial8250_default_handle_irq+0x8a/0x1f0 drivers/tty/serial/8250/8250_port.c:1934
       serial8250_interrupt+0xf3/0x210 drivers/tty/serial/8250/8250_core.c:129
       __handle_irq_event_percpu+0xee/0x7f0 kernel/irq/handle.c:147
       handle_irq_event_percpu kernel/irq/handle.c:187 [inline]
       handle_irq_event+0xed/0x240 kernel/irq/handle.c:204
       handle_edge_irq+0x224/0xc40 kernel/irq/chip.c:770
       generic_handle_irq_desc include/linux/irqdesc.h:159 [inline]
       handle_irq+0x35/0x50 arch/x86/kernel/irq_64.c:87
       do_IRQ+0x93/0x1d0 arch/x86/kernel/irq.c:230
       ret_from_intr+0x0/0x1e
       arch_local_irq_restore arch/x86/include/asm/paravirt.h:779 [inline]
       lock_acquire+0x1ec/0x3f0 kernel/locking/lockdep.c:4001
       __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
       _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:152
       spin_lock include/linux/spinlock.h:317 [inline]
       inode_sb_list_del fs/inode.c:447 [inline]
       evict+0x170/0x700 fs/inode.c:543
       iput_final fs/inode.c:1523 [inline]
       iput+0x458/0x7e0 fs/inode.c:1550
       dentry_unlink_inode+0x25c/0x310 fs/dcache.c:387
       __dentry_kill+0x320/0x550 fs/dcache.c:591
       shrink_dentry_list+0x2ab/0xac0 fs/dcache.c:1043
       prune_dcache_sb+0xcc/0x120 fs/dcache.c:1152
       super_cache_scan+0x2f9/0x530 fs/super.c:101
       do_shrink_slab mm/vmscan.c:401 [inline]
       shrink_slab+0x535/0xb60 mm/vmscan.c:504
       drop_slab_node+0x2b/0x60 mm/vmscan.c:531
       drop_slab+0x39/0x70 mm/vmscan.c:542
       drop_caches_sysctl_handler+0xc9/0xe0 fs/drop_caches.c:65
       proc_sys_call_handler.isra.0+0x1ba/0x340 fs/proc/proc_sysctl.c:598
       __vfs_write+0xe4/0x630 fs/read_write.c:480
       __kernel_write+0xf5/0x330 fs/read_write.c:501
       write_pipe_buf+0x143/0x1c0 fs/splice.c:797
       splice_from_pipe_feed fs/splice.c:502 [inline]
       __splice_from_pipe+0x326/0x7a0 fs/splice.c:626
       splice_from_pipe fs/splice.c:661 [inline]
       default_file_splice_write+0xc5/0x150 fs/splice.c:809
       do_splice_from fs/splice.c:851 [inline]
       direct_splice_actor+0x115/0x160 fs/splice.c:1018
       splice_direct_to_actor+0x27c/0x730 fs/splice.c:973
       do_splice_direct+0x164/0x210 fs/splice.c:1061
       do_sendfile+0x47f/0xb30 fs/read_write.c:1441
       SYSC_sendfile64 fs/read_write.c:1496 [inline]
       SyS_sendfile64+0x9b/0x110 fs/read_write.c:1488
       do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
       entry_SYSCALL_64_after_hwframe+0x5e/0xd3

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&port_lock_key);
                               lock(&(&gsm->tx_lock)->rlock);
                               lock(&port_lock_key);
  lock(&(&gsm->tx_lock)->rlock);

 *** DEADLOCK ***

7 locks held by syz-executor.0/9694:
 #0:  (sb_writers#4){.+.+}, at: [<ffffffff8187036f>] file_start_write include/linux/fs.h:2714 [inline]
 #0:  (sb_writers#4){.+.+}, at: [<ffffffff8187036f>] do_sendfile+0x84f/0xb30 fs/read_write.c:1440
 #1:  (shrinker_rwsem){++++}, at: [<ffffffff816d843b>] shrink_slab+0x13b/0xb60 mm/vmscan.c:474
 #2:  (&type->s_umount_key#29){++++}, at: [<ffffffff8187a078>] trylock_super fs/super.c:402 [inline]
 #2:  (&type->s_umount_key#29){++++}, at: [<ffffffff8187a078>] super_cache_scan+0x58/0x530 fs/super.c:76
 #3:  (&(&s->s_inode_list_lock)->rlock){+.+.}, at: [<ffffffff818ced70>] spin_lock include/linux/spinlock.h:317 [inline]
 #3:  (&(&s->s_inode_list_lock)->rlock){+.+.}, at: [<ffffffff818ced70>] inode_sb_list_del fs/inode.c:447 [inline]
 #3:  (&(&s->s_inode_list_lock)->rlock){+.+.}, at: [<ffffffff818ced70>] evict+0x170/0x700 fs/inode.c:543
 #4:  (&(&i->lock)->rlock){-.-.}, at: [<ffffffff835b7caa>] spin_lock include/linux/spinlock.h:317 [inline]
 #4:  (&(&i->lock)->rlock){-.-.}, at: [<ffffffff835b7caa>] serial8250_interrupt+0x3a/0x210 drivers/tty/serial/8250/8250_core.c:119
 #5:  (&port_lock_key){-.-.}, at: [<ffffffff835ca920>] serial8250_handle_irq.part.0+0x20/0x390 drivers/tty/serial/8250/8250_port.c:1894
 #6:  (&tty->ldisc_sem){++++}, at: [<ffffffff8355ceab>] tty_ldisc_ref+0x1b/0x80 drivers/tty/tty_ldisc.c:305

stack backtrace:
CPU: 1 PID: 9694 Comm: syz-executor.0 Not tainted 4.14.304-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258
 check_prev_add kernel/locking/lockdep.c:1905 [inline]
 check_prevs_add kernel/locking/lockdep.c:2022 [inline]
 validate_chain kernel/locking/lockdep.c:2464 [inline]
 __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491
 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
 _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:160
 gsmld_write_wakeup+0x4e/0xd0 drivers/tty/n_gsm.c:2490
 tty_wakeup+0xc3/0xf0 drivers/tty/tty_io.c:533
 tty_port_default_wakeup+0x26/0x40 drivers/tty/tty_port.c:49
 serial8250_tx_chars+0x3fe/0xc70 drivers/tty/serial/8250/8250_port.c:1828
 serial8250_handle_irq.part.0+0x2c7/0x390 drivers/tty/serial/8250/8250_port.c:1918
 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1891 [inline]
 serial8250_default_handle_irq+0x8a/0x1f0 drivers/tty/serial/8250/8250_port.c:1934
 serial8250_interrupt+0xf3/0x210 drivers/tty/serial/8250/8250_core.c:129
 __handle_irq_event_percpu+0xee/0x7f0 kernel/irq/handle.c:147
 handle_irq_event_percpu kernel/irq/handle.c:187 [inline]
 handle_irq_event+0xed/0x240 kernel/irq/handle.c:204
 handle_edge_irq+0x224/0xc40 kernel/irq/chip.c:770
 generic_handle_irq_desc include/linux/irqdesc.h:159 [inline]
 handle_irq+0x35/0x50 arch/x86/kernel/irq_64.c:87
 do_IRQ+0x93/0x1d0 arch/x86/kernel/irq.c:230
 common_interrupt+0x93/0x93 arch/x86/entry/entry_64.S:578
 </IRQ>
RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:779 [inline]
RIP: 0010:lock_acquire+0x1ec/0x3f0 kernel/locking/lockdep.c:4001
RSP: 0018:ffff888039bb7380 EFLAGS: 00000282 ORIG_RAX: ffffffffffffffc8
RAX: 1ffffffff11e13d9 RBX: ffff8880b494a180 RCX: 000000000000342a
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: 0000000000000282
RBP: ffff8880a38aca18 R08: ffffffff8b9bec50 R09: 0000000000040064
R10: ffff8880b494aa80 R11: ffff8880b494a180 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000001
 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
 _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:152
 spin_lock include/linux/spinlock.h:317 [inline]
 inode_sb_list_del fs/inode.c:447 [inline]
 evict+0x170/0x700 fs/inode.c:543
 iput_final fs/inode.c:1523 [inline]
 iput+0x458/0x7e0 fs/inode.c:1550
 dentry_unlink_inode+0x25c/0x310 fs/dcache.c:387
 __dentry_kill+0x320/0x550 fs/dcache.c:591
 shrink_dentry_list+0x2ab/0xac0 fs/dcache.c:1043
 prune_dcache_sb+0xcc/0x120 fs/dcache.c:1152
 super_cache_scan+0x2f9/0x530 fs/super.c:101
 do_shrink_slab mm/vmscan.c:401 [inline]
 shrink_slab+0x535/0xb60 mm/vmscan.c:504
 drop_slab_node+0x2b/0x60 mm/vmscan.c:531
 drop_slab+0x39/0x70 mm/vmscan.c:542
 drop_caches_sysctl_handler+0xc9/0xe0 fs/drop_caches.c:65
 proc_sys_call_handler.isra.0+0x1ba/0x340 fs/proc/proc_sysctl.c:598
 __vfs_write+0xe4/0x630 fs/read_write.c:480
 __kernel_write+0xf5/0x330 fs/read_write.c:501
 write_pipe_buf+0x143/0x1c0 fs/splice.c:797
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x326/0x7a0 fs/splice.c:626
 splice_from_pipe fs/splice.c:661 [inline]
 default_file_splice_write+0xc5/0x150 fs/splice.c:809
 do_splice_from fs/splice.c:851 [inline]
 direct_splice_actor+0x115/0x160 fs/splice.c:1018
 splice_direct_to_actor+0x27c/0x730 fs/splice.c:973
 do_splice_direct+0x164/0x210 fs/splice.c:1061
 do_sendfile+0x47f/0xb30 fs/read_write.c:1441
 SYSC_sendfile64 fs/read_write.c:1496 [inline]
 SyS_sendfile64+0x9b/0x110 fs/read_write.c:1488
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3
RIP: 0033:0x7f60ed9800c9
RSP: 002b:00007f60ebef2168 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007f60eda9ff80 RCX: 00007f60ed9800c9
RDX: 0000000020002080 RSI: 0000000000000005 RDI: 0000000000000006
RBP: 00007f60ed9dbae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000870 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd5324d9ef R14: 00007f60ebef2300 R15: 0000000000022000
syz-executor.0 (9694): drop_caches: 2
syz-executor.0 (9694): drop_caches: 2
syz-executor.0 (9924): drop_caches: 2
syz-executor.0 (9924): drop_caches: 2
syz-executor.0 (9938): drop_caches: 2
syz-executor.0 (9938): drop_caches: 2
syz-executor.0 uses obsolete (PF_INET,SOCK_PACKET)
encrypted_key: insufficient parameters specified
Zero length message leads to an empty skb
caif:caif_disconnect_client(): nothing to disconnect
caif:caif_disconnect_client(): nothing to disconnect
netlink: 2 bytes leftover after parsing attributes in process `syz-executor.3'.