RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006 R13: 0000000000000203 R14: 00000000004c4253 R15: 0000000000000000 CPU: 1 PID: 15274 Comm: syz-executor.2 Not tainted 4.19.112-syzkaller #0 ====================================================== WARNING: possible circular locking dependency detected 4.19.112-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/15280 is trying to acquire lock: 0000000064423870 (console_owner){-...}, at: console_trylock_spinning kernel/printk/printk.c:1669 [inline] 0000000064423870 (console_owner){-...}, at: vprintk_emit+0x3d8/0x6e0 kernel/printk/printk.c:1936 but task is already holding lock: 00000000677fa6c7 (&(&port->lock)->rlock){-.-.}, at: tty_port_close_start.part.0+0x28/0x540 drivers/tty/tty_port.c:574 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&(&port->lock)->rlock){-.-.}: tty_port_tty_get+0x1d/0x80 drivers/tty/tty_port.c:289 tty_port_default_wakeup+0x11/0x40 drivers/tty/tty_port.c:47 serial8250_tx_chars+0x48f/0xae0 drivers/tty/serial/8250/8250_port.c:1806 serial8250_handle_irq.part.0+0x24b/0x290 drivers/tty/serial/8250/8250_port.c:1879 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1865 [inline] serial8250_default_handle_irq+0xb5/0x140 drivers/tty/serial/8250/8250_port.c:1895 serial8250_interrupt+0xf2/0x1d0 drivers/tty/serial/8250/8250_core.c:125 __handle_irq_event_percpu+0x144/0x8e0 kernel/irq/handle.c:149 handle_irq_event_percpu+0x76/0x160 kernel/irq/handle.c:189 handle_irq_event+0xa2/0x12d kernel/irq/handle.c:206 handle_edge_irq+0x24b/0x8c0 kernel/irq/chip.c:797 generic_handle_irq_desc include/linux/irqdesc.h:155 [inline] handle_irq+0x35/0x50 arch/x86/kernel/irq_64.c:87 do_IRQ+0x93/0x1c0 arch/x86/kernel/irq.c:246 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+0x49/0x320 arch/x86/kernel/process.c:565 cpuidle_idle_call kernel/sched/idle.c:153 [inline] do_idle+0x2ee/0x4b0 kernel/sched/idle.c:263 cpu_startup_entry+0xc6/0xd0 kernel/sched/idle.c:369 start_secondary+0x3e4/0x590 arch/x86/kernel/smpboot.c:271 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243 -> #1 (&port_lock_key){-.-.}: serial8250_console_write+0x79f/0x9c0 drivers/tty/serial/8250/8250_port.c:3251 call_console_drivers kernel/printk/printk.c:1736 [inline] console_unlock+0xb26/0xfe0 kernel/printk/printk.c:2429 vprintk_emit+0x282/0x6e0 kernel/printk/printk.c:1937 vprintk_func+0x79/0x17e kernel/printk/printk_safe.c:398 printk+0xba/0xed kernel/printk/printk.c:2012 register_console+0x752/0xb50 kernel/printk/printk.c:2745 univ8250_console_init+0x3a/0x46 drivers/tty/serial/8250/8250_core.c:684 console_init+0x4cb/0x718 kernel/printk/printk.c:2831 start_kernel+0x594/0x81c init/main.c:660 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243 -> #0 (console_owner){-...}: console_trylock_spinning kernel/printk/printk.c:1690 [inline] vprintk_emit+0x415/0x6e0 kernel/printk/printk.c:1936 vprintk_func+0x79/0x17e kernel/printk/printk_safe.c:398 printk+0xba/0xed kernel/printk/printk.c:2012 tty_port_close_start.part.0+0x4f0/0x540 drivers/tty/tty_port.c:576 tty_port_close_start drivers/tty/tty_port.c:648 [inline] tty_port_close+0x46/0xe0 drivers/tty/tty_port.c:641 tty_release+0x3b9/0xe90 drivers/tty/tty_io.c:1678 __fput+0x2cd/0x890 fs/file_table.c:278 task_work_run+0x13f/0x1b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x25a/0x2b0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe 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 *** 2 locks held by syz-executor.4/15280: #0: 00000000e4424ec6 (&tty->legacy_mutex){+.+.}, at: tty_lock+0x6a/0xa0 drivers/tty/tty_mutex.c:19 #1: 00000000677fa6c7 (&(&port->lock)->rlock){-.-.}, at: tty_port_close_start.part.0+0x28/0x540 drivers/tty/tty_port.c:574 stack backtrace: CPU: 0 PID: 15280 Comm: syz-executor.4 Not tainted 4.19.112-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x188/0x20d lib/dump_stack.c:118 print_circular_bug.isra.0.cold+0x1c4/0x282 kernel/locking/lockdep.c:1221 check_prev_add kernel/locking/lockdep.c:1861 [inline] check_prevs_add kernel/locking/lockdep.c:1974 [inline] validate_chain kernel/locking/lockdep.c:2415 [inline] __lock_acquire+0x2e19/0x49c0 kernel/locking/lockdep.c:3411 lock_acquire+0x170/0x400 kernel/locking/lockdep.c:3903 console_trylock_spinning kernel/printk/printk.c:1690 [inline] vprintk_emit+0x415/0x6e0 kernel/printk/printk.c:1936 vprintk_func+0x79/0x17e kernel/printk/printk_safe.c:398 printk+0xba/0xed kernel/printk/printk.c:2012 tty_port_close_start.part.0+0x4f0/0x540 drivers/tty/tty_port.c:576 tty_port_close_start drivers/tty/tty_port.c:648 [inline] tty_port_close+0x46/0xe0 drivers/tty/tty_port.c:641 tty_release+0x3b9/0xe90 drivers/tty/tty_io.c:1678 __fput+0x2cd/0x890 fs/file_table.c:278 task_work_run+0x13f/0x1b0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x25a/0x2b0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4163e1 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 04 1b 00 00 c3 48 83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007fff478f7f70 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 00000000004163e1 RDX: 0000000000000000 RSI: 0000000000000081 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0000000000770240 R09: 01ffffffffffffff R10: 00007fff478f8040 R11: 0000000000000293 R12: 000000000076bf00 R13: 0000000000770248 R14: 0000000000000000 R15: 000000000076bf0c 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:77 [inline] dump_stack+0x188/0x20d lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold+0xa/0x1b lib/fault-inject.c:149 __should_failslab+0x115/0x180 mm/failslab.c:32 should_failslab+0x5/0xf mm/slab_common.c:1558 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] kmem_cache_alloc+0x29f/0x710 mm/slab.c:3557 ptlock_alloc+0x1d/0x70 mm/memory.c:4833 ptlock_init include/linux/mm.h:1885 [inline] pgtable_page_ctor include/linux/mm.h:1919 [inline] pte_alloc_one+0x68/0x190 arch/x86/mm/pgtable.c:38 do_fault_around mm/memory.c:3635 [inline] do_read_fault mm/memory.c:3676 [inline] do_fault mm/memory.c:3810 [inline] handle_pte_fault mm/memory.c:4041 [inline] __handle_mm_fault+0x321e/0x3b60 mm/memory.c:4165 handle_mm_fault+0x1a5/0x670 mm/memory.c:4202 __do_page_fault+0x5ed/0xdd0 arch/x86/mm/fault.c:1390 page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1204 RIP: 0010:__get_user_4+0x21/0x30 arch/x86/lib/getuser.S:78 Code: 50 ff 31 c0 0f 1f 00 c3 90 48 83 c0 03 72 55 65 48 8b 14 25 40 ee 01 00 48 3b 82 18 14 00 00 73 43 48 19 d2 48 21 d0 0f 1f 00 <8b> 50 fd 31 c0 0f 1f 00 c3 66 0f 1f 44 00 00 48 83 c0 07 72 25 65 RSP: 0018:ffff88803a4d7ab0 EFLAGS: 00010206 RAX: 000000002000009f RBX: 1ffff1100749af57 RCX: ffffc9000a2c8000 RDX: ffffffffffffffff RSI: ffffffff8575e4c2 RDI: 0000000000000286 RBP: 0000000020000040 R08: 0000000000000000 R09: 0000000000000000 R10: ffff888095ffce00 R11: ffffffff8b1bac78 R12: 0000000000000001 R13: ffff888216788040 R14: ffff888098456ac0 R15: 0000000000000000 snd_pcm_status_user+0xbb/0x180 sound/core/pcm_native.c:982 snd_pcm_common_ioctl+0x59a/0x1f10 sound/core/pcm_native.c:2902 snd_pcm_ioctl+0x7e/0xb0 sound/core/pcm_native.c:2975 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcda/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c849 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f5382112c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f53821136d4 RCX: 000000000045c849 RDX: 0000000020000040 RSI: 00000000c0984124 RDI: 0000000000000003 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006 R13: 0000000000000203 R14: 00000000004c4253 R15: 0000000000000001 CPU: 0 PID: 15285 Comm: syz-executor.3 Not tainted 4.19.112-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x188/0x20d lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold+0xa/0x1b lib/fault-inject.c:149 __should_failslab+0x115/0x180 mm/failslab.c:32 should_failslab+0x5/0xf mm/slab_common.c:1558 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] kmem_cache_alloc+0x29f/0x710 mm/slab.c:3557 anon_vma_chain_alloc mm/rmap.c:129 [inline] __anon_vma_prepare+0x59/0x3a0 mm/rmap.c:183 anon_vma_prepare include/linux/rmap.h:153 [inline] wp_page_copy+0xeee/0x1530 mm/memory.c:2504 do_wp_page+0x518/0xfa0 mm/memory.c:2799 handle_pte_fault mm/memory.c:4057 [inline] __handle_mm_fault+0x21a4/0x3b60 mm/memory.c:4165 handle_mm_fault+0x1a5/0x670 mm/memory.c:4202 __do_page_fault+0x5ed/0xdd0 arch/x86/mm/fault.c:1390 page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1204 RIP: 0010:copy_user_enhanced_fast_string+0xe/0x20 arch/x86/lib/copy_user_64.S:181 Code: 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 1f 00 c3 0f 1f 80 00 00 00 00 0f 1f 00 83 fa 40 0f 82 70 ff ff ff 89 d1 a4 31 c0 0f 1f 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 83 RSP: 0018:ffff888037467a50 EFLAGS: 00010206 RAX: ffffed1006e8cf6d RBX: 0000000000000088 RCX: 0000000000000088 RDX: 0000000000000088 RSI: ffff888037467ae0 RDI: 0000000020000040 RBP: ffff888037467ae0 R08: ffffed1006e8cf6d R09: 0000000000000005 R10: ffffed1006e8cf6c R11: ffff888037467b67 R12: 0000000020000040 R13: 00000000200000c8 R14: 00007ffffffff000 R15: 0000000000000000 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:128 [inline] _copy_to_user+0xe2/0x100 lib/usercopy.c:28 copy_to_user include/linux/uaccess.h:155 [inline] snd_pcm_sync_ptr+0x361/0x520 sound/core/pcm_native.c:2765 snd_pcm_common_ioctl+0xd07/0x1f10 sound/core/pcm_native.c:2935 snd_pcm_ioctl+0x7e/0xb0 sound/core/pcm_native.c:2975 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcda/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45c849 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f42b1bf3c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f42b1bf46d4 RCX: 000000000045c849 RDX: 0000000020000040 RSI: 00000000c0884123 RDI: 0000000000000003 RBP: 000000000076bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006 R13: 0000000000000203 R14: 00000000004c4253 R15: 0000000000000002 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=1280 sclass=netlink_route_socket pig=15347 comm=syz-executor.1 SELinux: unrecognized netlink message: protocol=0 nlmsg_type=1280 sclass=netlink_route_socket pig=15347 comm=syz-executor.1 x_tables: eb_tables: mark.0 target: invalid size 16 (kernel) != (user) 0 x_tables: eb_tables: mark.0 target: invalid size 16 (kernel) != (user) 0 audit: type=1326 audit(1584792819.116:85): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=15521 comm="syz-executor.1" exe="/root/syz-executor.1" sig=9 arch=c000003e syscall=228 compat=0 ip=0x45f68a code=0x0 audit: type=1326 audit(1584792819.926:86): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 pid=15521 comm="syz-executor.1" exe="/root/syz-executor.1" sig=9 arch=c000003e syscall=228 compat=0 ip=0x45f68a code=0x0 audit: type=1400 audit(1584792820.256:87): avc: denied { map } for pid=15605 comm="syz-executor.5" path="/selinux/status" dev="selinuxfs" ino=19 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=system_u:object_r:security_t:s0 tclass=file permissive=1 [U]  SELinux: unrecognized netlink message: protocol=0 nlmsg_type=5123 sclass=netlink_route_socket pig=15741 comm=syz-executor.4 [U]  SELinux: unrecognized netlink message: protocol=0 nlmsg_type=5123 sclass=netlink_route_socket pig=15741 comm=syz-executor.4 [U]  [U]  [U]  [U]  [U]  [U]  audit: type=1804 audit(1584792822.486:88): pid=15955 uid=0 auid=4294967295 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 op=invalid_pcr cause=open_writers comm="syz-executor.1" name="/root/syzkaller-testdir558109212/syzkaller.I4ApmY/306/bus" dev="sda1" ino=17094 res=1 audit: type=1804 audit(1584792822.486:89): pid=15955 uid=0 auid=4294967295 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 op=invalid_pcr cause=ToMToU comm="syz-executor.1" name="/root/syzkaller-testdir558109212/syzkaller.I4ApmY/306/bus" dev="sda1" ino=17094 res=1 audit: type=1804 audit(1584792822.546:90): pid=15955 uid=0 auid=4294967295 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 op=invalid_pcr cause=open_writers comm="syz-executor.1" name="/root/syzkaller-testdir558109212/syzkaller.I4ApmY/306/bus" dev="sda1" ino=17094 res=1 [U]  [U]  audit: type=1804 audit(1584792822.546:91): pid=15960 uid=0 auid=4294967295 ses=4294967295 subj=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 op=invalid_pcr cause=ToMToU comm="syz-executor.1" name="/root/syzkaller-testdir558109212/syzkaller.I4ApmY/306/bus" dev="sda1" ino=17094 res=1 [U]  [U]  [U]  [U]  [U]  [U]  [U]  [U]  [U]  [U]  SELinux: unrecognized netlink message: protocol=0 nlmsg_type=257 sclass=netlink_route_socket pig=16366 comm=syz-executor.1