WARNING in ep_scan_ready_list

4 views
Skip to first unread message

syzbot

unread,
Oct 30, 2018, 3:28:05 PM10/30/18
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 11743c56785c Merge tag 'rpmsg-v4.20' of git://github.com/a..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13844dbd400000
kernel config: https://syzkaller.appspot.com/x/.config?x=93932074d01b4a5
dashboard link: https://syzkaller.appspot.com/bug?extid=c038f60670798e034a8e
compiler: gcc (GCC) 8.0.1 20180413 (experimental)
CC: [linux-...@vger.kernel.org linux-...@vger.kernel.org
vi...@zeniv.linux.org.uk]

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+c038f6...@syzkaller.appspotmail.com

IRQs not enabled as expected
__should_failslab+0x124/0x180 mm/failslab.c:32
should_failslab+0x9/0x14 mm/slab_common.c:1578
slab_pre_alloc_hook mm/slab.h:423 [inline]
slab_alloc mm/slab.c:3378 [inline]
__do_kmalloc mm/slab.c:3720 [inline]
__kmalloc+0x70/0x760 mm/slab.c:3731
WARNING: CPU: 1 PID: 3499 at fs/eventpoll.c:682
ep_scan_ready_list+0xc78/0x1050 fs/eventpoll.c:682
Kernel panic - not syncing: panic_on_warn set ...

kmalloc include/linux/slab.h:551 [inline]
tty_buffer_alloc drivers/tty/tty_buffer.c:175 [inline]
__tty_buffer_request_room+0x2da/0x810 drivers/tty/tty_buffer.c:273
tty_insert_flip_string_fixed_flag+0x88/0x1f0 drivers/tty/tty_buffer.c:318
tty_insert_flip_string include/linux/tty_flip.h:37 [inline]
pty_write+0x12c/0x1f0 drivers/tty/pty.c:122
tty_put_char+0x137/0x160 drivers/tty/tty_io.c:3013
__process_echoes+0x456/0x9b0 drivers/tty/n_tty.c:726
flush_echoes drivers/tty/n_tty.c:827 [inline]
__receive_buf drivers/tty/n_tty.c:1646 [inline]
n_tty_receive_buf_common+0x11bf/0x2cb0 drivers/tty/n_tty.c:1740
n_tty_receive_buf+0x30/0x40 drivers/tty/n_tty.c:1769
tiocsti drivers/tty/tty_io.c:2177 [inline]
tty_ioctl+0x7cc/0x17d0 drivers/tty/tty_io.c:2553
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685
ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702
__do_sys_ioctl fs/ioctl.c:709 [inline]
__se_sys_ioctl fs/ioctl.c:707 [inline]
__x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707
do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457569
Code: fd b3 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 b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f03883a2c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f03883a2c90 RCX: 0000000000457569
RDX: 0000000020000040 RSI: 0000000000005412 RDI: 0000000000000006
RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f03883a36d4
R13: 00000000004c0ff1 R14: 00000000004d1c88 R15: 0000000000000007
CPU: 1 PID: 3499 Comm: udevd Not tainted 4.19.0+ #90

======================================================
WARNING: possible circular locking dependency detected
4.19.0+ #90 Not tainted
------------------------------------------------------
syz-executor0/8210 is trying to acquire lock:
00000000982af96e (console_owner){-.-.}, at: log_next
kernel/printk/printk.c:492 [inline]
00000000982af96e (console_owner){-.-.}, at: console_unlock+0x570/0x1190
kernel/printk/printk.c:2402

but task is already holding lock:
00000000b4f26c33 (&(&port->lock)->rlock){-.-.}, at: pty_write+0xf9/0x1f0
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+0x99/0xd0 kernel/locking/spinlock.c:152
tty_port_tty_get+0x20/0x80 drivers/tty/tty_port.c:287
tty_port_default_wakeup+0x15/0x40 drivers/tty/tty_port.c:47
tty_port_tty_wakeup+0x5d/0x70 drivers/tty/tty_port.c:387
uart_write_wakeup+0x44/0x60 drivers/tty/serial/serial_core.c:103
serial8250_tx_chars+0x4be/0xb60
drivers/tty/serial/8250/8250_port.c:1825
serial8250_handle_irq.part.23+0x1ee/0x280
drivers/tty/serial/8250/8250_port.c:1898
serial8250_handle_irq drivers/tty/serial/8250/8250_port.c:1884
[inline]
serial8250_default_handle_irq+0xc8/0x150
drivers/tty/serial/8250/8250_port.c:1914
serial8250_interrupt+0xef/0x190
drivers/tty/serial/8250/8250_core.c:125
__handle_irq_event_percpu+0x195/0xb30 kernel/irq/handle.c:149
handle_irq_event_percpu+0xa0/0x1d0 kernel/irq/handle.c:189
handle_irq_event+0xa7/0x135 kernel/irq/handle.c:206
handle_edge_irq+0x227/0x880 kernel/irq/chip.c:791
generic_handle_irq_desc include/linux/irqdesc.h:154 [inline]
handle_irq+0x252/0x3d8 arch/x86/kernel/irq_64.c:78
do_IRQ+0x98/0x1c0 arch/x86/kernel/irq.c:246
ret_from_intr+0x0/0x1e
native_safe_halt+0x6/0x10 arch/x86/include/asm/irqflags.h:57
arch_safe_halt arch/x86/include/asm/paravirt.h:151 [inline]
default_idle+0xbf/0x490 arch/x86/kernel/process.c:498
arch_cpu_idle+0x10/0x20 arch/x86/kernel/process.c:489
default_idle_call+0x6d/0x90 kernel/sched/idle.c:93
cpuidle_idle_call kernel/sched/idle.c:153 [inline]
do_idle+0x49b/0x5c0 kernel/sched/idle.c:262
cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:353
rest_init+0x243/0x372 init/main.c:442
arch_call_rest_init+0xe/0x1b
start_kernel+0xa1f/0xa5a init/main.c:744
x86_64_start_reservations+0x2e/0x30 arch/x86/kernel/head64.c:472
x86_64_start_kernel+0x76/0x79 arch/x86/kernel/head64.c:451
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+0x99/0xd0 kernel/locking/spinlock.c:152
serial8250_console_write+0x8e8/0xb10
drivers/tty/serial/8250/8250_port.c:3266
univ8250_console_write+0x5f/0x70
drivers/tty/serial/8250/8250_core.c:586
call_console_drivers kernel/printk/printk.c:1729 [inline]
console_unlock+0xb1f/0x1190 kernel/printk/printk.c:2415
vprintk_emit+0x391/0x990 kernel/printk/printk.c:1923
vprintk_default+0x28/0x30 kernel/printk/printk.c:1965
vprintk_func+0x7e/0x181 kernel/printk/printk_safe.c:398
printk+0xa7/0xcf kernel/printk/printk.c:1998
register_console+0x8df/0xcf0 kernel/printk/printk.c:2730
univ8250_console_init+0x3f/0x4b
drivers/tty/serial/8250/8250_core.c:681
console_init+0x6ac/0x9dc kernel/printk/printk.c:2816
start_kernel+0x73a/0xa5a init/main.c:666
x86_64_start_reservations+0x2e/0x30 arch/x86/kernel/head64.c:472
x86_64_start_kernel+0x76/0x79 arch/x86/kernel/head64.c:451
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243

-> #0 (console_owner){-.-.}:
lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3844
console_lock_spinning_enable kernel/printk/printk.c:1592 [inline]
console_unlock+0x5dd/0x1190 kernel/printk/printk.c:2412
vprintk_emit+0x391/0x990 kernel/printk/printk.c:1923
vprintk_default+0x28/0x30 kernel/printk/printk.c:1965
vprintk_func+0x7e/0x181 kernel/printk/printk_safe.c:398
printk+0xa7/0xcf kernel/printk/printk.c:1998
fail_dump lib/fault-inject.c:44 [inline]
should_fail+0xac1/0xd01 lib/fault-inject.c:149
__should_failslab+0x124/0x180 mm/failslab.c:32
should_failslab+0x9/0x14 mm/slab_common.c:1578
slab_pre_alloc_hook mm/slab.h:423 [inline]
slab_alloc mm/slab.c:3378 [inline]
__do_kmalloc mm/slab.c:3720 [inline]
__kmalloc+0x70/0x760 mm/slab.c:3731
kmalloc include/linux/slab.h:551 [inline]
tty_buffer_alloc drivers/tty/tty_buffer.c:175 [inline]
__tty_buffer_request_room+0x2da/0x810 drivers/tty/tty_buffer.c:273
tty_insert_flip_string_fixed_flag+0x88/0x1f0
drivers/tty/tty_buffer.c:318
tty_insert_flip_string include/linux/tty_flip.h:37 [inline]
pty_write+0x12c/0x1f0 drivers/tty/pty.c:122
tty_put_char+0x137/0x160 drivers/tty/tty_io.c:3013
__process_echoes+0x456/0x9b0 drivers/tty/n_tty.c:726
flush_echoes drivers/tty/n_tty.c:827 [inline]
__receive_buf drivers/tty/n_tty.c:1646 [inline]
n_tty_receive_buf_common+0x11bf/0x2cb0 drivers/tty/n_tty.c:1740
n_tty_receive_buf+0x30/0x40 drivers/tty/n_tty.c:1769
tiocsti drivers/tty/tty_io.c:2177 [inline]
tty_ioctl+0x7cc/0x17d0 drivers/tty/tty_io.c:2553
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685
ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702
__do_sys_ioctl fs/ioctl.c:709 [inline]
__se_sys_ioctl fs/ioctl.c:707 [inline]
__x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707
do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
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 ***

5 locks held by syz-executor0/8210:
#0: 000000002e55b9fd (&tty->ldisc_sem){++++}, at:
ldsem_down_read+0x32/0x40 drivers/tty/tty_ldsem.c:353
#1: 000000006c9db227 (&o_tty->termios_rwsem/1){++++}, at:
n_tty_receive_buf_common+0xeb/0x2cb0 drivers/tty/n_tty.c:1703
#2: 00000000cb9b1b5d (&ldata->output_lock){+.+.}, at: flush_echoes
drivers/tty/n_tty.c:825 [inline]
#2: 00000000cb9b1b5d (&ldata->output_lock){+.+.}, at: __receive_buf
drivers/tty/n_tty.c:1646 [inline]
#2: 00000000cb9b1b5d (&ldata->output_lock){+.+.}, at:
n_tty_receive_buf_common+0x1187/0x2cb0 drivers/tty/n_tty.c:1740
#3: 00000000b4f26c33 (&(&port->lock)->rlock){-.-.}, at:
pty_write+0xf9/0x1f0 drivers/tty/pty.c:120
#4: 00000000f2db8d86 (console_lock){+.+.}, at: console_trylock_spinning
kernel/printk/printk.c:1654 [inline]
#4: 00000000f2db8d86 (console_lock){+.+.}, at: vprintk_emit+0x372/0x990
kernel/printk/printk.c:1922

stack backtrace:
CPU: 0 PID: 8210 Comm: syz-executor0 Not tainted 4.19.0+ #90
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+0x244/0x39d lib/dump_stack.c:113
print_circular_bug.isra.35.cold.54+0x1bd/0x27d
kernel/locking/lockdep.c:1221
check_prev_add kernel/locking/lockdep.c:1863 [inline]
check_prevs_add kernel/locking/lockdep.c:1976 [inline]
validate_chain kernel/locking/lockdep.c:2347 [inline]
__lock_acquire+0x3399/0x4c20 kernel/locking/lockdep.c:3341
lock_acquire+0x1ed/0x520 kernel/locking/lockdep.c:3844
console_lock_spinning_enable kernel/printk/printk.c:1592 [inline]
console_unlock+0x5dd/0x1190 kernel/printk/printk.c:2412
vprintk_emit+0x391/0x990 kernel/printk/printk.c:1923
vprintk_default+0x28/0x30 kernel/printk/printk.c:1965
vprintk_func+0x7e/0x181 kernel/printk/printk_safe.c:398
printk+0xa7/0xcf kernel/printk/printk.c:1998
fail_dump lib/fault-inject.c:44 [inline]
should_fail+0xac1/0xd01 lib/fault-inject.c:149
__should_failslab+0x124/0x180 mm/failslab.c:32
should_failslab+0x9/0x14 mm/slab_common.c:1578
slab_pre_alloc_hook mm/slab.h:423 [inline]
slab_alloc mm/slab.c:3378 [inline]
__do_kmalloc mm/slab.c:3720 [inline]
__kmalloc+0x70/0x760 mm/slab.c:3731
kmalloc include/linux/slab.h:551 [inline]
tty_buffer_alloc drivers/tty/tty_buffer.c:175 [inline]
__tty_buffer_request_room+0x2da/0x810 drivers/tty/tty_buffer.c:273
tty_insert_flip_string_fixed_flag+0x88/0x1f0 drivers/tty/tty_buffer.c:318
tty_insert_flip_string include/linux/tty_flip.h:37 [inline]
pty_write+0x12c/0x1f0 drivers/tty/pty.c:122
tty_put_char+0x137/0x160 drivers/tty/tty_io.c:3013
__process_echoes+0x456/0x9b0 drivers/tty/n_tty.c:726
flush_echoes drivers/tty/n_tty.c:827 [inline]
__receive_buf drivers/tty/n_tty.c:1646 [inline]
n_tty_receive_buf_common+0x11bf/0x2cb0 drivers/tty/n_tty.c:1740
n_tty_receive_buf+0x30/0x40 drivers/tty/n_tty.c:1769
tiocsti drivers/tty/tty_io.c:2177 [inline]
tty_ioctl+0x7cc/0x17d0 drivers/tty/tty_io.c:2553
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685
ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702
__do_sys_ioctl fs/ioctl.c:709 [inline]
__se_sys_ioctl fs/ioctl.c:707 [inline]
__x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707
do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457569
Code: fd b3 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 b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f03883a2c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f03883a2c90 RCX: 0000000000457569
RDX: 0000000020000040
Lost 3 message(s)!
kernel msg: ebtables bug: please report to author: Valid hook without chain
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
vim2m vim2m.0: vidioc_s_fmt queue busy
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x244/0x39d lib/dump_stack.c:113
vim2m vim2m.0: vidioc_s_fmt queue busy
panic+0x238/0x4e7 kernel/panic.c:184
__warn.cold.8+0x20/0x4a kernel/panic.c:536
report_bug+0x254/0x2d0 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:178 [inline]
do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:271
do_invalid_op+0x36/0x40 arch/x86/kernel/traps.c:290
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:966
RIP: 0010:ep_scan_ready_list+0xc78/0x1050 fs/eventpoll.c:682
Code: ff 44 89 fe e8 39 0a 9a ff 45 84 ff 0f 85 ac f5 ff ff e8 5b 09 9a ff
48 c7 c7 40 c7 35 88 c6 05 c4 cb 2b 08 01 e8 a8 78 63 ff <0f> 0b e9 8d f5
ff ff e8 3c 09 9a ff 48 8d 7b 50 48 89 f8 48 c1 e8
RSP: 0018:ffff8801c549f668 EFLAGS: 00010286
RAX: 0000000000000000 RBX: ffffffff81e5a010 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8165c855 RDI: 0000000000000005
RBP: ffff8801c549f990 R08: ffff8801c5494500 R09: fffffbfff12b2160
R10: fffffbfff12b2160 R11: ffffffff89590b03 R12: ffff8801c549f968
R13: ffff8801c549fb28 R14: 0000000000000000 R15: 0000000000000000
ep_send_events fs/eventpoll.c:1713 [inline]
ep_poll+0x572/0x13d0 fs/eventpoll.c:1840
do_epoll_wait+0x1b0/0x200 fs/eventpoll.c:2198
__do_sys_epoll_wait fs/eventpoll.c:2208 [inline]
__se_sys_epoll_wait fs/eventpoll.c:2205 [inline]
__x64_sys_epoll_wait+0x97/0xf0 fs/eventpoll.c:2205
do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f77b7804943
Code: 00 31 d2 48 29 c2 64 89 11 48 83 c8 ff eb ea 90 90 90 90 90 90 90 90
83 3d b5 dc 2a 00 00 75 13 49 89 ca b8 e8 00 00 00 0f 05 <48> 3d 01 f0 ff
ff 73 34 c3 48 83 ec 08 e8 3b c4 00 00 48 89 04 24
RSP: 002b:00007ffca892da38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e8
RAX: ffffffffffffffda RBX: 0000000000000bb8 RCX: 00007f77b7804943
RDX: 0000000000000008 RSI: 00007ffca892db30 RDI: 000000000000000a
RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000bb8 R11: 0000000000000246 R12: 0000000000000003
R13: 0000000000000000 R14: 000000000186d100 R15: 0000000001853030
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
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 syzk...@googlegroups.com.

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

syzbot

unread,
Sep 21, 2019, 1:32:04 PM9/21/19
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages