syzbot


general protection fault in bpf_tcp_close (2)

Status: fixed on 2019/10/21 12:29
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+339037020e772651f1d8@syzkaller.appspotmail.com
Fix commit: e06fa9c16ce4 bpf, sockmap: fix potential use after free in bpf_tcp_close
First crash: 2277d, last: 2233d
Fix bisection: fixed by (bisect log) :
commit ac3d9dd034e565df2c034ab2ca71f0a9f69153c1
Author: Eric Dumazet <edumazet@google.com>
Date: Fri Sep 21 22:27:38 2018 +0000

  netpoll: make ndo_poll_controller() optional

  
Discussions (3)
Title Replies (including bot) Last reply
Reminder: 36 open syzbot bugs in "net/bpf" subsystem 1 (1) 2019/07/03 06:01
Reminder: 30 open syzbot bugs in "net/bpf" subsystem 1 (1) 2019/06/24 05:01
general protection fault in bpf_tcp_close (2) 0 (2) 2018/07/15 08:39
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in bpf_tcp_close bpf C 421 2279d 2323d 8/28 fixed on 2018/07/09 18:05

Sample crash report:
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] SMP KASAN
CPU: 0 PID: 4589 Comm: syz-executor175 Not tainted 4.18.0-rc5+ #153
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__hlist_del include/linux/list.h:649 [inline]
RIP: 0010:hlist_del_rcu include/linux/rculist.h:440 [inline]
RIP: 0010:bpf_tcp_close+0x94c/0x1050 kernel/bpf/sockmap.c:365
Code: 85 25 06 00 00 48 8d 95 18 ff ff ff 49 8b 4c 24 18 48 89 d6 48 c1 ee 03 c6 04 1e 00 48 89 ce 48 c1 ee 03 48 89 85 18 ff ff ff <80> 3c 1e 00 0f 85 bf 05 00 00 48 c1 ea 03 48 85 c0 48 89 01 48 89 
RSP: 0018:ffff8801aec2f950 EFLAGS: 00010a02
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: dead000000000200
RDX: ffff8801aec2fa40 RSI: 1bd5a00000000040 RDI: ffff8801c7e07e90
RBP: ffff8801aec2fb28 R08: ffff8801d9bfe200 R09: ffffed0038fc0fc1
R10: ffffed0038fc0fc1 R11: ffff8801c7e07e0b R12: ffff8801c7e07e80
R13: ffff8801af1ec5c0 R14: ffff8801c7e07e08 R15: ffff8801c7e07e98
FS:  0000000002397880(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd832918e78 CR3: 00000001af586000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 inet_release+0x104/0x1f0 net/ipv4/af_inet.c:427
 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:459
 __sock_release+0xd7/0x260 net/socket.c:599
 sock_close+0x19/0x20 net/socket.c:1150
 __fput+0x355/0x8b0 fs/file_table.c:209
 ____fput+0x15/0x20 fs/file_table.c:243
 task_work_run+0x1ec/0x2a0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:192 [inline]
 exit_to_usermode_loop+0x313/0x370 arch/x86/entry/common.c:166
 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:268 [inline]
 do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x405ac1
Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 54 17 00 00 c3 48 83 ec 08 e8 6a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 b3 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 
RSP: 002b:00007ffcb9475740 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000000000000004 RCX: 0000000000405ac1
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 000000000003e665
R13: 0000000000407710 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
Dumping ftrace buffer:
   (ftrace buffer empty)
---[ end trace 603dc17a5577dcc4 ]---
RIP: 0010:__hlist_del include/linux/list.h:649 [inline]
RIP: 0010:hlist_del_rcu include/linux/rculist.h:440 [inline]
RIP: 0010:bpf_tcp_close+0x94c/0x1050 kernel/bpf/sockmap.c:365
Code: 85 25 06 00 00 48 8d 95 18 ff ff ff 49 8b 4c 24 18 48 89 d6 48 c1 ee 03 c6 04 1e 00 48 89 ce 48 c1 ee 03 48 89 85 18 ff ff ff <80> 3c 1e 00 0f 85 bf 05 00 00 48 c1 ea 03 48 85 c0 48 89 01 48 89 
RSP: 0018:ffff8801aec2f950 EFLAGS: 00010a02
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: dead000000000200
RDX: ffff8801aec2fa40 RSI: 1bd5a00000000040 RDI: ffff8801c7e07e90
RBP: ffff8801aec2fb28 R08: ffff8801d9bfe200 R09: ffffed0038fc0fc1
R10: ffffed0038fc0fc1 R11: ffff8801c7e07e0b R12: ffff8801c7e07e80
R13: ffff8801af1ec5c0 R14: ffff8801c7e07e08 R15: ffff8801c7e07e98
FS:  0000000002397880(0000) GS:ffff8801dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd832918e78 CR3: 00000001af586000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (26):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/07/19 00:50 upstream 04a132065175 49f35839 .config console log report syz C ci-upstream-kasan-gce-root
2018/07/15 10:22 bpf c849eb0d1e75 92a49505 .config console log report syz C ci-upstream-bpf-kasan-gce
2018/07/15 08:38 bpf-next 13f7432bdd8e 92a49505 .config console log report syz C ci-upstream-bpf-next-kasan-gce
2018/07/13 11:16 upstream 63f047771621 92a49505 .config console log report ci-upstream-kasan-gce-root
2018/08/20 16:51 bpf f6069b9aa993 2dc4378f .config console log report ci-upstream-bpf-kasan-gce
2018/08/16 03:05 bpf 852851244e7f 9ccc1d45 .config console log report ci-upstream-bpf-kasan-gce
2018/08/16 01:04 bpf 852851244e7f 9ccc1d45 .config console log report ci-upstream-bpf-kasan-gce
2018/08/09 11:32 bpf bf9bae0ea6ec 2eeda842 .config console log report ci-upstream-bpf-kasan-gce
2018/08/06 22:44 bpf 74682128c6e4 1beb8136 .config console log report ci-upstream-bpf-kasan-gce
2018/08/05 18:04 bpf 8c85cbdf371f 1beb8136 .config console log report ci-upstream-bpf-kasan-gce
2018/08/04 19:41 bpf 8c85cbdf371f 3476a2df .config console log report ci-upstream-bpf-kasan-gce
2018/07/30 01:34 bpf 71eb5255f55b 1a381291 .config console log report ci-upstream-bpf-kasan-gce
2018/07/19 14:27 bpf 3a9b0455062f 49f35839 .config console log report ci-upstream-bpf-kasan-gce
2018/08/24 14:08 net-next-old 2ad0d5269970 95b5c82b .config console log report ci-upstream-net-kasan-gce
2018/08/11 06:34 bpf-next 9d6f417714c3 7a88b141 .config console log report ci-upstream-bpf-next-kasan-gce
2018/08/09 05:45 bpf-next 9c2956d2ad9e 2eeda842 .config console log report ci-upstream-bpf-next-kasan-gce
2018/08/08 22:05 net-next-old 9c2956d2ad9e 2eeda842 .config console log report ci-upstream-net-kasan-gce
2018/08/08 10:55 net-next-old e93dd8a1ac31 ddeb9f8d .config console log report ci-upstream-net-kasan-gce
2018/07/31 17:30 bpf-next 194db0d95802 1a381291 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/30 21:12 bpf-next 2e96187b6967 1a381291 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/29 21:31 net-next-old 19725496da56 1a381291 .config console log report ci-upstream-net-kasan-gce
2018/07/23 06:57 bpf-next 8ae71e76cf1f 8cc079c3 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/20 13:21 bpf-next 8ae71e76cf1f 49f35839 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/15 07:59 bpf-next 13f7432bdd8e 92a49505 .config console log report ci-upstream-bpf-next-kasan-gce
2018/07/11 05:44 bpf-next d90c936fb318 2e0e3130 .config console log report ci-upstream-bpf-next-kasan-gce
2018/08/23 15:27 linux-next 455fb5ec1df1 95b5c82b .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.