R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdc6450daf R14: 00007fc0e98669c0 R15: 000000000119c034 ====================================================== WARNING: possible circular locking dependency detected 4.14.216-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/15464 is trying to acquire lock: (console_owner){-...}, at: [] console_trylock_spinning kernel/printk/printk.c:1658 [inline] (console_owner){-...}, at: [] vprintk_emit+0x32a/0x620 kernel/printk/printk.c:1922 but task is already holding lock: (&(&port->lock)->rlock){-.-.}, at: [] pty_write+0xdb/0x1d0 drivers/tty/pty.c:120 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&(&port->lock)->rlock){-.-.}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:160 tty_port_tty_get+0x1d/0x80 drivers/tty/tty_port.c:288 tty_port_default_wakeup+0x11/0x40 drivers/tty/tty_port.c:46 serial8250_tx_chars+0x3fe/0xbf0 drivers/tty/serial/8250/8250_port.c:1810 serial8250_handle_irq.part.0+0x28d/0x330 drivers/tty/serial/8250/8250_port.c:1897 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1870 [inline] serial8250_default_handle_irq+0x8a/0x1f0 drivers/tty/serial/8250/8250_port.c:1913 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+0xf0/0x250 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 native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:60 arch_safe_halt arch/x86/include/asm/paravirt.h:94 [inline] default_idle+0x47/0x370 arch/x86/kernel/process.c:558 cpuidle_idle_call kernel/sched/idle.c:156 [inline] do_idle+0x250/0x3c0 kernel/sched/idle.c:246 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:351 start_secondary+0x4db/0x670 arch/x86/kernel/smpboot.c:272 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #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 serial8250_console_write+0x7a7/0x9d0 drivers/tty/serial/8250/8250_port.c:3253 call_console_drivers kernel/printk/printk.c:1725 [inline] console_unlock+0x99d/0xf20 kernel/printk/printk.c:2400 vprintk_emit+0x224/0x620 kernel/printk/printk.c:1923 vprintk_func+0x58/0x160 kernel/printk/printk_safe.c:401 printk+0x9e/0xbc kernel/printk/printk.c:1996 register_console+0x6f4/0xad0 kernel/printk/printk.c:2719 univ8250_console_init+0x2f/0x3a drivers/tty/serial/8250/8250_core.c:691 console_init+0x46/0x53 kernel/printk/printk.c:2800 start_kernel+0x52e/0x770 init/main.c:634 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #0 (console_owner){-...}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 console_trylock_spinning kernel/printk/printk.c:1679 [inline] vprintk_emit+0x367/0x620 kernel/printk/printk.c:1922 vprintk_func+0x58/0x160 kernel/printk/printk_safe.c:401 printk+0x9e/0xbc kernel/printk/printk.c:1996 fail_dump lib/fault-inject.c:44 [inline] should_fail.cold+0xdf/0x149 lib/fault-inject.c:149 should_failslab+0xd6/0x130 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:421 [inline] slab_alloc mm/slab.c:3376 [inline] __do_kmalloc mm/slab.c:3718 [inline] __kmalloc+0x6d/0x400 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] tty_buffer_alloc+0xc0/0x270 drivers/tty/tty_buffer.c:169 __tty_buffer_request_room+0x12c/0x290 drivers/tty/tty_buffer.c:267 tty_insert_flip_string_fixed_flag+0x8b/0x210 drivers/tty/tty_buffer.c:312 tty_insert_flip_string include/linux/tty_flip.h:37 [inline] pty_write+0x10d/0x1d0 drivers/tty/pty.c:122 tty_put_char+0xfe/0x120 drivers/tty/tty_io.c:2885 __process_echoes+0x48c/0x8c0 drivers/tty/n_tty.c:728 flush_echoes drivers/tty/n_tty.c:829 [inline] __receive_buf drivers/tty/n_tty.c:1648 [inline] n_tty_receive_buf_common+0x9a3/0x25a0 drivers/tty/n_tty.c:1742 tiocsti drivers/tty/tty_io.c:2186 [inline] tty_ioctl+0xe5a/0x13c0 drivers/tty/tty_io.c:2572 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb other info that might help us debug this: Chain exists of: console_owner --> &port_lock_key --> &(&port->lock)->rlock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&(&port->lock)->rlock); lock(&port_lock_key); lock(&(&port->lock)->rlock); lock(console_owner); *** DEADLOCK *** 4 locks held by syz-executor.1/15464: #0: (&tty->ldisc_sem){++++}, at: [] tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:284 #1: (&o_tty->termios_rwsem/1){++++}, at: [] n_tty_receive_buf_common+0x91/0x25a0 drivers/tty/n_tty.c:1705 #2: (&ldata->output_lock){+.+.}, at: [] flush_echoes drivers/tty/n_tty.c:827 [inline] #2: (&ldata->output_lock){+.+.}, at: [] __receive_buf drivers/tty/n_tty.c:1648 [inline] #2: (&ldata->output_lock){+.+.}, at: [] n_tty_receive_buf_common+0x965/0x25a0 drivers/tty/n_tty.c:1742 #3: (&(&port->lock)->rlock){-.-.}, at: [] pty_write+0xdb/0x1d0 drivers/tty/pty.c:120 stack backtrace: CPU: 1 PID: 15464 Comm: syz-executor.1 Not tainted 4.14.216-syzkaller #0 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+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 console_trylock_spinning kernel/printk/printk.c:1679 [inline] vprintk_emit+0x367/0x620 kernel/printk/printk.c:1922 vprintk_func+0x58/0x160 kernel/printk/printk_safe.c:401 printk+0x9e/0xbc kernel/printk/printk.c:1996 fail_dump lib/fault-inject.c:44 [inline] should_fail.cold+0xdf/0x149 lib/fault-inject.c:149 should_failslab+0xd6/0x130 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:421 [inline] slab_alloc mm/slab.c:3376 [inline] __do_kmalloc mm/slab.c:3718 [inline] __kmalloc+0x6d/0x400 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] tty_buffer_alloc+0xc0/0x270 drivers/tty/tty_buffer.c:169 __tty_buffer_request_room+0x12c/0x290 drivers/tty/tty_buffer.c:267 tty_insert_flip_string_fixed_flag+0x8b/0x210 drivers/tty/tty_buffer.c:312 tty_insert_flip_string include/linux/tty_flip.h:37 [inline] pty_write+0x10d/0x1d0 drivers/tty/pty.c:122 tty_put_char+0xfe/0x120 drivers/tty/tty_io.c:2885 __process_echoes+0x48c/0x8c0 drivers/tty/n_tty.c:728 flush_echoes drivers/tty/n_tty.c:829 [inline] __receive_buf drivers/tty/n_tty.c:1648 [inline] n_tty_receive_buf_common+0x9a3/0x25a0 drivers/tty/n_tty.c:1742 tiocsti drivers/tty/tty_io.c:2186 [inline] tty_ioctl+0xe5a/0x13c0 drivers/tty/tty_io.c:2572 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45e219 RSP: 002b:00007fc0e9865c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 000000000045e219 RDX: 0000000020000100 RSI: 0000000000005412 RDI: 0000000000000004 RBP: 00007fc0e9865ca0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdc6450daf R14: 00007fc0e98669c0 R15: 000000000119c034 ip_tables: iptables: counters copy to user failed while replacing table EXT4-fs (loop0): warning: mounting unchecked fs, running e2fsck is recommended ip_tables: iptables: counters copy to user failed while replacing table EXT4-fs warning (device loop0): ext4_update_dynamic_rev:793: updating to rev 1 because of new feature flag, running e2fsck is recommended FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 EXT4-fs: error -4 creating inode table initialization thread CPU: 0 PID: 15474 Comm: syz-executor.3 Not tainted 4.14.216-syzkaller #0 EXT4-fs (loop0): mount failed 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+0x1b2/0x281 lib/dump_stack.c:58 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold+0x10a/0x149 lib/fault-inject.c:149 should_failslab+0xd6/0x130 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:421 [inline] slab_alloc_node mm/slab.c:3297 [inline] kmem_cache_alloc_node+0x263/0x410 mm/slab.c:3640 __alloc_skb+0x5c/0x510 net/core/skbuff.c:193 alloc_skb include/linux/skbuff.h:980 [inline] alloc_skb_with_frags+0x85/0x500 net/core/skbuff.c:5234 sock_alloc_send_pskb+0x577/0x6d0 net/core/sock.c:2083 __ip_append_data+0x11ec/0x1ff0 net/ipv4/ip_output.c:973 ip_make_skb+0x167/0x1b0 net/ipv4/ip_output.c:1490 udp_sendmsg+0x156f/0x1c80 net/ipv4/udp.c:1052 inet_sendmsg+0x11a/0x4e0 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 ___sys_sendmsg+0x326/0x800 net/socket.c:2062 __sys_sendmmsg+0x129/0x330 net/socket.c:2152 SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0x2f/0x50 net/socket.c:2178 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45e219 RSP: 002b:00007fdf73240c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 000000000045e219 RDX: 000000000800001d RSI: 0000000020007fc0 RDI: 0000000000000003 RBP: 00007fdf73240ca0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fffd73a85df R14: 00007fdf732419c0 R15: 000000000119c034 ip_tables: iptables: counters copy to user failed while replacing table EXT4-fs (loop0): warning: mounting unchecked fs, running e2fsck is recommended EXT4-fs warning (device loop0): ext4_update_dynamic_rev:793: updating to rev 1 because of new feature flag, running e2fsck is recommended EXT4-fs (loop0): mounted filesystem without journal. Opts: noquota,,errors=continue audit: type=1326 audit(1611282824.005:18): auid=0 uid=0 gid=0 ses=4 pid=15555 comm="syz-executor.0" exe="/root/syz-executor.0" sig=9 arch=c000003e syscall=228 compat=0 ip=0x46107a code=0x0 net_ratelimit: 14 callbacks suppressed ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table print_req_error: I/O error, dev loop4, sector 0 audit: type=1326 audit(1611282824.835:19): auid=0 uid=0 gid=0 ses=4 pid=15555 comm="syz-executor.0" exe="/root/syz-executor.0" sig=9 arch=c000003e syscall=228 compat=0 ip=0x46107a code=0x0 IPVS: ftp: loaded support on port[0] = 21 ip_tables: iptables: counters copy to user failed while replacing table print_req_error: I/O error, dev loop4, sector 0 ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table IPVS: ftp: loaded support on port[0] = 21 print_req_error: I/O error, dev loop5, sector 36028797018963960 NILFS (loop5): unable to read secondary superblock (blocksize = 1024) NILFS (loop5): couldn't find nilfs on the device PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex netlink: 28 bytes leftover after parsing attributes in process `syz-executor.1'. print_req_error: I/O error, dev loop5, sector 36028797018963960 NILFS (loop5): unable to read secondary superblock (blocksize = 1024) NILFS (loop5): couldn't find nilfs on the device netlink: 28 bytes leftover after parsing attributes in process `syz-executor.1'. EXT4-fs (loop5): mounted filesystem without journal. Opts: ,errors=continue EXT4-fs error (device loop5): ext4_validate_block_bitmap:405: comm syz-executor.5: bg 0: block 2: invalid block bitmap PF_BRIDGE: RTM_NEWNEIGH with invalid ifindex audit: type=1804 audit(1611282827.495:20): pid=15865 uid=0 auid=0 ses=4 op="invalid_pcr" cause="ToMToU" comm="syz-executor.0" name="/root/syzkaller-testdir965152660/syzkaller.cnoOED/315/file0" dev="sda1" ino=16382 res=1 BFS-fs: bfs_fill_super(): No BFS filesystem on loop0 (magic=00000000) audit: type=1804 audit(1611282827.505:21): pid=15865 uid=0 auid=0 ses=4 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir965152660/syzkaller.cnoOED/315/file0" dev="sda1" ino=16382 res=1 x_tables: ip_tables: socket match: used from hooks OUTPUT, but only valid from PREROUTING/INPUT audit: type=1804 audit(1611282827.545:22): pid=15865 uid=0 auid=0 ses=4 op="invalid_pcr" cause="ToMToU" comm="syz-executor.0" name="/root/syzkaller-testdir965152660/syzkaller.cnoOED/315/file0" dev="sda1" ino=16382 res=1 x_tables: ip_tables: socket match: used from hooks OUTPUT, but only valid from PREROUTING/INPUT audit: type=1804 audit(1611282827.545:23): pid=15865 uid=0 auid=0 ses=4 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir965152660/syzkaller.cnoOED/315/file0" dev="sda1" ino=16382 res=1 (syz-executor.3,16103,0):ocfs2_parse_options:1484 ERROR: Unrecognized mount option "REJECT" or missing value net_ratelimit: 56 callbacks suppressed ip_tables: iptables: counters copy to user failed while replacing table (syz-executor.3,16103,0):ocfs2_fill_super:1217 ERROR: status = -22 ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table (syz-executor.3,16103,1):ocfs2_parse_options:1484 ERROR: Unrecognized mount option "REJECT" or missing value (syz-executor.3,16103,0):ocfs2_fill_super:1217 ERROR: status = -22 ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table uinput: abs_flat #00 out of range: 5 (min:0/max:0) uinput: abs_flat #00 out of range: 5 (min:0/max:0)