R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffcc0627fbf R14: 00007f95a138a300 R15: 0000000000022000 CPU: 0 PID: 30658 Comm: syz-executor.2 Not tainted 4.14.293-syzkaller #0 ====================================================== WARNING: possible circular locking dependency detected 4.14.293-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.1/30654 is trying to acquire lock: (console_owner){....}, at: [] log_next kernel/printk/printk.c:495 [inline] (console_owner){....}, at: [] console_unlock+0x307/0xf20 kernel/printk/printk.c:2396 but task is already holding lock: (&(&port->lock)->rlock){-.-.}, at: [] tty_insert_flip_string_and_push_buffer+0x2b/0x160 drivers/tty/tty_buffer.c:569 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/0xc70 drivers/tty/serial/8250/8250_port.c:1828 serial8250_handle_irq.part.0+0x28d/0x330 drivers/tty/serial/8250/8250_port.c:1915 serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1888 [inline] serial8250_default_handle_irq+0x8a/0x1f0 drivers/tty/serial/8250/8250_port.c:1931 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+0xed/0x240 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+0x743/0x763 init/main.c:712 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:3273 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+0x521/0x763 init/main.c:638 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_lock_spinning_enable kernel/printk/printk.c:1590 [inline] console_unlock+0x36f/0xf20 kernel/printk/printk.c:2406 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 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:268 tty_insert_flip_string_fixed_flag+0x8b/0x210 drivers/tty/tty_buffer.c:313 tty_insert_flip_string include/linux/tty_flip.h:36 [inline] tty_insert_flip_string_and_push_buffer+0x3e/0x160 drivers/tty/tty_buffer.c:570 pty_write+0xc3/0xf0 drivers/tty/pty.c:118 tty_send_xchar+0x245/0x360 drivers/tty/tty_io.c:1092 n_tty_ioctl_helper+0x145/0x350 drivers/tty/tty_ioctl.c:926 n_tty_ioctl+0x47/0x2e0 drivers/tty/n_tty.c:2466 tty_ioctl+0x5af/0x1430 drivers/tty/tty_io.c:2670 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 *** 5 locks held by syz-executor.1/30654: #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: [] tty_send_xchar+0x1b5/0x360 drivers/tty/tty_io.c:1086 #2: (&tty->termios_rwsem){++++}, at: [] tty_send_xchar+0x1e8/0x360 drivers/tty/tty_io.c:1089 #3: (&(&port->lock)->rlock){-.-.}, at: [] tty_insert_flip_string_and_push_buffer+0x2b/0x160 drivers/tty/tty_buffer.c:569 #4: (console_lock){+.+.}, at: [] vprintk_func+0x58/0x160 kernel/printk/printk_safe.c:409 stack backtrace: CPU: 1 PID: 30654 Comm: syz-executor.1 Not tainted 4.14.293-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 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_lock_spinning_enable kernel/printk/printk.c:1590 [inline] console_unlock+0x36f/0xf20 kernel/printk/printk.c:2406 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 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:268 tty_insert_flip_string_fixed_flag+0x8b/0x210 drivers/tty/tty_buffer.c:313 tty_insert_flip_string include/linux/tty_flip.h:36 [inline] tty_insert_flip_string_and_push_buffer+0x3e/0x160 drivers/tty/tty_buffer.c:570 pty_write+0xc3/0xf0 drivers/tty/pty.c:118 tty_send_xchar+0x245/0x360 drivers/tty/tty_io.c:1092 n_tty_ioctl_helper+0x145/0x350 drivers/tty/tty_ioctl.c:926 n_tty_ioctl+0x47/0x2e0 drivers/tty/n_tty.c:2466 tty_ioctl+0x5af/0x1430 drivers/tty/tty_io.c:2670 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:0x7f95a2a15409 RSP: 002b:00007f95a138a168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f95a2b27f80 RCX: 00007f95a2a15409 RDX: 0000000000000003 RSI: 000000000000540a RDI: 0000000000000003 RBP: 00007f95a138a1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffcc0627fbf R14: 00007f95a138a300 R15: 0000000000022000 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 08/26/2022 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_trace+0x25a/0x400 mm/slab.c:3659 kmalloc_node include/linux/slab.h:526 [inline] kzalloc_node include/linux/slab.h:672 [inline] __get_vm_area_node+0xed/0x340 mm/vmalloc.c:1407 __vmalloc_node_range mm/vmalloc.c:1762 [inline] __vmalloc_node mm/vmalloc.c:1818 [inline] __vmalloc_node_flags mm/vmalloc.c:1832 [inline] vmalloc+0x98/0x150 mm/vmalloc.c:1854 netlink_alloc_large_skb net/netlink/af_netlink.c:1173 [inline] netlink_sendmsg+0x434/0xbc0 net/netlink/af_netlink.c:1868 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062 __sys_sendmsg+0xa3/0x120 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x27/0x40 net/socket.c:2103 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7faa218fe409 RSP: 002b:00007faa20273168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007faa21a10f80 RCX: 00007faa218fe409 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00007faa202731d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffee187159f R14: 00007faa20273300 R15: 0000000000022000 CPU: 1 PID: 30676 Comm: syz-executor.4 Not tainted 4.14.293-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 syz-executor.2: 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 vmalloc: allocation failure: 4160 bytes 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 , mode:0x14000c0(GFP_KERNEL), nodemask= kmalloc include/linux/slab.h:493 [inline] tty_buffer_alloc+0xc0/0x270 drivers/tty/tty_buffer.c:169 (null) __tty_buffer_request_room+0x12c/0x290 drivers/tty/tty_buffer.c:268 tty_insert_flip_string_fixed_flag+0x8b/0x210 drivers/tty/tty_buffer.c:313 syz-executor.2 cpuset= tty_insert_flip_string include/linux/tty_flip.h:36 [inline] tty_insert_flip_string_and_push_buffer+0x3e/0x160 drivers/tty/tty_buffer.c:570 pty_write+0xc3/0xf0 drivers/tty/pty.c:118 tty_send_xchar+0x245/0x360 drivers/tty/tty_io.c:1092 / mems_allowed=0-1 n_tty_ioctl_helper+0x145/0x350 drivers/tty/tty_ioctl.c:926 n_tty_ioctl+0x47/0x2e0 drivers/tty/n_tty.c:2466 tty_ioctl+0x5af/0x1430 drivers/tty/tty_io.c:2670 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:0x7f4de5bf7409 RSP: 002b:00007f4de456c168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f4de5d09f80 RCX: 00007f4de5bf7409 RDX: 0000000000000003 RSI: 000000000000540a RDI: 0000000000000003 RBP: 00007f4de456c1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007fffff49c4cf R14: 00007f4de456c300 R15: 0000000000022000 CPU: 0 PID: 30658 Comm: syz-executor.2 Not tainted 4.14.293-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 warn_alloc.cold+0x96/0x1cc mm/page_alloc.c:3255 __vmalloc_node_range mm/vmalloc.c:1789 [inline] __vmalloc_node mm/vmalloc.c:1818 [inline] __vmalloc_node_flags mm/vmalloc.c:1832 [inline] vmalloc+0x122/0x150 mm/vmalloc.c:1854 netlink_alloc_large_skb net/netlink/af_netlink.c:1173 [inline] netlink_sendmsg+0x434/0xbc0 net/netlink/af_netlink.c:1868 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:656 ___sys_sendmsg+0x6c8/0x800 net/socket.c:2062 __sys_sendmsg+0xa3/0x120 net/socket.c:2096 SYSC_sendmsg net/socket.c:2107 [inline] SyS_sendmsg+0x27/0x40 net/socket.c:2103 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7faa218fe409 RSP: 002b:00007faa20273168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007faa21a10f80 RCX: 00007faa218fe409 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00007faa202731d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffee187159f R14: 00007faa20273300 R15: 0000000000022000 Mem-Info: active_anon:27216 inactive_anon:6800 isolated_anon:0 active_file:5806 inactive_file:10927 isolated_file:0 unevictable:0 dirty:142 writeback:0 unstable:0 slab_reclaimable:23166 slab_unreclaimable:115946 mapped:31643 shmem:7698 pagetables:685 bounce:0 free:1477941 free_pcp:274 free_cma:0 Node 0 active_anon:106680kB inactive_anon:27200kB active_file:23100kB inactive_file:43708kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:126572kB dirty:564kB writeback:0kB shmem:30792kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 24576kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no Node 1 active_anon:0kB inactive_anon:0kB active_file:124kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:0kB dirty:4kB writeback:0kB shmem:0kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no Node 0 DMA free:15908kB min:204kB low:252kB high:300kB 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 lowmem_reserve[]: 0 2717 2718 2718 2718 Node 0 DMA32 free:1858088kB min:36196kB low:45244kB high:54292kB active_anon:106180kB inactive_anon:27200kB active_file:23100kB inactive_file:43708kB unevictable:0kB writepending:564kB present:3129332kB managed:2788004kB mlocked:0kB kernel_stack:7808kB pagetables:2740kB bounce:0kB free_pcp:1268kB local_pcp:672kB free_cma:0kB lowmem_reserve[]: 0 0 0 0 0 Node 0 Normal free:0kB min:4kB low:4kB high:4kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:1048576kB managed:468kB 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:4039824kB min:53696kB low:67120kB high:80544kB active_anon:0kB inactive_anon:0kB active_file:124kB inactive_file:0kB unevictable:0kB writepending:4kB present:4194304kB managed:4128256kB 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: 2840*4kB (UME) 890*8kB (UME) 129*16kB (UME) 96*32kB (UME) 520*64kB (UME) 85*128kB (UME) 11*256kB (UM) 5*512kB (UME) 1*1024kB (U) 3*2048kB (UME) 434*4096kB (UM) = 1857984kB 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: 68*4kB (U) 388*8kB (UME) 318*16kB (UME) 78*32kB (UME) 33*64kB (UM) 15*128kB (UME) 6*256kB (UME) 8*512kB (UE) 3*1024kB (UME) 3*2048kB (M) 979*4096kB (M) = 4039824kB 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 24438 total pagecache pages 0 pages in swap cache Swap cache stats: add 0, delete 0, find 0/0 Free swap = 0kB Total swap = 0kB 2097051 pages RAM 0 pages HighMem/MovableOnly 363892 pages reserved 0 pages cma reserved netlink: 48 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.2'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.1'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.4'. netlink: 48 bytes leftover after parsing attributes in process `syz-executor.4'.