R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffcaadd9acf R14: 00007fed5cac5300 R15: 0000000000022000 ====================================================== WARNING: possible circular locking dependency detected 4.14.282-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/12736 is trying to acquire lock: (console_owner){....}, at: [] console_trylock_spinning kernel/printk/printk.c:1660 [inline] (console_owner){....}, at: [] vprintk_emit+0x32a/0x620 kernel/printk/printk.c:1924 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/0xbe0 drivers/tty/serial/8250/8250_port.c:1826 serial8250_handle_irq.part.0+0x28d/0x330 drivers/tty/serial/8250/8250_port.c:1913 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1886 [inline] serial8250_default_handle_irq+0x8a/0x1f0 drivers/tty/serial/8250/8250_port.c:1929 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_kernel+0x750/0x770 init/main.c:708 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+0x7d5/0xa10 drivers/tty/serial/8250/8250_port.c:3269 call_console_drivers kernel/printk/printk.c:1727 [inline] console_unlock+0x99d/0xf20 kernel/printk/printk.c:2409 vprintk_emit+0x224/0x620 kernel/printk/printk.c:1925 vprintk_func+0x58/0x160 kernel/printk/printk_safe.c:409 printk+0x9e/0xbc kernel/printk/printk.c:1998 register_console+0x6f4/0xad0 kernel/printk/printk.c:2728 univ8250_console_init+0x2f/0x3a drivers/tty/serial/8250/8250_core.c:691 console_init+0x46/0x53 kernel/printk/printk.c:2809 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:1681 [inline] vprintk_emit+0x367/0x620 kernel/printk/printk.c:1924 vprintk_func+0x58/0x160 kernel/printk/printk_safe.c:409 printk+0x9e/0xbc kernel/printk/printk.c:1998 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 n_tty_write+0x85e/0xda0 drivers/tty/n_tty.c:2356 do_tty_write drivers/tty/tty_io.c:959 [inline] tty_write+0x410/0x740 drivers/tty/tty_io.c:1043 __vfs_write+0xe4/0x630 fs/read_write.c:480 vfs_write+0x17f/0x4d0 fs/read_write.c:544 SYSC_write fs/read_write.c:590 [inline] SyS_write+0xf2/0x210 fs/read_write.c:582 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 *** 5 locks held by syz-executor.1/12736: #0: (&tty->ldisc_sem){++++}, at: [] tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:284 #1: (&tty->atomic_write_lock){+.+.}, at: [] tty_write_lock drivers/tty/tty_io.c:885 [inline] #1: (&tty->atomic_write_lock){+.+.}, at: [] do_tty_write drivers/tty/tty_io.c:908 [inline] #1: (&tty->atomic_write_lock){+.+.}, at: [] tty_write+0x22d/0x740 drivers/tty/tty_io.c:1043 #2: (&tty->termios_rwsem){++++}, at: [] n_tty_write+0x18a/0xda0 drivers/tty/n_tty.c:2316 #3: (&ldata->output_lock){+.+.}, at: [] n_tty_write+0x82b/0xda0 drivers/tty/n_tty.c:2355 #4: (&(&port->lock)->rlock){-.-.}, at: [] pty_write+0xdb/0x1d0 drivers/tty/pty.c:120 stack backtrace: CPU: 0 PID: 12736 Comm: syz-executor.1 Not tainted 4.14.282-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:1681 [inline] vprintk_emit+0x367/0x620 kernel/printk/printk.c:1924 vprintk_func+0x58/0x160 kernel/printk/printk_safe.c:409 printk+0x9e/0xbc kernel/printk/printk.c:1998 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 n_tty_write+0x85e/0xda0 drivers/tty/n_tty.c:2356 do_tty_write drivers/tty/tty_io.c:959 [inline] tty_write+0x410/0x740 drivers/tty/tty_io.c:1043 __vfs_write+0xe4/0x630 fs/read_write.c:480 vfs_write+0x17f/0x4d0 fs/read_write.c:544 SYSC_write fs/read_write.c:590 [inline] SyS_write+0xf2/0x210 fs/read_write.c:582 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7fed5e150109 RSP: 002b:00007fed5cac5168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fed5e262f60 RCX: 00007fed5e150109 RDX: 0000000000000001 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 00007fed5cac51d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffcaadd9acf R14: 00007fed5cac5300 R15: 0000000000022000 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 audit: type=1400 audit(1654667974.181:1182): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=12755 comm="syz-executor.2" CPU: 0 PID: 12768 Comm: syz-executor.4 Not tainted 4.14.282-syzkaller #0 audit: type=1400 audit(1654667974.301:1183): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=12760 comm="syz-executor.2" 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 mm/slab.c:3376 [inline] __do_kmalloc mm/slab.c:3718 [inline] __kmalloc_track_caller+0x2bc/0x400 mm/slab.c:3735 memdup_user+0x22/0xa0 mm/util.c:164 proc_pid_attr_write+0x16c/0x320 fs/proc/base.c:2588 __vfs_write+0xe4/0x630 fs/read_write.c:480 vfs_write+0x17f/0x4d0 fs/read_write.c:544 SYSC_write fs/read_write.c:590 [inline] SyS_write+0xf2/0x210 fs/read_write.c:582 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7f0a883b8109 RSP: 002b:00007f0a86d2d168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f0a884caf60 RCX: 00007f0a883b8109 RDX: 0000000000000007 RSI: 0000000020000040 RDI: 0000000000000003 RBP: 00007f0a86d2d1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffff47ab9df R14: 00007f0a86d2d300 R15: 0000000000022000 audit: type=1400 audit(1654667975.221:1184): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=12793 comm="syz-executor.2" AppArmor: change_hat: Invalid input, NULL hat and NULL magic AppArmor: change_hat: Invalid input, NULL hat and NULL magic audit: type=1400 audit(1654667975.271:1185): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=12814 comm="syz-executor.2" split_token_from_name: 26 callbacks suppressed AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input, NULL hat and NULL magic audit: type=1400 audit(1654667975.381:1186): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=12839 comm="syz-executor.2" AppArmor: change_hat: Invalid input, NULL hat and NULL magic AppArmor: change_hat: Invalid input, NULL hat and NULL magic audit: type=1400 audit(1654667975.441:1187): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=12854 comm="syz-executor.2" AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input, NULL hat and NULL magic AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input, NULL hat and NULL magic AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' kauditd_printk_skb: 15 callbacks suppressed audit: type=1400 audit(1654667977.642:1203): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=13465 comm="syz-executor.2" audit: type=1400 audit(1654667977.672:1204): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=13476 comm="syz-executor.4" audit: type=1400 audit(1654667977.772:1205): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=13487 comm="syz-executor.4" audit: type=1400 audit(1654667977.862:1206): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=13507 comm="syz-executor.4" audit: type=1400 audit(1654667978.142:1207): apparmor="DENIED" operation="stack" info="label not found" error=-2 profile="unconfined" name=FFACA26BF1A8BC76F76F81990B71091F4983BCBA8184859C8A1FC0833F846FE2A4BEB36C8345BF84344FCA068D5EF89A95771B567E655EB4BAAB46F4A5FD5DF77B454386E07A84FFF27D53E97B9CB949FA9B2854F0 pid=13572 comm="syz-executor.4" audit: audit_backlog=65 > audit_backlog_limit=64 audit: audit_lost=16 audit_rate_limit=0 audit_backlog_limit=64 audit: audit_backlog=65 > audit_backlog_limit=64 audit: type=1400 audit(1654667978.142:1208): apparmor="DENIED" operation="change_hat" info="unconfined can not change_hat" error=-1 profile="unconfined" pid=13572 comm="syz-executor.4" audit: audit_lost=17 audit_rate_limit=0 audit_backlog_limit=64 block nbd4: not configured, cannot reconfigure block nbd4: not configured, cannot reconfigure sctp: [Deprecated]: syz-executor.4 (pid 14037) Use of int in max_burst socket option. Use struct sctp_assoc_value instead netlink: 20 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor.5'. sctp: [Deprecated]: syz-executor.4 (pid 14076) Use of int in max_burst socket option. Use struct sctp_assoc_value instead netlink: 20 bytes leftover after parsing attributes in process `syz-executor.5'. sctp: [Deprecated]: syz-executor.4 (pid 14107) Use of int in max_burst socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor.4 (pid 14107) Use of int in max_burst socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor.4 (pid 14107) Use of int in max_burst socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor.4 (pid 14107) Use of int in max_burst socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor.4 (pid 14107) Use of int in max_burst socket option. Use struct sctp_assoc_value instead netlink: 20 bytes leftover after parsing attributes in process `syz-executor.3'. sctp: [Deprecated]: syz-executor.4 (pid 14107) Use of int in max_burst socket option. Use struct sctp_assoc_value instead sctp: [Deprecated]: syz-executor.4 (pid 14107) Use of int in max_burst socket option. Use struct sctp_assoc_value instead netlink: 20 bytes leftover after parsing attributes in process `syz-executor.3'. sctp: [Deprecated]: syz-executor.4 (pid 14107) Use of int in max_burst socket option. Use struct sctp_assoc_value instead netlink: 20 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 20 bytes leftover after parsing attributes in process `syz-executor.3'. split_token_from_name: 93 callbacks suppressed AppArmor: change_hat: Invalid input '0' netlink: 20 bytes leftover after parsing attributes in process `syz-executor.3'. AppArmor: change_hat: Invalid input '0x0000000000«ž000001^/proc/thread-self/attr/curermprofile permprofile' netlink: 20 bytes leftover after parsing attributes in process `syz-executor.3'. AppArmor: change_hat: Invalid input '0x0000000000«ž000001^/proc/thread-self/attr/curermprofile permprofile' AppArmor: change_hat: Invalid input '0x0000000000«ž000001^/proc/thread-self/attr/curermprofile permprofile' AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' AppArmor: change_hat: Invalid input '0' nbd: must specify a device to reconfigure nbd: must specify a device to reconfigure nbd: must specify a device to reconfigure kauditd_printk_skb: 92 callbacks suppressed audit: type=1400 audit(1654667983.402:1299): apparmor="DENIED" operation="setprocattr" info="current" error=-22 profile="unconfined" pid=15077 comm="syz-executor.0" audit: type=1400 audit(1654667983.562:1300): apparmor="DENIED" operation="setprocattr" info="current" error=-22 profile="unconfined" pid=15110 comm="syz-executor.0"