general protection fault in virtio_transport_release

12 views
Skip to first unread message

syzbot

unread,
Nov 19, 2019, 7:35:08 AM11/19/19
to a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, da...@davemloft.net, ido...@mellanox.com, jakub.k...@netronome.com, ji...@mellanox.com, ka...@fb.com, k...@vger.kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, songliu...@fb.com, stef...@redhat.com, syzkall...@googlegroups.com, vad...@mellanox.com, virtual...@lists.linux-foundation.org, y...@fb.com
Hello,

syzbot found the following crash on:

HEAD commit: 1e8795b1 mscc.c: fix semicolon.cocci warnings
git tree: net-next
console output: https://syzkaller.appspot.com/x/log.txt?x=15d77406e00000
kernel config: https://syzkaller.appspot.com/x/.config?x=e855e9c92c9474fe
dashboard link: https://syzkaller.appspot.com/bug?extid=e2e5c07bf353b2f79daa
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1537f46ae00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11359c6ae00000

The bug was bisected to:

commit f366cd2a2e510b155e18b21a2d149332aa08eb61
Author: Vadim Pasternak <vad...@mellanox.com>
Date: Mon Oct 21 10:30:30 2019 +0000

mlxsw: reg: Add macro for getting QSFP module EEPROM page number

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=148945aae00000
final crash: https://syzkaller.appspot.com/x/report.txt?x=168945aae00000
console output: https://syzkaller.appspot.com/x/log.txt?x=128945aae00000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+e2e5c0...@syzkaller.appspotmail.com
Fixes: f366cd2a2e51 ("mlxsw: reg: Add macro for getting QSFP module EEPROM
page number")

RDX: 0000000000000010 RSI: 00000000200000c0 RDI: 0000000000000004
RBP: 0000000000000005 R08: 0000000000000001 R09: 00007ffd5b250031
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401e00
R13: 0000000000401e90 R14: 0000000000000000 R15: 0000000000000000
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 8862 Comm: syz-executor079 Not tainted 5.4.0-rc6+ #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:virtio_transport_release+0x13b/0xcb0
net/vmw_vsock/virtio_transport_common.c:826
Code: e8 aa e6 2b fa 66 41 83 fd 01 0f 84 34 02 00 00 e8 3a e5 2b fa 48 8b
95 30 ff ff ff 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f
85 22 0a 00 00 48 8b bb 98 00 00 00 48 b8 00 00 00
RSP: 0018:ffff888092dbfaf0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff87474aa0
RDX: 0000000000000013 RSI: ffffffff874747d6 RDI: 0000000000000001
RBP: ffff888092dbfc00 R08: ffff88809245a380 R09: fffffbfff1555fe1
R10: fffffbfff1555fe0 R11: 0000000000000003 R12: ffff888092dbfbd8
R13: 0000000000000007 R14: 0000000000000007 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200000c4 CR3: 0000000008e6d000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__vsock_release+0x80/0x2d0 net/vmw_vsock/af_vsock.c:733
vsock_release+0x35/0xa0 net/vmw_vsock/af_vsock.c:806
__sock_release+0xce/0x280 net/socket.c:590
sock_close+0x1e/0x30 net/socket.c:1268
__fput+0x2ff/0x890 fs/file_table.c:280
____fput+0x16/0x20 fs/file_table.c:313
task_work_run+0x145/0x1c0 kernel/task_work.c:113
exit_task_work include/linux/task_work.h:22 [inline]
do_exit+0x904/0x2e60 kernel/exit.c:817
do_group_exit+0x135/0x360 kernel/exit.c:921
__do_sys_exit_group kernel/exit.c:932 [inline]
__se_sys_exit_group kernel/exit.c:930 [inline]
__x64_sys_exit_group+0x44/0x50 kernel/exit.c:930
do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x43f1d8
Code: Bad RIP value.
RSP: 002b:00007ffd5b25f838 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043f1d8
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004befa8 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d1180 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 4b9b883ea3ab661f ]---
RIP: 0010:virtio_transport_release+0x13b/0xcb0
net/vmw_vsock/virtio_transport_common.c:826
Code: e8 aa e6 2b fa 66 41 83 fd 01 0f 84 34 02 00 00 e8 3a e5 2b fa 48 8b
95 30 ff ff ff 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f
85 22 0a 00 00 48 8b bb 98 00 00 00 48 b8 00 00 00
RSP: 0018:ffff888092dbfaf0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff87474aa0
RDX: 0000000000000013 RSI: ffffffff874747d6 RDI: 0000000000000001
RBP: ffff888092dbfc00 R08: ffff88809245a380 R09: fffffbfff1555fe1
R10: fffffbfff1555fe0 R11: 0000000000000003 R12: ffff888092dbfbd8
R13: 0000000000000007 R14: 0000000000000007 R15: 0000000000000000
FS: 00000000009db880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000043f1ae CR3: 0000000008e6d000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

Stefano Garzarella

unread,
Nov 20, 2019, 7:03:19 AM11/20/19
to syzbot, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, David S. Miller, ido...@mellanox.com, jakub.k...@netronome.com, ji...@mellanox.com, ka...@fb.com, kvm, linux-...@vger.kernel.org, net...@vger.kernel.org, songliu...@fb.com, Stefan Hajnoczi, syzkall...@googlegroups.com, vad...@mellanox.com, virtual...@lists.linux-foundation.org, y...@fb.com
On Tue, Nov 19, 2019 at 1:35 PM syzbot <syzbot+e2e5c0...@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit: 1e8795b1 mscc.c: fix semicolon.cocci warnings
> git tree: net-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=15d77406e00000
> kernel config: https://syzkaller.appspot.com/x/.config?x=e855e9c92c9474fe
> dashboard link: https://syzkaller.appspot.com/bug?extid=e2e5c07bf353b2f79daa
> compiler: gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1537f46ae00000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11359c6ae00000
>
> The bug was bisected to:
>
> commit f366cd2a2e510b155e18b21a2d149332aa08eb61
> Author: Vadim Pasternak <vad...@mellanox.com>
> Date: Mon Oct 21 10:30:30 2019 +0000
>
> mlxsw: reg: Add macro for getting QSFP module EEPROM page number
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=148945aae00000
> final crash: https://syzkaller.appspot.com/x/report.txt?x=168945aae00000
> console output: https://syzkaller.appspot.com/x/log.txt?x=128945aae00000
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+e2e5c0...@syzkaller.appspotmail.com
> Fixes: f366cd2a2e51 ("mlxsw: reg: Add macro for getting QSFP module EEPROM
> page number")

I'm working on this issue.

I think the problem is related to
ac03046ece2b "vsock/virtio: free packets during the socket release"

I'll send a patch ASAP.

Thanks,
Stefano

syzbot

unread,
Nov 20, 2019, 4:14:02 PM11/20/19
to sgar...@redhat.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer still triggered
crash:
general protection fault in vsock_assign_transport

kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 8838 Comm: syz-executor.2 Not tainted 5.4.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:vsock_assign_transport+0x17d/0x360 net/vmw_vsock/af_vsock.c:447
Code: c1 ea 03 80 3c 02 00 0f 85 94 01 00 00 4c 8b a3 78 04 00 00 48 b8 00
00 00 00 00 fc ff df 49 8d 7c 24 08 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f
85 87 01 00 00 4c 89 f6 48 89 df 41 ff 54 24 08 31
RSP: 0018:ffff88808839fc38 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff8880a2666800 RCX: ffffffff87469797
RDX: 0000000000000001 RSI: ffffffff874697a5 RDI: 0000000000000008
RBP: ffff88808839fc60 R08: ffff88808db6a040 R09: ffff88808db6a8d0
R10: fffffbfff138dd10 R11: ffffffff89c6e887 R12: 0000000000000000
R13: ffffffff89bfdda0 R14: 0000000000000000 R15: ffff8880a2666c78
FS: 00007fd6cbf9b700(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200000c0 CR3: 00000000a0bcc000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
vsock_stream_connect+0x2b3/0xbe0 net/vmw_vsock/af_vsock.c:1268
__sys_connect+0x264/0x330 net/socket.c:1828
__do_sys_connect net/socket.c:1839 [inline]
__se_sys_connect net/socket.c:1836 [inline]
__x64_sys_connect+0x73/0xb0 net/socket.c:1836
do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45a639
Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fd6cbf9ac78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 00007fd6cbf9ac90 RCX: 000000000045a639
RDX: 0000000000000010 RSI: 00000000200000c0 RDI: 0000000000000004
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd6cbf9b6d4
R13: 00000000004c0ec7 R14: 00000000004d3930 R15: 0000000000000005
Modules linked in:
---[ end trace 454df1d6a0d2b48f ]---
RIP: 0010:vsock_assign_transport+0x17d/0x360 net/vmw_vsock/af_vsock.c:447
Code: c1 ea 03 80 3c 02 00 0f 85 94 01 00 00 4c 8b a3 78 04 00 00 48 b8 00
00 00 00 00 fc ff df 49 8d 7c 24 08 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f
85 87 01 00 00 4c 89 f6 48 89 df 41 ff 54 24 08 31
RSP: 0018:ffff88808839fc38 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff8880a2666800 RCX: ffffffff87469797
RDX: 0000000000000001 RSI: ffffffff874697a5 RDI: 0000000000000008
RBP: ffff88808839fc60 R08: ffff88808db6a040 R09: ffff88808db6a8d0
R10: fffffbfff138dd10 R11: ffffffff89c6e887 R12: 0000000000000000
R13: ffffffff89bfdda0 R14: 0000000000000000 R15: ffff8880a2666c78
FS: 00007fd6cbf9b700(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200000c0 CR3: 00000000a0bcc000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


Tested on:

commit: 5c64b4a5 vsock: avoid to assign transport if init fails
git tree: https://github.com/stefano-garzarella/linux.git
fix-syzbot-e2e5c07bf353b2f79daa
console output: https://syzkaller.appspot.com/x/log.txt?x=172b30eee00000
kernel config: https://syzkaller.appspot.com/x/.config?x=ce691bc139ec9632

syzbot

unread,
Nov 20, 2019, 8:52:00 PM11/20/19
to sgar...@redhat.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger
crash:

Reported-and-tested-by:
syzbot+e2e5c0...@syzkaller.appspotmail.com

Tested on:

commit: ddac9aa7 vsock: avoid to assign transport if its init fails
git tree: https://github.com/stefano-garzarella/linux.git
fix-syzbot-e2e5c07bf353b2f79daa
kernel config: https://syzkaller.appspot.com/x/.config?x=ce691bc139ec9632
dashboard link: https://syzkaller.appspot.com/bug?extid=e2e5c07bf353b2f79daa
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages