Subject: Re: BUG: corrupted list in remove_wait_queue

From: syzbot <[email-masked]>
Date: Sat, 24 Mar 2018 05:12:01 -0700

syzbot has found reproducer for the following crash on upstream commit
99fec39e7725d091c94d1bb0242e40c8092994f6 (Fri Mar 23 22:34:18 2018 +0000)
Merge tag 'trace-v4.16-rc4' of  
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
syzbot dashboard link:  
https://syzkaller.appspot.com/bug?extid=c0272972b01b872e604a

So far this crash happened 3 times on upstream.
syzkaller reproducer is attached.
Raw console output is attached.
.config is attached.
compiler: gcc (GCC) 7.1.1 20170620
user-space arch: i386

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: [email-masked]
It will help syzbot understand when the bug is fixed.

IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
IPVS: ftp: loaded support on port[0] = 21
list_del corruption, 0000000005e22148->next is LIST_POISON1  
(00000000189fde61)
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:47!
invalid opcode: 0000 [#1] SMP KASAN
Dumping ftrace buffer:
    (ftrace buffer empty)
Modules linked in:
CPU: 0 PID: 4722 Comm: syz-executor0 Not tainted 4.16.0-rc6+ #274
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:__list_del_entry_valid+0xd3/0x150 lib/list_debug.c:45
RSP: 0018:ffff8801b81d7168 EFLAGS: 00010082
RAX: 000000000000004e RBX: dead000000000200 RCX: 0000000000000000
RDX: 000000000000004e RSI: 1ffff1003703ade2 RDI: ffffed003703ae21
RBP: ffff8801b81d7180 R08: ffffffff86f39cb8 R09: 1ffff1003703ad89
R10: ffff8801b81d7040 R11: 0000000000000002 R12: dead000000000100
R13: ffff8801b028e8d8 R14: ffff8801b028e8e0 R15: ffff8801c764d600
FS:  0000000000000000(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 0000000008138024 CR3: 0000000006e22004 CR4: 00000000001606f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
  __list_del_entry include/linux/list.h:117 [inline]
  list_del include/linux/list.h:125 [inline]
  __remove_wait_queue include/linux/wait.h:184 [inline]
  remove_wait_queue+0x90/0x350 kernel/sched/wait.c:51
  vhost_poll_stop+0x46/0x90 drivers/vhost/vhost.c:229
  vhost_net_disable_vq drivers/vhost/net.c:405 [inline]
  vhost_net_stop_vq+0x90/0x120 drivers/vhost/net.c:973
  vhost_net_stop drivers/vhost/net.c:984 [inline]
  vhost_net_release+0x49/0x190 drivers/vhost/net.c:1017
  __fput+0x327/0x7e0 fs/file_table.c:209
  ____fput+0x15/0x20 fs/file_table.c:243
  task_work_run+0x199/0x270 kernel/task_work.c:113
  exit_task_work include/linux/task_work.h:22 [inline]
  do_exit+0x9bb/0x1ad0 kernel/exit.c:865
  do_group_exit+0x149/0x400 kernel/exit.c:968
  get_signal+0x73a/0x16d0 kernel/signal.c:2469
  do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809
  exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162
  prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
  syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
  do_syscall_32_irqs_on arch/x86/entry/common.c:336 [inline]
  do_fast_syscall_32+0xbe6/0xf9f arch/x86/entry/common.c:392
  entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139
RIP: 0023:0xf7f47c99
RSP: 002b:00000000f7f2210c EFLAGS: 00000296 ORIG_RAX: 00000000000000f0
RAX: fffffffffffffe00 RBX: 000000000813af98 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Code: 8f 00 00 00 49 8b 54 24 08 48 39 f2 75 3b 48 83 c4 08 b8 01 00 00 00  
5b 41 5c 5d c3 4c 89 e2 48 c7 c7 00 80 40 86 e8 85 df fb fe <0f> 0b 48 c7  
c7 60 80 40 86 e8 77 df fb fe 0f 0b 48 c7 c7 c0 80
RIP: __list_del_entry_valid+0xd3/0x150 lib/list_debug.c:45 RSP:  
ffff8801b81d7168
---[ end trace 39a3fabeba42b75a ]---