RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f58165656d4 R13: 00000000004c957b R14: 00000000004e8a48 R15: 0000000000000006 CPU: 0 PID: 9558 Comm: syz-executor.3 Not tainted 4.14.164-syzkaller #0 ====================================================== WARNING: possible circular locking dependency detected 4.14.164-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/9560 is trying to acquire lock: (console_owner){-.-.}, at: [] console_trylock_spinning kernel/printk/printk.c:1658 [inline] (console_owner){-.-.}, at: [] vprintk_emit kernel/printk/printk.c:1922 [inline] (console_owner){-.-.}, at: [] vprintk_emit+0x2f1/0x600 kernel/printk/printk.c:1888 but task is already holding lock: (&(&port->lock)->rlock){-.-.}, at: [] pty_write+0xe0/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){-.-.}: lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3994 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:160 tty_port_tty_get+0x22/0x90 drivers/tty/tty_port.c:287 tty_port_default_wakeup+0x16/0x40 drivers/tty/tty_port.c:46 tty_port_tty_wakeup+0x57/0x70 drivers/tty/tty_port.c:389 uart_write_wakeup+0x46/0x70 drivers/tty/serial/serial_core.c:116 serial8250_tx_chars+0x40d/0xa10 drivers/tty/serial/8250/8250_port.c:1810 serial8250_handle_irq.part.0+0x206/0x250 drivers/tty/serial/8250/8250_port.c:1883 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1869 [inline] serial8250_default_handle_irq+0xa1/0x120 drivers/tty/serial/8250/8250_port.c:1899 serial8250_interrupt+0xe9/0x1a0 drivers/tty/serial/8250/8250_core.c:129 __handle_irq_event_percpu+0x125/0x7f0 kernel/irq/handle.c:147 handle_irq_event_percpu+0x65/0x130 kernel/irq/handle.c:187 handle_irq_event+0xa7/0x134 kernel/irq/handle.c:204 handle_edge_irq+0x22b/0x840 kernel/irq/chip.c:770 generic_handle_irq_desc include/linux/irqdesc.h:159 [inline] handle_irq+0x39/0x50 arch/x86/kernel/irq_64.c:87 do_IRQ+0x99/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_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:557 default_idle_call+0x36/0x90 kernel/sched/idle.c:98 cpuidle_idle_call kernel/sched/idle.c:156 [inline] do_idle+0x262/0x3d0 kernel/sched/idle.c:246 cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:351 rest_init+0x1d9/0x1e2 init/main.c:434 start_kernel+0x6df/0x6fd init/main.c:708 x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:399 x86_64_start_kernel+0x77/0x7b arch/x86/kernel/head64.c:380 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #1 (&port_lock_key){-.-.}: lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3994 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x95/0xcd kernel/locking/spinlock.c:160 serial8250_console_write+0x709/0x930 drivers/tty/serial/8250/8250_port.c:3232 univ8250_console_write+0x5f/0x70 drivers/tty/serial/8250/8250_core.c:597 call_console_drivers kernel/printk/printk.c:1725 [inline] console_unlock+0x9ba/0xed0 kernel/printk/printk.c:2397 vprintk_emit kernel/printk/printk.c:1923 [inline] vprintk_emit+0x1f9/0x600 kernel/printk/printk.c:1888 vprintk_default+0x28/0x30 kernel/printk/printk.c:1963 vprintk_func+0x5d/0x159 kernel/printk/printk_safe.c:401 printk+0x9e/0xbc kernel/printk/printk.c:1996 register_console+0x614/0x9e0 kernel/printk/printk.c:2716 univ8250_console_init+0x33/0x3f drivers/tty/serial/8250/8250_core.c:692 console_init+0x4d/0x5d kernel/printk/printk.c:2797 start_kernel+0x43c/0x6fd init/main.c:634 x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:399 x86_64_start_kernel+0x77/0x7b arch/x86/kernel/head64.c:380 secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240 -> #0 (console_owner){-.-.}: check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2cb3/0x4620 kernel/locking/lockdep.c:3487 lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3994 console_trylock_spinning kernel/printk/printk.c:1679 [inline] vprintk_emit kernel/printk/printk.c:1922 [inline] vprintk_emit+0x32e/0x600 kernel/printk/printk.c:1888 vprintk_default+0x28/0x30 kernel/printk/printk.c:1963 vprintk_func+0x5d/0x159 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+0xe4/0x159 lib/fault-inject.c:149 should_failslab+0xdb/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+0x71/0x7a0 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:169 [inline] __tty_buffer_request_room+0x1a4/0x500 drivers/tty/tty_buffer.c:267 tty_insert_flip_string_fixed_flag+0x8a/0x1c0 drivers/tty/tty_buffer.c:312 tty_insert_flip_string include/linux/tty_flip.h:37 [inline] pty_write+0x113/0x1d0 drivers/tty/pty.c:122 n_tty_write+0x953/0xf20 drivers/tty/n_tty.c:2356 do_tty_write drivers/tty/tty_io.c:959 [inline] tty_write+0x3f6/0x700 drivers/tty/tty_io.c:1043 do_loop_readv_writev fs/read_write.c:698 [inline] do_loop_readv_writev fs/read_write.c:682 [inline] do_iter_write fs/read_write.c:956 [inline] do_iter_write+0x3d3/0x540 fs/read_write.c:935 vfs_writev+0x170/0x2a0 fs/read_write.c:999 do_writev+0x10a/0x2d0 fs/read_write.c:1034 SYSC_writev fs/read_write.c:1107 [inline] SyS_writev+0x28/0x30 fs/read_write.c:1104 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 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 *** 5 locks held by syz-executor.5/9560: #0: (&tty->ldisc_sem){++++}, at: [] ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:376 #1: (&tty->atomic_write_lock){+.+.}, at: [] tty_write_lock+0x20/0x60 drivers/tty/tty_io.c:885 #2: (&tty->termios_rwsem){++++}, at: [] n_tty_write+0x179/0xf20 drivers/tty/n_tty.c:2316 #3: (&ldata->output_lock){+.+.}, at: [] n_tty_write+0x914/0xf20 drivers/tty/n_tty.c:2355 #4: (&(&port->lock)->rlock){-.-.}, at: [] pty_write+0xe0/0x1d0 drivers/tty/pty.c:120 stack backtrace: CPU: 1 PID: 9560 Comm: syz-executor.5 Not tainted 4.14.164-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+0x142/0x197 lib/dump_stack.c:58 print_circular_bug.isra.0.cold+0x1cc/0x28f kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1901 [inline] check_prevs_add kernel/locking/lockdep.c:2018 [inline] validate_chain kernel/locking/lockdep.c:2460 [inline] __lock_acquire+0x2cb3/0x4620 kernel/locking/lockdep.c:3487 lock_acquire+0x16f/0x430 kernel/locking/lockdep.c:3994 console_trylock_spinning kernel/printk/printk.c:1679 [inline] vprintk_emit kernel/printk/printk.c:1922 [inline] vprintk_emit+0x32e/0x600 kernel/printk/printk.c:1888 vprintk_default+0x28/0x30 kernel/printk/printk.c:1963 vprintk_func+0x5d/0x159 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+0xe4/0x159 lib/fault-inject.c:149 should_failslab+0xdb/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+0x71/0x7a0 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] tty_buffer_alloc drivers/tty/tty_buffer.c:169 [inline] __tty_buffer_request_room+0x1a4/0x500 drivers/tty/tty_buffer.c:267 tty_insert_flip_string_fixed_flag+0x8a/0x1c0 drivers/tty/tty_buffer.c:312 tty_insert_flip_string include/linux/tty_flip.h:37 [inline] pty_write+0x113/0x1d0 drivers/tty/pty.c:122 n_tty_write+0x953/0xf20 drivers/tty/n_tty.c:2356 do_tty_write drivers/tty/tty_io.c:959 [inline] tty_write+0x3f6/0x700 drivers/tty/tty_io.c:1043 do_loop_readv_writev fs/read_write.c:698 [inline] do_loop_readv_writev fs/read_write.c:682 [inline] do_iter_write fs/read_write.c:956 [inline] do_iter_write+0x3d3/0x540 fs/read_write.c:935 vfs_writev+0x170/0x2a0 fs/read_write.c:999 do_writev+0x10a/0x2d0 fs/read_write.c:1034 SYSC_writev fs/read_write.c:1107 [inline] SyS_writev+0x28/0x30 fs/read_write.c:1104 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45af49 RSP: 002b:00007f5816564c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f5816564c90 RCX: 000000000045af49 RDX: 1000000000000252 RSI: 00000000200023c0 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f58165656d4 R13: 00000000004c957b R14: 00000000004e8a48 R15: 0000000000000006 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 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+0x142/0x197 lib/dump_stack.c:58 warn_alloc.cold+0x96/0x1af mm/page_alloc.c:3248 __vmalloc_node_range mm/vmalloc.c:1786 [inline] __vmalloc_node_range+0x3c3/0x6a0 mm/vmalloc.c:1746 __vmalloc_node mm/vmalloc.c:1815 [inline] __vmalloc_node_flags mm/vmalloc.c:1829 [inline] vzalloc+0x46/0x50 mm/vmalloc.c:1868 vidioc_s_fmt_vid_overlay+0x157/0x4a0 drivers/media/platform/vivid/vivid-vid-cap.c:1170 v4l_s_fmt+0x54c/0x980 drivers/media/v4l2-core/v4l2-ioctl.c:1495 __video_do_ioctl+0x6eb/0x740 drivers/media/v4l2-core/v4l2-ioctl.c:2738 video_usercopy+0x3d3/0xf20 drivers/media/v4l2-core/v4l2-ioctl.c:2914 video_ioctl2+0x2d/0x40 drivers/media/v4l2-core/v4l2-ioctl.c:2959 v4l2_ioctl+0x1c0/0x300 drivers/media/v4l2-core/v4l2-dev.c:360 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x7ae/0x1060 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45af49 RSP: 002b:00007f7f691b7c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f7f691b7c90 RCX: 000000000045af49 RDX: 0000000020000240 RSI: 00000000c0d05605 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7f691b86d4 R13: 00000000004c7658 R14: 00000000004df1a8 R15: 0000000000000004 CPU: 1 PID: 9568 Comm: syz-executor.0 Not tainted 4.14.164-syzkaller #0 Mem-Info: Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 active_anon:187642 inactive_anon:204 isolated_anon:0 active_file:12933 inactive_file:11766 isolated_file:0 unevictable:0 dirty:171 writeback:0 unstable:0 slab_reclaimable:13860 slab_unreclaimable:113522 mapped:60165 shmem:250 pagetables:1530 bounce:0 free:1188850 free_pcp:185 free_cma:0 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x142/0x197 lib/dump_stack.c:58 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold+0x10f/0x159 lib/fault-inject.c:149 should_failslab+0xdb/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+0x2f0/0x7a0 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] rw_copy_check_uvector+0x1d8/0x290 fs/read_write.c:776 import_iovec+0xa2/0x370 lib/iov_iter.c:1411 Node 0 active_anon:750568kB inactive_anon:816kB active_file:51592kB inactive_file:47064kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:240660kB dirty:684kB writeback:0kB shmem:1000kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 602112kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no vfs_writev+0xb8/0x2a0 fs/read_write.c:996 Node 1 active_anon:0kB inactive_anon:0kB active_file:140kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:0kB writeback:0kB shmem:0kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no Node 0 do_writev+0x10a/0x2d0 fs/read_write.c:1034 DMA free:15908kB min:216kB low:268kB high:320kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:15992kB managed:15908kB mlocked:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB SYSC_writev fs/read_write.c:1107 [inline] SyS_writev+0x28/0x30 fs/read_write.c:1104 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 lowmem_reserve[]: RIP: 0033:0x45af49 RSP: 002b:00007f3391a94c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 00007f3391a94c90 RCX: 000000000045af49 RDX: 1000000000000252 RSI: 00000000200023c0 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3391a956d4 R13: 00000000004c957b R14: 00000000004e8a48 R15: 0000000000000006 0 2569 2569 2569 2569 Node 0 DMA32 free:955776kB min:36380kB low:45472kB high:54564kB active_anon:750544kB inactive_anon:816kB active_file:51592kB inactive_file:47132kB unevictable:0kB writepending:752kB present:3129332kB managed:2634340kB mlocked:0kB kernel_stack:8352kB pagetables:6164kB bounce:0kB free_pcp:788kB local_pcp:408kB free_cma:0kB lowmem_reserve[]: 0 0 0 0 0 Node 0 Normal free:0kB min:0kB low:0kB high:0kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:786432kB managed:0kB mlocked:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB lowmem_reserve[]: 0 0 0 0 0 Node 1 Normal free:3783552kB min:53508kB low:66884kB high:80260kB active_anon:0kB inactive_anon:0kB active_file:140kB inactive_file:0kB unevictable:0kB writepending:0kB present:3932160kB managed:3870192kB mlocked:0kB kernel_stack:0kB pagetables:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB lowmem_reserve[]: 0 0 0 0 0 Node 0 DMA: 1*4kB (U) 0*8kB 0*16kB 1*32kB (U) 2*64kB (U) 1*128kB (U) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB (M) = 15908kB Node 0 DMA32: 5625*4kB (UM) 288*8kB (UME) 9*16kB (UME) 1669*32kB (UM) 1087*64kB (UM) 164*128kB (UME) 14*256kB (UM) 2*512kB (ME) 2*1024kB (UE) 2*2048kB (ME) 190*4096kB (M) = 957908kB Node 0 Normal: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 0kB Node 1 Normal: 54*4kB (UE) 357*8kB (UME) 264*16kB (UE) 72*32kB (UME) 10*64kB (UM) 9*128kB (U) 7*256kB (UM) 2*512kB (U) 1*1024kB (M) 4*2048kB (ME) 918*4096kB (M) = 3783552kB Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB Node 1 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB Node 1 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB 24965 total pagecache pages 0 pages in swap cache Swap cache stats: add 0, delete 0, find 0/0 Free swap = 0kB Total swap = 0kB 1965979 pages RAM 0 pages HighMem/MovableOnly 335869 pages reserved 0 pages cma reserved netlink: 32 bytes leftover after parsing attributes in process `syz-executor.0'. netlink: 32 bytes leftover after parsing attributes in process `syz-executor.0'. caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect Unknown ioctl 44609 Unknown ioctl 44609 mmap: syz-executor.2 (9841) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'. audit: type=1400 audit(2000000383.011:78): avc: denied { relabelto } for pid=10249 comm="syz-executor.3" name="X25" dev="sockfs" ino=145511 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:cron_spool_t:s0 tclass=socket permissive=1