All of lore.kernel.org
 help / color / mirror / Atom feed
* possible deadlock in console_trylock_spinning
@ 2019-06-20 13:17 syzbot
  2019-06-22 13:55 ` syzbot
  2019-06-25  8:55 ` syzbot
  0 siblings, 2 replies; 4+ messages in thread
From: syzbot @ 2019-06-20 13:17 UTC (permalink / raw)
  To: gregkh, jslaby, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following crash on:

HEAD commit:    bed3c0d8 Merge tag 'for-5.2-rc5-tag' of git://git.kernel.o..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14a165c9a00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=28ec3437a5394ee0
dashboard link: https://syzkaller.appspot.com/bug?extid=fc1da0f1a577d15b64fc
compiler:       clang version 9.0.0 (/home/glider/llvm/clang  
80fee25776c2fb61e74c1ecb1a523375c2500b69)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+fc1da0f1a577d15b64fc@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
5.2.0-rc5+ #3 Not tainted
------------------------------------------------------
syz-executor.1/11011 is trying to acquire lock:
0000000046a921a5 (console_owner){-.-.}, at:  
console_trylock_spinning+0x12f/0x390 kernel/printk/printk.c:1718

but task is already holding lock:
00000000b4370e8d (&(&port->lock)->rlock){-.-.}, at: pty_write+0xbd/0x190  
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+0xa1/0xc0 kernel/locking/spinlock.c:159
        tty_port_tty_get drivers/tty/tty_port.c:287 [inline]
        tty_port_default_wakeup+0x20/0xa0 drivers/tty/tty_port.c:47
        tty_port_tty_wakeup+0x5a/0x70 drivers/tty/tty_port.c:387
        uart_write_wakeup+0x48/0x60 drivers/tty/serial/serial_core.c:103
        serial8250_tx_chars+0x623/0x830  
drivers/tty/serial/8250/8250_port.c:1806
        serial8250_handle_irq+0x255/0x390  
drivers/tty/serial/8250/8250_port.c:1879
        serial8250_default_handle_irq+0xc5/0x1d0  
drivers/tty/serial/8250/8250_port.c:1895
        serial8250_interrupt+0xad/0x190  
drivers/tty/serial/8250/8250_core.c:125
        __handle_irq_event_percpu+0x113/0x560 kernel/irq/handle.c:149
        handle_irq_event_percpu kernel/irq/handle.c:189 [inline]
        handle_irq_event+0x10a/0x2f0 kernel/irq/handle.c:206
        handle_edge_irq+0x29f/0xca0 kernel/irq/chip.c:822
        generic_handle_irq_desc include/linux/irqdesc.h:156 [inline]
        handle_irq+0x3e/0x50 arch/x86/kernel/irq_64.c:34
        do_IRQ+0xc4/0x1a0 arch/x86/kernel/irq.c:247
        ret_from_intr+0x0/0x1e
        arch_local_irq_restore arch/x86/include/asm/paravirt.h:767 [inline]
        __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160  
[inline]
        _raw_spin_unlock_irqrestore+0xad/0xe0 kernel/locking/spinlock.c:191
        spin_unlock_irqrestore include/linux/spinlock.h:393 [inline]
        uart_write+0x841/0xa50 drivers/tty/serial/serial_core.c:612
        process_output_block drivers/tty/n_tty.c:595 [inline]
        n_tty_write+0xd6c/0x12d0 drivers/tty/n_tty.c:2333
        do_tty_write drivers/tty/tty_io.c:961 [inline]
        tty_write+0x581/0x860 drivers/tty/tty_io.c:1045
        redirected_tty_write+0x9e/0xb0 drivers/tty/tty_io.c:1066
        __vfs_write+0xf9/0x7d0 fs/read_write.c:494
        vfs_write+0x227/0x510 fs/read_write.c:558
        ksys_write+0x16b/0x2a0 fs/read_write.c:611
        __do_sys_write fs/read_write.c:623 [inline]
        __se_sys_write fs/read_write.c:620 [inline]
        __x64_sys_write+0x7b/0x90 fs/read_write.c:620
        do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:301
        entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #1 (&port_lock_key){-.-.}:
        __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
        _raw_spin_lock_irqsave+0xa1/0xc0 kernel/locking/spinlock.c:159
        serial8250_console_write+0x1d1/0xba0  
drivers/tty/serial/8250/8250_port.c:3245
        univ8250_console_write+0x50/0x70  
drivers/tty/serial/8250/8250_core.c:586
        call_console_drivers kernel/printk/printk.c:1779 [inline]
        console_unlock+0x95f/0xf20 kernel/printk/printk.c:2463
        vprintk_emit+0x239/0x3a0 kernel/printk/printk.c:1986
        vprintk_default+0x28/0x30 kernel/printk/printk.c:2013
        vprintk_func+0x158/0x170 kernel/printk/printk_safe.c:386
        printk+0xc4/0x11d kernel/printk/printk.c:2046
        register_console+0xa81/0xe30 kernel/printk/printk.c:2788
        univ8250_console_init+0x4b/0x4d  
drivers/tty/serial/8250/8250_core.c:681
        console_init+0x56/0x9c kernel/printk/printk.c:2874
        start_kernel+0x49e/0x860 init/main.c:688
        x86_64_start_reservations+0x18/0x2e arch/x86/kernel/head64.c:470
        x86_64_start_kernel+0x7a/0x7d arch/x86/kernel/head64.c:451
        secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243

-> #0 (console_owner){-.-.}:
        lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4303
        console_trylock_spinning+0x14f/0x390 kernel/printk/printk.c:1735
        vprintk_emit+0x21c/0x3a0 kernel/printk/printk.c:1985
        vprintk_default+0x28/0x30 kernel/printk/printk.c:2013
        vprintk_func+0x158/0x170 kernel/printk/printk_safe.c:386
        printk+0xc4/0x11d kernel/printk/printk.c:2046
        fail_dump lib/fault-inject.c:45 [inline]
        should_fail+0x5c5/0x860 lib/fault-inject.c:144
        __should_failslab+0x11a/0x160 mm/failslab.c:32
        should_failslab+0x9/0x20 mm/slab_common.c:1610
        slab_pre_alloc_hook mm/slab.h:420 [inline]
        slab_alloc mm/slab.c:3312 [inline]
        __do_kmalloc mm/slab.c:3658 [inline]
        __kmalloc+0x7a/0x310 mm/slab.c:3669
        kmalloc include/linux/slab.h:552 [inline]
        tty_buffer_alloc drivers/tty/tty_buffer.c:175 [inline]
        __tty_buffer_request_room+0x1ef/0x560 drivers/tty/tty_buffer.c:273
        tty_insert_flip_string_fixed_flag+0xa4/0x2b0  
drivers/tty/tty_buffer.c:318
        tty_insert_flip_string include/linux/tty_flip.h:37 [inline]
        pty_write+0xe2/0x190 drivers/tty/pty.c:122
        tty_put_char+0x115/0x180 drivers/tty/tty_io.c:3031
        __process_echoes+0x47f/0x920 drivers/tty/n_tty.c:728
        flush_echoes drivers/tty/n_tty.c:829 [inline]
        __receive_buf drivers/tty/n_tty.c:1648 [inline]
        n_tty_receive_buf_common+0x297f/0x3080 drivers/tty/n_tty.c:1742
        n_tty_receive_buf+0x30/0x40 drivers/tty/n_tty.c:1771
        tiocsti drivers/tty/tty_io.c:2195 [inline]
        tty_ioctl+0xd63/0x15d0 drivers/tty/tty_io.c:2571
        do_vfs_ioctl+0x7d4/0x1890 fs/ioctl.c:46
        ksys_ioctl fs/ioctl.c:713 [inline]
        __do_sys_ioctl fs/ioctl.c:720 [inline]
        __se_sys_ioctl fs/ioctl.c:718 [inline]
        __x64_sys_ioctl+0xe3/0x120 fs/ioctl.c:718
        do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:301
        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 ***

4 locks held by syz-executor.1/11011:
  #0: 000000001e367af1 (&tty->ldisc_sem){++++}, at:  
tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:272
  #1: 00000000a83060be (&o_tty->termios_rwsem/1){++++}, at:  
n_tty_receive_buf_common+0x8b/0x3080 drivers/tty/n_tty.c:1705
  #2: 0000000055e44ce8 (&ldata->output_lock){+.+.}, at: flush_echoes  
drivers/tty/n_tty.c:827 [inline]
  #2: 0000000055e44ce8 (&ldata->output_lock){+.+.}, at: __receive_buf  
drivers/tty/n_tty.c:1648 [inline]
  #2: 0000000055e44ce8 (&ldata->output_lock){+.+.}, at:  
n_tty_receive_buf_common+0x2940/0x3080 drivers/tty/n_tty.c:1742
  #3: 00000000b4370e8d (&(&port->lock)->rlock){-.-.}, at:  
pty_write+0xbd/0x190 drivers/tty/pty.c:120

stack backtrace:
CPU: 1 PID: 11011 Comm: syz-executor.1 Not tainted 5.2.0-rc5+ #3
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+0x1d8/0x2f8 lib/dump_stack.c:113
  print_circular_bug+0xd34/0xf20 kernel/locking/lockdep.c:1564
  check_prev_add kernel/locking/lockdep.c:2310 [inline]
  check_prevs_add kernel/locking/lockdep.c:2418 [inline]
  validate_chain+0x59d0/0x84f0 kernel/locking/lockdep.c:2800
  __lock_acquire+0xcf7/0x1a40 kernel/locking/lockdep.c:3793
  lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4303
  console_trylock_spinning+0x14f/0x390 kernel/printk/printk.c:1735
  vprintk_emit+0x21c/0x3a0 kernel/printk/printk.c:1985
  vprintk_default+0x28/0x30 kernel/printk/printk.c:2013
  vprintk_func+0x158/0x170 kernel/printk/printk_safe.c:386
  printk+0xc4/0x11d kernel/printk/printk.c:2046
  fail_dump lib/fault-inject.c:45 [inline]
  should_fail+0x5c5/0x860 lib/fault-inject.c:144
  __should_failslab+0x11a/0x160 mm/failslab.c:32
  should_failslab+0x9/0x20 mm/slab_common.c:1610
  slab_pre_alloc_hook mm/slab.h:420 [inline]
  slab_alloc mm/slab.c:3312 [inline]
  __do_kmalloc mm/slab.c:3658 [inline]
  __kmalloc+0x7a/0x310 mm/slab.c:3669
  kmalloc include/linux/slab.h:552 [inline]
  tty_buffer_alloc drivers/tty/tty_buffer.c:175 [inline]
  __tty_buffer_request_room+0x1ef/0x560 drivers/tty/tty_buffer.c:273
  tty_insert_flip_string_fixed_flag+0xa4/0x2b0 drivers/tty/tty_buffer.c:318
  tty_insert_flip_string include/linux/tty_flip.h:37 [inline]
  pty_write+0xe2/0x190 drivers/tty/pty.c:122
  tty_put_char+0x115/0x180 drivers/tty/tty_io.c:3031
  __process_echoes+0x47f/0x920 drivers/tty/n_tty.c:728
  flush_echoes drivers/tty/n_tty.c:829 [inline]
  __receive_buf drivers/tty/n_tty.c:1648 [inline]
  n_tty_receive_buf_common+0x297f/0x3080 drivers/tty/n_tty.c:1742
  n_tty_receive_buf+0x30/0x40 drivers/tty/n_tty.c:1771
  tiocsti drivers/tty/tty_io.c:2195 [inline]
  tty_ioctl+0xd63/0x15d0 drivers/tty/tty_io.c:2571
  do_vfs_ioctl+0x7d4/0x1890 fs/ioctl.c:46
  ksys_ioctl fs/ioctl.c:713 [inline]
  __do_sys_ioctl fs/ioctl.c:720 [inline]
  __se_sys_ioctl fs/ioctl.c:718 [inline]
  __x64_sys_ioctl+0xe3/0x120 fs/ioctl.c:718
  do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:301
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4592c9
Code: fd b7 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f1a2359dc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f1a2359dc90 RCX: 00000000004592c9
RDX: 0000000020000000 RSI: 0000000000005412 RDI: 0000000000000004
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1a2359e6d4
R13: 00000000004c3827 R14: 00000000004d71d8 R15: 0000000000000005


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: possible deadlock in console_trylock_spinning
  2019-06-20 13:17 possible deadlock in console_trylock_spinning syzbot
@ 2019-06-22 13:55 ` syzbot
  2019-06-25  8:55 ` syzbot
  1 sibling, 0 replies; 4+ messages in thread
From: syzbot @ 2019-06-22 13:55 UTC (permalink / raw)
  To: gregkh, jslaby, linux-kernel, syzkaller-bugs

syzbot has found a reproducer for the following crash on:

HEAD commit:    abf02e29 Merge tag 'pm-5.2-rc6' of git://git.kernel.org/pu..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11834c41a00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=28ec3437a5394ee0
dashboard link: https://syzkaller.appspot.com/bug?extid=fc1da0f1a577d15b64fc
compiler:       clang version 9.0.0 (/home/glider/llvm/clang  
80fee25776c2fb61e74c1ecb1a523375c2500b69)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1357add6a00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1611ac89a00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+fc1da0f1a577d15b64fc@syzkaller.appspotmail.com

======================================================
WARNING: possible circular locking dependency detected
5.2.0-rc5+ #4 Not tainted
------------------------------------------------------
syz-executor155/8057 is trying to acquire lock:
000000009bd46550 (console_owner){-.-.}, at:  
console_trylock_spinning+0x12f/0x390 kernel/printk/printk.c:1718

but task is already holding lock:
0000000056678186 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xbd/0x190  
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+0xa1/0xc0 kernel/locking/spinlock.c:159
        tty_port_tty_get drivers/tty/tty_port.c:287 [inline]
        tty_port_default_wakeup+0x20/0xa0 drivers/tty/tty_port.c:47
        tty_port_tty_wakeup+0x5a/0x70 drivers/tty/tty_port.c:387
        uart_write_wakeup+0x48/0x60 drivers/tty/serial/serial_core.c:103
        serial8250_tx_chars+0x623/0x830  
drivers/tty/serial/8250/8250_port.c:1806
        serial8250_handle_irq+0x255/0x390  
drivers/tty/serial/8250/8250_port.c:1879
        serial8250_default_handle_irq+0xc5/0x1d0  
drivers/tty/serial/8250/8250_port.c:1895
        serial8250_interrupt+0xad/0x190  
drivers/tty/serial/8250/8250_core.c:125
        __handle_irq_event_percpu+0x113/0x560 kernel/irq/handle.c:149
        handle_irq_event_percpu kernel/irq/handle.c:189 [inline]
        handle_irq_event+0x10a/0x2f0 kernel/irq/handle.c:206
        handle_edge_irq+0x29f/0xca0 kernel/irq/chip.c:822
        generic_handle_irq_desc include/linux/irqdesc.h:156 [inline]
        handle_irq+0x3e/0x50 arch/x86/kernel/irq_64.c:34
        do_IRQ+0xc4/0x1a0 arch/x86/kernel/irq.c:247
        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:571
        default_idle_call kernel/sched/idle.c:94 [inline]
        cpuidle_idle_call kernel/sched/idle.c:154 [inline]
        do_idle+0x18a/0x760 kernel/sched/idle.c:263
        cpu_startup_entry+0x25/0x30 kernel/sched/idle.c:354
        start_secondary+0x425/0x4c0 arch/x86/kernel/smpboot.c:265
        secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243

-> #1 (&port_lock_key){-.-.}:
        __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
        _raw_spin_lock_irqsave+0xa1/0xc0 kernel/locking/spinlock.c:159
        serial8250_console_write+0x1d1/0xba0  
drivers/tty/serial/8250/8250_port.c:3245
        univ8250_console_write+0x50/0x70  
drivers/tty/serial/8250/8250_core.c:586
        call_console_drivers kernel/printk/printk.c:1779 [inline]
        console_unlock+0x95f/0xf20 kernel/printk/printk.c:2463
        vprintk_emit+0x239/0x3a0 kernel/printk/printk.c:1986
        vprintk_default+0x28/0x30 kernel/printk/printk.c:2013
        vprintk_func+0x158/0x170 kernel/printk/printk_safe.c:386
        printk+0xc4/0x11d kernel/printk/printk.c:2046
        register_console+0xa81/0xe30 kernel/printk/printk.c:2788
        univ8250_console_init+0x4b/0x4d  
drivers/tty/serial/8250/8250_core.c:681
        console_init+0x56/0x9c kernel/printk/printk.c:2874
        start_kernel+0x49e/0x860 init/main.c:688
        x86_64_start_reservations+0x18/0x2e arch/x86/kernel/head64.c:470
        x86_64_start_kernel+0x7a/0x7d arch/x86/kernel/head64.c:451
        secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243

-> #0 (console_owner){-.-.}:
        lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4303
        console_trylock_spinning+0x14f/0x390 kernel/printk/printk.c:1735
        vprintk_emit+0x21c/0x3a0 kernel/printk/printk.c:1985
        vprintk_default+0x28/0x30 kernel/printk/printk.c:2013
        vprintk_func+0x158/0x170 kernel/printk/printk_safe.c:386
        printk+0xc4/0x11d kernel/printk/printk.c:2046
        fail_dump lib/fault-inject.c:45 [inline]
        should_fail+0x5c5/0x860 lib/fault-inject.c:144
        __should_fail_alloc_page mm/page_alloc.c:3278 [inline]
        should_fail_alloc_page+0x55/0x60 mm/page_alloc.c:3315
        prepare_alloc_pages+0x283/0x460 mm/page_alloc.c:4598
        __alloc_pages_nodemask+0x11c/0x790 mm/page_alloc.c:4645
        __alloc_pages include/linux/gfp.h:473 [inline]
        __alloc_pages_node include/linux/gfp.h:486 [inline]
        kmem_getpages+0x46/0x480 mm/slab.c:1373
        cache_grow_begin+0x7e/0x2c0 mm/slab.c:2606
        cache_alloc_refill+0x311/0x3f0 mm/slab.c:2978
        ____cache_alloc mm/slab.c:3061 [inline]
        __do_cache_alloc mm/slab.c:3283 [inline]
        slab_alloc mm/slab.c:3318 [inline]
        __do_kmalloc mm/slab.c:3658 [inline]
        __kmalloc+0x2e5/0x310 mm/slab.c:3669
        kmalloc include/linux/slab.h:552 [inline]
        tty_buffer_alloc drivers/tty/tty_buffer.c:175 [inline]
        __tty_buffer_request_room+0x1ef/0x560 drivers/tty/tty_buffer.c:273
        tty_insert_flip_string_fixed_flag+0xa4/0x2b0  
drivers/tty/tty_buffer.c:318
        tty_insert_flip_string include/linux/tty_flip.h:37 [inline]
        pty_write+0xe2/0x190 drivers/tty/pty.c:122
        tty_put_char+0x115/0x180 drivers/tty/tty_io.c:3031
        __process_echoes+0x19d/0x920 drivers/tty/n_tty.c:746
        flush_echoes drivers/tty/n_tty.c:829 [inline]
        __receive_buf drivers/tty/n_tty.c:1648 [inline]
        n_tty_receive_buf_common+0x297f/0x3080 drivers/tty/n_tty.c:1742
        n_tty_receive_buf+0x30/0x40 drivers/tty/n_tty.c:1771
        tiocsti drivers/tty/tty_io.c:2195 [inline]
        tty_ioctl+0xd63/0x15d0 drivers/tty/tty_io.c:2571
        do_vfs_ioctl+0x7d4/0x1890 fs/ioctl.c:46
        ksys_ioctl fs/ioctl.c:713 [inline]
        __do_sys_ioctl fs/ioctl.c:720 [inline]
        __se_sys_ioctl fs/ioctl.c:718 [inline]
        __x64_sys_ioctl+0xe3/0x120 fs/ioctl.c:718
        do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:301
        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 ***

4 locks held by syz-executor155/8057:
  #0: 00000000537d947b (&tty->ldisc_sem){++++}, at:  
tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:272
  #1: 00000000edca1b1e (&o_tty->termios_rwsem/1){++++}, at:  
n_tty_receive_buf_common+0x8b/0x3080 drivers/tty/n_tty.c:1705
  #2: 00000000e4a6cb09 (&ldata->output_lock){+.+.}, at: flush_echoes  
drivers/tty/n_tty.c:827 [inline]
  #2: 00000000e4a6cb09 (&ldata->output_lock){+.+.}, at: __receive_buf  
drivers/tty/n_tty.c:1648 [inline]
  #2: 00000000e4a6cb09 (&ldata->output_lock){+.+.}, at:  
n_tty_receive_buf_common+0x2940/0x3080 drivers/tty/n_tty.c:1742
  #3: 0000000056678186 (&(&port->lock)->rlock){-.-.}, at:  
pty_write+0xbd/0x190 drivers/tty/pty.c:120

stack backtrace:
CPU: 1 PID: 8057 Comm: syz-executor155 Not tainted 5.2.0-rc5+ #4
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+0x1d8/0x2f8 lib/dump_stack.c:113
  print_circular_bug+0xd34/0xf20 kernel/locking/lockdep.c:1564
  check_prev_add kernel/locking/lockdep.c:2310 [inline]
  check_prevs_add kernel/locking/lockdep.c:2418 [inline]
  validate_chain+0x59d0/0x84f0 kernel/locking/lockdep.c:2800
  __lock_acquire+0xcf7/0x1a40 kernel/locking/lockdep.c:3793
  lock_acquire+0x158/0x250 kernel/locking/lockdep.c:4303
  console_trylock_spinning+0x14f/0x390 kernel/printk/printk.c:1735
  vprintk_emit+0x21c/0x3a0 kernel/printk/printk.c:1985
  vprintk_default+0x28/0x30 kernel/printk/printk.c:2013
  vprintk_func+0x158/0x170 kernel/printk/printk_safe.c:386
  printk+0xc4/0x11d kernel/printk/printk.c:2046
  fail_dump lib/fault-inject.c:45 [inline]
  should_fail+0x5c5/0x860 lib/fault-inject.c:144
  __should_fail_alloc_page mm/page_alloc.c:3278 [inline]
  should_fail_alloc_page+0x55/0x60 mm/page_alloc.c:3315
  prepare_alloc_pages+0x283/0x460 mm/page_alloc.c:4598
  __alloc_pages_nodemask+0x11c/0x790 mm/page_alloc.c:4645
  __alloc_pages include/linux/gfp.h:473 [inline]
  __alloc_pages_node include/linux/gfp.h:486 [inline]
  kmem_getpages+0x46/0x480 mm/slab.c:1373
  cache_grow_begin+0x7e/0x2c0 mm/slab.c:2606
  cache_alloc_refill+0x311/0x3f0 mm/slab.c:2978
  ____cache_alloc mm/slab.c:3061 [inline]
  __do_cache_alloc mm/slab.c:3283 [inline]
  slab_alloc mm/slab.c:3318 [inline]
  __do_kmalloc mm/slab.c:3658 [inline]
  __kmalloc+0x2e5/0x310 mm/slab.c:3669
  kmalloc include/linux/slab.h:552 [inline]
  tty_buffer_alloc drivers/tty/tty_buffer.c:175 [inline]
  __tty_buffer_request_room+0x1ef/0x560 drivers/tty/tty_buffer.c:273
  tty_insert_flip_string_fixed_flag+0xa4/0x2b0 drivers/tty/tty_buffer.c:318
  tty_insert_flip_string include/linux/tty_flip.h:37 [inline]
  pty_write+0xe2/0x190 drivers/tty/pty.c:122
  tty_put_char+0x115/0x180 drivers/tty/tty_io.c:3031
  __process_echoes+0x19d/0x920 drivers/tty/n_tty.c:746
  flush_echoes drivers/tty/n_tty.c:829 [inline]
  __receive_buf drivers/tty/n_tty.c:1648 [inline]
  n_tty_receive_buf_common+0x297f/0x3080 drivers/tty/n_tty.c:1742
  n_tty_receive_buf+0x30/0x40 drivers/tty/n_tty.c:1771
  tiocsti drivers/tty/tty_io.c:2195 [inline]
  tty_ioctl+0xd63/0x15d0 drivers/tty/tty_io.c:2571
  do_vfs_ioctl+0x7d4/0x1890 fs/ioctl.c:46
  ksys_ioctl fs/ioctl.c:713 [inline]
  __do_sys_ioctl fs/ioctl.c:720 [inline]
  __se_sys_ioctl fs/ioctl.c:718 [inline]
  __x64_sys_ioctl+0xe3/0x120 fs/ioctl.c:718
  do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:301
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x441439
Code: e8 8c e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 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 eb 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffeff301068 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441439
RDX: 0000000020000040 RSI: 0000000000005412 RDI: 0000000000000004
RBP: 00007ffeff301080 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000005 R14: 0000000000000000 R15: 0000000000000000


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: possible deadlock in console_trylock_spinning
  2019-06-20 13:17 possible deadlock in console_trylock_spinning syzbot
  2019-06-22 13:55 ` syzbot
@ 2019-06-25  8:55 ` syzbot
  2019-06-25  9:52   ` Tetsuo Handa
  1 sibling, 1 reply; 4+ messages in thread
From: syzbot @ 2019-06-25  8:55 UTC (permalink / raw)
  To: gregkh, jamorris, jmorris, jslaby, linux-kernel,
	linux-security-module, penguin-kernel, penguin-kernel, serge,
	syzkaller-bugs, takedakn

syzbot has bisected this bug to:

commit e80b18599a39a625bc8b2e39ba3004a62f78805a
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Fri Apr 12 11:04:54 2019 +0000

     tomoyo: Add a kernel config option for fuzzing testing.

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=156e43cea00000
start commit:   abf02e29 Merge tag 'pm-5.2-rc6' of git://git.kernel.org/pu..
git tree:       upstream
final crash:    https://syzkaller.appspot.com/x/report.txt?x=176e43cea00000
console output: https://syzkaller.appspot.com/x/log.txt?x=136e43cea00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=28ec3437a5394ee0
dashboard link: https://syzkaller.appspot.com/bug?extid=fc1da0f1a577d15b64fc
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1357add6a00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1611ac89a00000

Reported-by: syzbot+fc1da0f1a577d15b64fc@syzkaller.appspotmail.com
Fixes: e80b18599a39 ("tomoyo: Add a kernel config option for fuzzing  
testing.")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: possible deadlock in console_trylock_spinning
  2019-06-25  8:55 ` syzbot
@ 2019-06-25  9:52   ` Tetsuo Handa
  0 siblings, 0 replies; 4+ messages in thread
From: Tetsuo Handa @ 2019-06-25  9:52 UTC (permalink / raw)
  To: Sergey Senozhatsky, Steven Rostedt, Sergey Senozhatsky, Petr Mladek
  Cc: syzbot, linux-kernel, syzkaller-bugs

On 2019/06/25 17:55, syzbot wrote:
> syzbot has bisected this bug to:
> 
> commit e80b18599a39a625bc8b2e39ba3004a62f78805a
> Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> Date:   Fri Apr 12 11:04:54 2019 +0000
> 
>     tomoyo: Add a kernel config option for fuzzing testing.
> 
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=156e43cea00000
> start commit:   abf02e29 Merge tag 'pm-5.2-rc6' of git://git.kernel.org/pu..
> git tree:       upstream
> final crash:    https://syzkaller.appspot.com/x/report.txt?x=176e43cea00000
> console output: https://syzkaller.appspot.com/x/log.txt?x=136e43cea00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=28ec3437a5394ee0
> dashboard link: https://syzkaller.appspot.com/bug?extid=fc1da0f1a577d15b64fc
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1357add6a00000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1611ac89a00000
> 
> Reported-by: syzbot+fc1da0f1a577d15b64fc@syzkaller.appspotmail.com
> Fixes: e80b18599a39 ("tomoyo: Add a kernel config option for fuzzing testing.")
> 
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection
> 

This is not a TOMOYO's problem because that commit simply confused inject_fault(4)
by adding memory allocation from TOMOYO's hook. Anyway, this bug should be sent to
printk() people.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-25  9:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-20 13:17 possible deadlock in console_trylock_spinning syzbot
2019-06-22 13:55 ` syzbot
2019-06-25  8:55 ` syzbot
2019-06-25  9:52   ` Tetsuo Handa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.