RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003 RBP: 00007f3e9f2531d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000200fff R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffe5778327f R14: 00007f3e9f253300 R15: 0000000000022000 ====================================================== WARNING: possible circular locking dependency detected 4.14.218-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/15251 is trying to acquire lock: (console_owner){....}, at: [] console_trylock_spinning syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1658 [inline] (console_owner){....}, at: [] vprintk_emit+0x32a/0x620 syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1922 but task is already holding lock: (&(&port->lock)->rlock){-.-.}, at: [] tty_port_close_start.part.0+0x28/0x4c0 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_port.c:573 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&(&port->lock)->rlock){-.-.}: __raw_spin_lock_irqsave syzkaller/managers/linux-4-14/kernel/./include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x8c/0xc0 syzkaller/managers/linux-4-14/kernel/kernel/locking/spinlock.c:160 tty_port_tty_get+0x1d/0x80 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_port.c:288 tty_port_default_wakeup+0x11/0x40 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_port.c:46 serial8250_tx_chars+0x3fe/0xbf0 syzkaller/managers/linux-4-14/kernel/drivers/tty/serial/8250/8250_port.c:1810 serial8250_handle_irq.part.0+0x28d/0x330 syzkaller/managers/linux-4-14/kernel/drivers/tty/serial/8250/8250_port.c:1897 serial8250_handle_irq syzkaller/managers/linux-4-14/kernel/drivers/tty/serial/8250/8250_port.c:1870 [inline] serial8250_default_handle_irq+0x8a/0x1f0 syzkaller/managers/linux-4-14/kernel/drivers/tty/serial/8250/8250_port.c:1913 serial8250_interrupt+0xf3/0x210 syzkaller/managers/linux-4-14/kernel/drivers/tty/serial/8250/8250_core.c:129 __handle_irq_event_percpu+0xee/0x7f0 syzkaller/managers/linux-4-14/kernel/kernel/irq/handle.c:147 handle_irq_event_percpu syzkaller/managers/linux-4-14/kernel/kernel/irq/handle.c:187 [inline] handle_irq_event+0xf0/0x250 syzkaller/managers/linux-4-14/kernel/kernel/irq/handle.c:204 handle_edge_irq+0x224/0xc40 syzkaller/managers/linux-4-14/kernel/kernel/irq/chip.c:770 generic_handle_irq_desc syzkaller/managers/linux-4-14/kernel/./include/linux/irqdesc.h:159 [inline] handle_irq+0x35/0x50 syzkaller/managers/linux-4-14/kernel/arch/x86/kernel/irq_64.c:87 do_IRQ+0x93/0x1d0 syzkaller/managers/linux-4-14/kernel/arch/x86/kernel/irq.c:230 ret_from_intr+0x0/0x1e native_safe_halt+0xe/0x10 syzkaller/managers/linux-4-14/kernel/./arch/x86/include/asm/irqflags.h:60 arch_safe_halt syzkaller/managers/linux-4-14/kernel/./arch/x86/include/asm/paravirt.h:94 [inline] default_idle+0x47/0x370 syzkaller/managers/linux-4-14/kernel/arch/x86/kernel/process.c:558 cpuidle_idle_call syzkaller/managers/linux-4-14/kernel/kernel/sched/idle.c:156 [inline] do_idle+0x250/0x3c0 syzkaller/managers/linux-4-14/kernel/kernel/sched/idle.c:246 cpu_startup_entry+0x14/0x20 syzkaller/managers/linux-4-14/kernel/kernel/sched/idle.c:351 start_kernel+0x750/0x770 syzkaller/managers/linux-4-14/kernel/init/main.c:708 secondary_startup_64+0xa5/0xb0 syzkaller/managers/linux-4-14/kernel/arch/x86/kernel/head_64.S:240 -> #1 (&port_lock_key){-.-.}: __raw_spin_lock_irqsave syzkaller/managers/linux-4-14/kernel/./include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x8c/0xc0 syzkaller/managers/linux-4-14/kernel/kernel/locking/spinlock.c:160 serial8250_console_write+0x7a7/0x9d0 syzkaller/managers/linux-4-14/kernel/drivers/tty/serial/8250/8250_port.c:3253 call_console_drivers syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1725 [inline] console_unlock+0x99d/0xf20 syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:2400 vprintk_emit+0x224/0x620 syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1923 vprintk_func+0x58/0x160 syzkaller/managers/linux-4-14/kernel/kernel/printk/printk_safe.c:401 printk+0x9e/0xbc syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1996 register_console+0x6f4/0xad0 syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:2719 univ8250_console_init+0x2f/0x3a syzkaller/managers/linux-4-14/kernel/drivers/tty/serial/8250/8250_core.c:691 console_init+0x46/0x53 syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:2800 start_kernel+0x52e/0x770 syzkaller/managers/linux-4-14/kernel/init/main.c:634 secondary_startup_64+0xa5/0xb0 syzkaller/managers/linux-4-14/kernel/arch/x86/kernel/head_64.S:240 -> #0 (console_owner){....}: lock_acquire+0x170/0x3f0 syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:3998 console_trylock_spinning syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1679 [inline] vprintk_emit+0x367/0x620 syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1922 vprintk_func+0x58/0x160 syzkaller/managers/linux-4-14/kernel/kernel/printk/printk_safe.c:401 printk+0x9e/0xbc syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1996 tty_port_close_start.part.0+0x46c/0x4c0 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_port.c:575 tty_port_close_start syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_port.c:647 [inline] tty_port_close+0x3b/0x130 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_port.c:640 tty_release+0x40b/0x10d0 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_io.c:1670 __fput+0x25f/0x7a0 syzkaller/managers/linux-4-14/kernel/fs/file_table.c:210 task_work_run+0x11f/0x190 syzkaller/managers/linux-4-14/kernel/kernel/task_work.c:113 tracehook_notify_resume syzkaller/managers/linux-4-14/kernel/./include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:164 prepare_exit_to_usermode syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:199 [inline] syscall_return_slowpath syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:297 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 *** 2 locks held by syz-executor.4/15251: #0: (&tty->legacy_mutex){+.+.}, at: [] tty_lock+0x5f/0x70 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_mutex.c:19 #1: (&(&port->lock)->rlock){-.-.}, at: [] tty_port_close_start.part.0+0x28/0x4c0 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_port.c:573 stack backtrace: CPU: 0 PID: 15251 Comm: syz-executor.4 Not tainted 4.14.218-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack syzkaller/managers/linux-4-14/kernel/lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 syzkaller/managers/linux-4-14/kernel/lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:1258 check_prev_add syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:1905 [inline] check_prevs_add syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:2022 [inline] validate_chain syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 syzkaller/managers/linux-4-14/kernel/kernel/locking/lockdep.c:3998 console_trylock_spinning syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1679 [inline] vprintk_emit+0x367/0x620 syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1922 vprintk_func+0x58/0x160 syzkaller/managers/linux-4-14/kernel/kernel/printk/printk_safe.c:401 printk+0x9e/0xbc syzkaller/managers/linux-4-14/kernel/kernel/printk/printk.c:1996 tty_port_close_start.part.0+0x46c/0x4c0 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_port.c:575 tty_port_close_start syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_port.c:647 [inline] tty_port_close+0x3b/0x130 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_port.c:640 tty_release+0x40b/0x10d0 syzkaller/managers/linux-4-14/kernel/drivers/tty/tty_io.c:1670 __fput+0x25f/0x7a0 syzkaller/managers/linux-4-14/kernel/fs/file_table.c:210 task_work_run+0x11f/0x190 syzkaller/managers/linux-4-14/kernel/kernel/task_work.c:113 tracehook_notify_resume syzkaller/managers/linux-4-14/kernel/./include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x1ad/0x200 syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:164 prepare_exit_to_usermode syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:199 [inline] syscall_return_slowpath syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:270 [inline] do_syscall_64+0x4a3/0x640 syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x418e1b RSP: 002b:00007ffee2086680 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000418e1b RDX: ffffffffffffffbc RSI: 0000000000570348 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000005680d0 R11: 0000000000000293 R12: 0000000000570348 R13: 0000000000035ae3 R14: 000000000056bf60 R15: 000000000056bf60 FAULT_INJECTION: forcing a failure. name fail_page_alloc, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 15280 Comm: syz-executor.5 Not tainted 4.14.218-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack syzkaller/managers/linux-4-14/kernel/lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 syzkaller/managers/linux-4-14/kernel/lib/dump_stack.c:58 fail_dump syzkaller/managers/linux-4-14/kernel/lib/fault-inject.c:51 [inline] should_fail.cold+0x10a/0x149 syzkaller/managers/linux-4-14/kernel/lib/fault-inject.c:149 should_fail_alloc_page syzkaller/managers/linux-4-14/kernel/mm/page_alloc.c:2898 [inline] prepare_alloc_pages syzkaller/managers/linux-4-14/kernel/mm/page_alloc.c:4131 [inline] __alloc_pages_nodemask+0x22c/0x2720 syzkaller/managers/linux-4-14/kernel/mm/page_alloc.c:4179 alloc_pages_current+0x155/0x260 syzkaller/managers/linux-4-14/kernel/mm/mempolicy.c:2113 alloc_pages syzkaller/managers/linux-4-14/kernel/./include/linux/gfp.h:520 [inline] __page_cache_alloc+0x67/0x80 syzkaller/managers/linux-4-14/kernel/mm/filemap.c:871 __do_page_cache_readahead+0x27e/0x940 syzkaller/managers/linux-4-14/kernel/mm/readahead.c:183 ra_submit syzkaller/managers/linux-4-14/kernel/mm/internal.h:66 [inline] ondemand_readahead.isra.0+0x514/0xb60 syzkaller/managers/linux-4-14/kernel/mm/readahead.c:486 page_cache_sync_readahead syzkaller/managers/linux-4-14/kernel/mm/readahead.c:518 [inline] page_cache_sync_readahead+0xa6/0xf0 syzkaller/managers/linux-4-14/kernel/mm/readahead.c:503 generic_file_buffered_read syzkaller/managers/linux-4-14/kernel/mm/filemap.c:2003 [inline] generic_file_read_iter+0xfbc/0x21c0 syzkaller/managers/linux-4-14/kernel/mm/filemap.c:2273 ext4_file_read_iter+0x14b/0x330 syzkaller/managers/linux-4-14/kernel/fs/ext4/file.c:76 call_read_iter syzkaller/managers/linux-4-14/kernel/./include/linux/fs.h:1772 [inline] generic_file_splice_read+0x3a7/0x5c0 syzkaller/managers/linux-4-14/kernel/fs/splice.c:307 do_splice_to+0xfb/0x140 syzkaller/managers/linux-4-14/kernel/fs/splice.c:880 splice_direct_to_actor+0x207/0x730 syzkaller/managers/linux-4-14/kernel/fs/splice.c:952 do_splice_direct+0x164/0x210 syzkaller/managers/linux-4-14/kernel/fs/splice.c:1061 do_sendfile+0x47f/0xb30 syzkaller/managers/linux-4-14/kernel/fs/read_write.c:1441 SYSC_sendfile64 syzkaller/managers/linux-4-14/kernel/fs/read_write.c:1502 [inline] SyS_sendfile64+0xff/0x110 syzkaller/managers/linux-4-14/kernel/fs/read_write.c:1488 do_syscall_64+0x1d5/0x640 syzkaller/managers/linux-4-14/kernel/arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x465b09 RSP: 002b:00007f3e9f253188 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000465b09 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003 RBP: 00007f3e9f2531d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000200fff R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffe5778327f R14: 00007f3e9f253300 R15: 0000000000022000 netlink: 164 bytes leftover after parsing attributes in process `syz-executor.3'. caif:caif_disconnect_client(): nothing to disconnect can: request_module (can-proto-0) failed. caif:caif_disconnect_client(): nothing to disconnect can: request_module (can-proto-0) failed. x_tables: ip6_tables: rpfilter match: used from hooks PREROUTING/INPUT, but only valid from PREROUTING ax25_connect(): syz-executor.0 uses autobind, please contact jreuter@yaina.de x_tables: ip6_tables: rpfilter match: used from hooks PREROUTING/INPUT, but only valid from PREROUTING IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 ax25_connect(): syz-executor.0 uses autobind, please contact jreuter@yaina.de ax25_connect(): syz-executor.0 uses autobind, please contact jreuter@yaina.de ax25_connect(): syz-executor.0 uses autobind, please contact jreuter@yaina.de can: request_module (can-proto-0) failed. can: request_module (can-proto-0) failed. IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 can: request_module (can-proto-0) failed. caif:caif_disconnect_client(): nothing to disconnect EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue caif:caif_disconnect_client(): nothing to disconnect audit: type=1804 audit(1612906525.215:18): pid=15973 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.4" name="/root/syzkaller-testdir078419832/syzkaller.TG8gMk/240/file0/file0" dev="loop4" ino=17 res=1 can: request_module (can-proto-0) failed. caif:caif_disconnect_client(): nothing to disconnect caif:caif_disconnect_client(): nothing to disconnect audit: type=1800 audit(1612906525.215:19): pid=15973 uid=0 auid=4294967295 ses=4294967295 op="collect_data" cause="failed(directio)" comm="syz-executor.4" name="file0" dev="loop4" ino=17 res=0 audit: type=1804 audit(1612906525.225:20): pid=15973 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir078419832/syzkaller.TG8gMk/240/file0/file0" dev="loop4" ino=17 res=1 audit: type=1804 audit(1612906525.295:21): pid=15973 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir078419832/syzkaller.TG8gMk/240/file0/file0" dev="loop4" ino=17 res=1 ax25_connect(): syz-executor.1 uses autobind, please contact jreuter@yaina.de ax25_connect(): syz-executor.1 uses autobind, please contact jreuter@yaina.de ax25_connect(): syz-executor.1 uses autobind, please contact jreuter@yaina.de ax25_connect(): syz-executor.1 uses autobind, please contact jreuter@yaina.de audit: type=1804 audit(1612906529.005:22): pid=16612 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir078419832/syzkaller.TG8gMk/264/file0" dev="sda1" ino=16471 res=1 audit: type=1804 audit(1612906529.065:23): pid=16612 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir078419832/syzkaller.TG8gMk/264/file0" dev="sda1" ino=16475 res=1 netlink: 12 bytes leftover after parsing attributes in process `syz-executor.3'. IPVS: ftp: loaded support on port[0] = 21 bridge0: port 3(bond1) entered blocking state bridge0: port 3(bond1) entered disabled state device bond1 entered promiscuous mode