syzbot


general protection fault in put_cmsg

Status: fixed on 2020/07/17 17:58
Subsystems: net
[Documentation on labels]
Fix commit: 1b2f08df0a88 ipv6: set msg_control_is_user in do_ipv6_getsockopt
First crash: 1465d, last: 1465d
Cause bisection: introduced by (bisect log) :
commit 1f466e1f15cf1dac7c86798d694649fc42cd868a
Author: Christoph Hellwig <hch@lst.de>
Date: Mon May 11 11:59:13 2020 +0000

  net: cleanly handle kernel vs user buffers for ->msg_control

Crash: general protection fault in put_cmsg (log)
Repro: C syz .config
  

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0004000809: 0000 [#1] PREEMPT SMP KASAN
KASAN: probably user-memory-access in range [0x0000000020004048-0x000000002000404f]
CPU: 0 PID: 7025 Comm: syz-executor327 Not tainted 5.7.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:put_cmsg+0x1a6/0x3e0 net/core/scm.c:242
Code: 89 ee e8 cd 37 55 fb 45 84 ed 0f 85 16 01 00 00 e8 8f 36 55 fb 48 8d 7b 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e c9 01 00 00 8b 44 24 08 48 8d
RSP: 0018:ffffc90001277990 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: 0000000020004040 RCX: ffffffff861df603
RDX: 0000000004000809 RSI: ffffffff861df611 RDI: 0000000020004048
RBP: ffffc90001277aa0 R08: ffff888094956340 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 1ffff9200024ef35
R13: 0000000000000000 R14: 0000000000000014 R15: 0000000000018ff8
FS:  0000000002520880(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000080 CR3: 00000000a6af0000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 do_ipv6_getsockopt.isra.0+0x21f6/0x2590 net/ipv6/ipv6_sockglue.c:1111
 ipv6_getsockopt+0x177/0x270 net/ipv6/ipv6_sockglue.c:1396
 tcp_getsockopt net/ipv4/tcp.c:3726 [inline]
 tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:3720
 __sys_getsockopt+0x14b/0x2e0 net/socket.c:2172
 __do_sys_getsockopt net/socket.c:2187 [inline]
 __se_sys_getsockopt net/socket.c:2184 [inline]
 __x64_sys_getsockopt+0xba/0x150 net/socket.c:2184
 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
 entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x4401d9
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff7e603cd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000037
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 00000000004401d9
RDX: 0000000000000006 RSI: 0000000000000029 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 0000000020000040 R09: 00000000004002c8
R10: 0000000020004040 R11: 0000000000000246 R12: 0000000000401a60
R13: 0000000000401af0 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace b66d66850e28e7f7 ]---
RIP: 0010:put_cmsg+0x1a6/0x3e0 net/core/scm.c:242
Code: 89 ee e8 cd 37 55 fb 45 84 ed 0f 85 16 01 00 00 e8 8f 36 55 fb 48 8d 7b 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e c9 01 00 00 8b 44 24 08 48 8d
RSP: 0018:ffffc90001277990 EFLAGS: 00010206
RAX: dffffc0000000000 RBX: 0000000020004040 RCX: ffffffff861df603
RDX: 0000000004000809 RSI: ffffffff861df611 RDI: 0000000020004048
RBP: ffffc90001277aa0 R08: ffff888094956340 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 1ffff9200024ef35
R13: 0000000000000000 R14: 0000000000000014 R15: 0000000000018ff8
FS:  0000000002520880(0000) GS:ffff8880ae600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000080 CR3: 00000000a6af0000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/05/12 22:30 net-next-old 51fa960d3b51 a44eb8f7 .config console log report syz C ci-upstream-net-kasan-gce
2020/05/13 06:40 net-next-old 51fa960d3b51 a44eb8f7 .config console log report ci-upstream-net-kasan-gce
2020/05/12 22:05 net-next-old 51fa960d3b51 a44eb8f7 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.