====================================================== WARNING: possible circular locking dependency detected 4.14.0+ #190 Not tainted ------------------------------------------------------ syz-executor5/9900 is trying to acquire lock: (&pipe->mutex/1){+.+.}, at: [] pipe_lock_nested fs/pipe.c:67 [inline] (&pipe->mutex/1){+.+.}, at: [] pipe_lock+0x56/0x70 fs/pipe.c:75 but task is already holding lock: (sb_writers){.+.+}, at: [] file_start_write include/linux/fs.h:2715 [inline] (sb_writers){.+.+}, at: [] do_splice fs/splice.c:1146 [inline] (sb_writers){.+.+}, at: [] SYSC_splice fs/splice.c:1402 [inline] (sb_writers){.+.+}, at: [] SyS_splice+0x1117/0x1630 fs/splice.c:1382 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (sb_writers){.+.+}: spin_lock include/linux/spinlock.h:315 [inline] refcount_dec_and_lock+0x42/0x70 lib/refcount.c:343 -> #4 ((completion)&req.done){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004 complete_acquire include/linux/completion.h:40 [inline] __wait_for_common kernel/sched/completion.c:109 [inline] wait_for_common kernel/sched/completion.c:123 [inline] wait_for_completion+0xcb/0x7b0 kernel/sched/completion.c:144 devtmpfs_create_node+0x32b/0x4a0 drivers/base/devtmpfs.c:115 device_add+0x120f/0x1640 drivers/base/core.c:1824 device_register+0x1d/0x20 drivers/base/core.c:1905 tty_register_device_attr+0x422/0x740 drivers/tty/tty_io.c:2956 tty_port_register_device_attr_serdev+0x100/0x140 drivers/tty/tty_port.c:166 uart_add_one_port+0xa7a/0x15b0 drivers/tty/serial/serial_core.c:2783 serial8250_register_8250_port+0xfac/0x1990 drivers/tty/serial/8250/8250_core.c:1045 serial_pnp_probe+0x5e7/0xac0 drivers/tty/serial/8250/8250_pnp.c:480 pnp_device_probe+0x15f/0x250 drivers/pnp/driver.c:109 really_probe drivers/base/dd.c:424 [inline] driver_probe_device+0x71b/0xae0 drivers/base/dd.c:566 __driver_attach+0x181/0x1c0 drivers/base/dd.c:800 bus_for_each_dev+0x154/0x1e0 drivers/base/bus.c:313 driver_attach+0x3d/0x50 drivers/base/dd.c:819 bus_add_driver+0x466/0x620 drivers/base/bus.c:669 driver_register+0x1bf/0x3c0 drivers/base/driver.c:168 pnp_register_driver+0x75/0xa0 drivers/pnp/driver.c:272 serial8250_pnp_init+0x15/0x20 drivers/tty/serial/8250/8250_pnp.c:537 serial8250_init+0x8f/0x270 drivers/tty/serial/8250/8250_core.c:1122 do_one_initcall+0x9e/0x330 init/main.c:826 do_initcall_level init/main.c:892 [inline] do_initcalls init/main.c:900 [inline] do_basic_setup init/main.c:918 [inline] kernel_init_freeable+0x469/0x521 init/main.c:1066 kernel_init+0x13/0x172 init/main.c:993 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:437 -> #3 (&port->mutex){+.+.}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 uart_set_termios+0x8f/0x5b0 drivers/tty/serial/serial_core.c:1416 tty_set_termios+0x6d4/0xa40 drivers/tty/tty_ioctl.c:334 set_termios+0x377/0x6b0 drivers/tty/tty_ioctl.c:414 tty_mode_ioctl+0x9fb/0xb10 drivers/tty/tty_ioctl.c:749 n_tty_ioctl_helper+0x40/0x360 drivers/tty/tty_ioctl.c:940 n_tty_ioctl+0x148/0x2d0 drivers/tty/n_tty.c:2435 tty_ioctl+0x32e/0x15f0 drivers/tty/tty_io.c:2638 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 entry_SYSCALL_64_fastpath+0x1f/0x96 -> #2 (&tty->termios_rwsem){++++}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004 down_read+0x96/0x150 kernel/locking/rwsem.c:24 n_tty_write+0x249/0xed0 drivers/tty/n_tty.c:2285 do_tty_write drivers/tty/tty_io.c:949 [inline] tty_write+0x400/0x850 drivers/tty/tty_io.c:1033 redirected_tty_write+0xa1/0xb0 drivers/tty/tty_io.c:1054 __vfs_write+0xef/0x970 fs/read_write.c:480 vfs_write+0x18f/0x510 fs/read_write.c:544 SYSC_write fs/read_write.c:589 [inline] SyS_write+0xef/0x220 fs/read_write.c:581 entry_SYSCALL_64_fastpath+0x1f/0x96 -> #1 (&tty->ldisc_sem){++++}: lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004 __ldsem_down_read_nested+0xd1/0xa90 drivers/tty/tty_ldsem.c:325 ldsem_down_read+0x37/0x40 drivers/tty/tty_ldsem.c:365 tty_ldisc_ref_wait+0x25/0x80 drivers/tty/tty_ldisc.c:277 tty_read+0xf8/0x250 drivers/tty/tty_io.c:852 do_loop_readv_writev fs/read_write.c:673 [inline] do_iter_read+0x3db/0x5b0 fs/read_write.c:897 vfs_readv+0x121/0x1c0 fs/read_write.c:959 kernel_readv fs/splice.c:361 [inline] default_file_splice_read+0x508/0xae0 fs/splice.c:416 do_splice_to+0x110/0x170 fs/splice.c:880 do_splice fs/splice.c:1173 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0x11a8/0x1630 fs/splice.c:1382 entry_SYSCALL_64_fastpath+0x1f/0x96 -> #0 (&pipe->mutex/1){+.+.}: check_prevs_add kernel/locking/lockdep.c:2031 [inline] validate_chain kernel/locking/lockdep.c:2473 [inline] __lock_acquire+0x3498/0x47f0 kernel/locking/lockdep.c:3500 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 pipe_lock_nested fs/pipe.c:67 [inline] pipe_lock+0x56/0x70 fs/pipe.c:75 iter_file_splice_write+0x264/0xf30 fs/splice.c:699 do_splice_from fs/splice.c:851 [inline] do_splice fs/splice.c:1147 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0x7d5/0x1630 fs/splice.c:1382 entry_SYSCALL_64_fastpath+0x1f/0x96 other info that might help us debug this: Chain exists of: &pipe->mutex/1 --> (completion)&req.done --> sb_writers Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sb_writers); lock((completion)&req.done); lock(sb_writers); lock(&pipe->mutex/1); *** DEADLOCK *** 1 lock held by syz-executor5/9900: #0: (sb_writers){.+.+}, at: [] file_start_write include/linux/fs.h:2715 [inline] #0: (sb_writers){.+.+}, at: [] do_splice fs/splice.c:1146 [inline] #0: (sb_writers){.+.+}, at: [] SYSC_splice fs/splice.c:1402 [inline] #0: (sb_writers){.+.+}, at: [] SyS_splice+0x1117/0x1630 fs/splice.c:1382 stack backtrace: CPU: 1 PID: 9900 Comm: syz-executor5 Not tainted 4.14.0+ #190 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x257 lib/dump_stack.c:53 print_circular_bug+0x42d/0x610 kernel/locking/lockdep.c:1271 check_prev_add+0x666/0x15f0 kernel/locking/lockdep.c:1914 check_prevs_add kernel/locking/lockdep.c:2031 [inline] validate_chain kernel/locking/lockdep.c:2473 [inline] __lock_acquire+0x3498/0x47f0 kernel/locking/lockdep.c:3500 lock_acquire+0x1d5/0x580 kernel/locking/lockdep.c:4004 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0x16f/0x1a80 kernel/locking/mutex.c:893 mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:908 pipe_lock_nested fs/pipe.c:67 [inline] pipe_lock+0x56/0x70 fs/pipe.c:75 iter_file_splice_write+0x264/0xf30 fs/splice.c:699 do_splice_from fs/splice.c:851 [inline] do_splice fs/splice.c:1147 [inline] SYSC_splice fs/splice.c:1402 [inline] SyS_splice+0x7d5/0x1630 fs/splice.c:1382 entry_SYSCALL_64_fastpath+0x1f/0x96 RIP: 0033:0x452879 RSP: 002b:00007ff7e2f07be8 EFLAGS: 00000212 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 0000000000758020 RCX: 0000000000452879 RDX: 0000000000000019 RSI: 0000000000000000 RDI: 0000000000000017 RBP: 0000000000000086 R08: 00000000fffffdf8 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006ef788 R13: 00000000ffffffff R14: 00007ff7e2f086d4 R15: 0000000000000000 sctp: [Deprecated]: syz-executor6 (pid 10024) Use of int in max_burst socket option deprecated. Use struct sctp_assoc_value instead audit: type=1326 audit(1511352199.212:2149): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10030 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0x7ffc0000 nla_parse: 5 callbacks suppressed netlink: 12 bytes leftover after parsing attributes in process `syz-executor5'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor5'. audit: type=1326 audit(1511352199.244:2150): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10030 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=2 compat=0 ip=0x40cbb1 code=0x7ffc0000 sg_write: data in/out 40729/47 bytes for SCSI command 0x0-- guessing data in; program syz-executor0 not setting count and/or reply_len properly audit: type=1326 audit(1511352199.244:2151): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10030 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0x7ffc0000 audit: type=1326 audit(1511352199.245:2152): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10030 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=55 compat=0 ip=0x452879 code=0x7ffc0000 audit: type=1326 audit(1511352199.245:2153): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10030 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0x7ffc0000 audit: type=1326 audit(1511352199.245:2154): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10030 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=54 compat=0 ip=0x452879 code=0x7ffc0000 sctp: [Deprecated]: syz-executor6 (pid 10063) Use of int in max_burst socket option deprecated. Use struct sctp_assoc_value instead audit: type=1326 audit(1511352199.245:2155): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10030 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0x7ffc0000 audit: type=1326 audit(1511352199.245:2156): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10030 comm="syz-executor1" exe="/root/syz-executor1" sig=0 arch=c000003e syscall=41 compat=0 ip=0x452879 code=0x7ffc0000 device gre0 entered promiscuous mode device gre0 entered promiscuous mode netlink: 2 bytes leftover after parsing attributes in process `syz-executor7'. sctp: [Deprecated]: syz-executor1 (pid 10289) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sctp: [Deprecated]: syz-executor1 (pid 10313) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead netlink: 2 bytes leftover after parsing attributes in process `syz-executor7'. QAT: Invalid ioctl QAT: Invalid ioctl device eql entered promiscuous mode sctp: [Deprecated]: syz-executor1 (pid 10289) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sctp: [Deprecated]: syz-executor1 (pid 10313) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead QAT: Invalid ioctl QAT: Invalid ioctl SELinux: unrecognized netlink message: protocol=0 nlmsg_type=9296 sclass=netlink_route_socket pig=10449 comm=syz-executor3 device syz7 entered promiscuous mode sg_write: data in/out 822404280/197 bytes for SCSI command 0x12-- guessing data in; program syz-executor2 not setting count and/or reply_len properly netlink: 2 bytes leftover after parsing attributes in process `syz-executor4'. sg_write: data in/out 262364/161 bytes for SCSI command 0xff-- guessing data in; program syz-executor2 not setting count and/or reply_len properly netlink: 2 bytes leftover after parsing attributes in process `syz-executor4'. sg_write: data in/out 822404280/197 bytes for SCSI command 0x12-- guessing data in; program syz-executor2 not setting count and/or reply_len properly sg_write: data in/out 262364/161 bytes for SCSI command 0xff-- guessing data in; program syz-executor2 not setting count and/or reply_len properly kauditd_printk_skb: 142 callbacks suppressed audit: type=1326 audit(1511352201.988:2299): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10593 comm="syz-executor1" exe="/root/syz-executor1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0xffff0000 netlink: 6 bytes leftover after parsing attributes in process `syz-executor7'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor6'. netlink: 6 bytes leftover after parsing attributes in process `syz-executor7'. audit: type=1326 audit(1511352202.135:2300): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10593 comm="syz-executor1" exe="/root/syz-executor1" sig=31 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0xffff0000 netlink: 3 bytes leftover after parsing attributes in process `syz-executor6'. device gre0 entered promiscuous mode QAT: Invalid ioctl device gre0 entered promiscuous mode QAT: Invalid ioctl audit: type=1326 audit(1511352202.473:2301): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10698 comm="syz-executor2" exe="/root/syz-executor2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0xffff0000 sctp: [Deprecated]: syz-executor4 (pid 10728) Use of int in maxseg socket option. Use struct sctp_assoc_value instead audit: type=1326 audit(1511352202.593:2302): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=10698 comm="syz-executor2" exe="/root/syz-executor2" sig=31 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0xffff0000 sctp: [Deprecated]: syz-executor4 (pid 10744) Use of int in maxseg socket option. Use struct sctp_assoc_value instead device syz4 entered promiscuous mode ALSA: seq fatal error: cannot create timer (-19) sctp: [Deprecated]: syz-executor6 (pid 10908) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead sctp: [Deprecated]: syz-executor6 (pid 10911) Use of struct sctp_assoc_value in delayed_ack socket option. Use struct sctp_sack_info instead QAT: failed to copy from user. audit: type=1326 audit(1511352204.036:2303): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=11150 comm="syz-executor3" exe="/root/syz-executor3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0xffff0000 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=8 sclass=netlink_route_socket pig=11176 comm=syz-executor0 sctp: [Deprecated]: syz-executor7 (pid 11182) Use of int in max_burst socket option deprecated. Use struct sctp_assoc_value instead SELinux: unrecognized netlink message: protocol=0 nlmsg_type=8 sclass=netlink_route_socket pig=11176 comm=syz-executor0 audit: type=1326 audit(1511352204.237:2304): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=11150 comm="syz-executor3" exe="/root/syz-executor3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0xffff0000 QAT: Invalid ioctl sctp: [Deprecated]: syz-executor7 (pid 11210) Use of int in max_burst socket option deprecated. Use struct sctp_assoc_value instead QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl nla_parse: 7 callbacks suppressed netlink: 5 bytes leftover after parsing attributes in process `syz-executor3'. device eql entered promiscuous mode netlink: 11 bytes leftover after parsing attributes in process `syz-executor2'. netlink: 5 bytes leftover after parsing attributes in process `syz-executor3'. device lo entered promiscuous mode device lo left promiscuous mode netlink: 3 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor0'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor0'. sctp: [Deprecated]: syz-executor7 (pid 11388) Use of int in maxseg socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor7 (pid 11394) Use of int in maxseg socket option. Use struct sctp_assoc_value instead device eql entered promiscuous mode skbuff: bad partial csum: csum=65534/0 len=32 sctp: [Deprecated]: syz-executor7 (pid 11419) Use of int in maxseg socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor7 (pid 11419) Use of int in maxseg socket option. Use struct sctp_assoc_value instead audit: type=1326 audit(1511352205.270:2305): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=11428 comm=656D3173797374656D2176626F78EE exe="/root/syz-executor0" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0x7ffc0000 audit: type=1326 audit(1511352205.297:2306): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=11428 comm=656D3173797374656D2176626F78EE exe="/root/syz-executor0" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0x7ffc0000 audit: type=1326 audit(1511352205.298:2307): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=11428 comm="syz-executor0" exe="/root/syz-executor0" sig=0 arch=c000003e syscall=202 compat=0 ip=0x452879 code=0x7ffc0000 audit: type=1326 audit(1511352205.298:2308): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=11428 comm="syz-executor0" exe="/root/syz-executor0" sig=0 arch=c000003e syscall=228 compat=0 ip=0x45561a code=0x7ffc0000 pit: kvm: requested 4190 ns i8254 timer period limited to 500000 ns pit: kvm: requested 4190 ns i8254 timer period limited to 500000 ns netlink: 12 bytes leftover after parsing attributes in process `syz-executor3'. tc_ctl_action: received NO action attribs netlink: 12 bytes leftover after parsing attributes in process `syz-executor3'. tc_ctl_action: received NO action attribs device gre0 entered promiscuous mode SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=11677 comm=syz-executor6 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=0 sclass=netlink_route_socket pig=11695 comm=syz-executor6 QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl QAT: Invalid ioctl PF_BRIDGE: br_mdb_parse() with invalid ifindex PF_BRIDGE: br_mdb_parse() with invalid ifindex netlink: 3 bytes leftover after parsing attributes in process `syz-executor3'. netlink: 3 bytes leftover after parsing attributes in process `syz-executor2'.