syzbot


general protection fault in __bpf_prog_put

Status: fixed on 2018/01/22 13:19
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+61d23c95395cc90dbc2b@syzkaller.appspotmail.com
Fix commit: bbeb6e4323da bpf, array: fix overflow in max_entries and undefined behavior in index_mask
First crash: 2326d, last: 2319d
Discussions (6)
Title Replies (including bot) Last reply
[PATCH 4.4 00/87] 4.4.112-stable review 103 (103) 2018/02/14 16:43
[PATCH 4.9 00/96] 4.9.77-stable review 111 (111) 2018/01/21 16:03
[PATCH 4.14 000/118] 4.14.14-stable review 139 (139) 2018/01/16 20:50
[PATCH 4.4-stable 0/6] bpf: prevent out-of-bounds speculation 11 (11) 2018/01/13 19:49
[PATCH bpf] bpf, array: fix overflow in max_entries and undefined behavior in index_mask 2 (2) 2018/01/10 22:58
general protection fault in __bpf_prog_put 0 (1) 2018/01/10 12:58

Sample crash report:
audit: type=1400 audit(1515733976.513:11): avc:  denied  { map_read map_write } for  pid=3500 comm="syzkaller140992" scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=bpf permissive=1
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
Dumping ftrace buffer:
   (ftrace buffer empty)
Modules linked in:
CPU: 0 PID: 3500 Comm: syzkaller140992 Not tainted 4.15.0-rc7+ #258
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__bpf_prog_put+0x8e/0x580 kernel/bpf/syscall.c:939
RSP: 0018:ffff8801c00bf718 EFLAGS: 00010a07
RAX: 1e200036200001b8 RBX: 1ffff10038017ee6 RCX: ffffffff817db4b7
RDX: 0000000000000000 RSI: 0000000000000001 RDI: f10001b100000dac
RBP: ffff8801c00bf7f8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: f10001b100000dac
R13: f10001b100000dc4 R14: ffff8801c00bf7d0 R15: dffffc0000000000
FS:  00000000016ac880(0000) GS:ffff8801db200000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020f01fd4 CR3: 0000000006822005 CR4: 00000000001606f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 bpf_prog_put+0x1a/0x20 kernel/bpf/syscall.c:950
 prog_fd_array_put_ptr+0x15/0x20 kernel/bpf/arraymap.c:446
 fd_array_map_delete_elem kernel/bpf/arraymap.c:420 [inline]
 bpf_fd_array_map_clear+0xd2/0x140 kernel/bpf/arraymap.c:461
 bpf_map_put_uref+0x54/0x70 kernel/bpf/syscall.c:224
 bpf_map_put_with_uref kernel/bpf/syscall.c:248 [inline]
 bpf_map_release+0x91/0xc0 kernel/bpf/syscall.c:259
 __fput+0x327/0x7e0 fs/file_table.c:210
 ____fput+0x15/0x20 fs/file_table.c:244
 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
 SYSC_exit_group kernel/exit.c:979 [inline]
 SyS_exit_group+0x1d/0x20 kernel/exit.c:977
 entry_SYSCALL_64_fastpath+0x23/0x9a
RIP: 0033:0x440a69
RSP: 002b:00000000007dff48 EFLAGS: 00000206 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007ffe4e7f1560 RCX: 0000000000440a69
RDX: 0000000000440a69 RSI: 000000000000002c RDI: 0000000000000001
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000402240
R13: 00000000004022d0 R14: 0000000000000000 R15: 0000000000000000
Code: f1 f1 f1 c7 40 04 00 f2 f2 f2 c7 40 08 f2 f2 f2 f2 c7 40 0c 00 f2 f2 f2 c7 40 10 f3 f3 f3 f3 e8 c9 62 f2 ff 4c 89 e8 48 c1 e8 03 <42> 80 3c 38 00 0f 85 07 04 00 00 49 8b 44 24 18 f0 ff 08 74 3a 
RIP: __bpf_prog_put+0x8e/0x580 kernel/bpf/syscall.c:939 RSP: ffff8801c00bf718
---[ end trace 52e969fb65d3fffd ]---

Crashes (212):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/01/12 05:15 upstream 1545dec46db3 9dc808a6 .config console log report syz C ci-upstream-kasan-gce
2018/01/12 04:03 upstream 1545dec46db3 9dc808a6 .config console log report syz C ci-upstream-kasan-gce-386
2018/01/12 04:20 linux-next 8418f8876404 9dc808a6 .config console log report syz C ci-upstream-next-kasan-gce
2018/01/12 03:53 mmots 2c405fa05106 9dc808a6 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/12 00:48 linux-next 8418f8876404 9dc808a6 .config console log report syz C ci-upstream-next-kasan-gce
2018/01/12 00:48 mmots 4147d50978df 9dc808a6 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/12 00:38 linux-next 8418f8876404 9dc808a6 .config console log report syz C ci-upstream-next-kasan-gce
2018/01/11 22:20 mmots 4147d50978df 9dc808a6 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/11 17:37 linux-next 8418f8876404 9dc808a6 .config console log report syz C ci-upstream-next-kasan-gce
2018/01/11 16:58 mmots 4147d50978df 9dc808a6 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/11 10:56 linux-next 8418f8876404 02a19b64 .config console log report syz C ci-upstream-next-kasan-gce
2018/01/11 10:24 mmots 4147d50978df 02a19b64 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/11 10:15 mmots 4147d50978df 02a19b64 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/11 09:47 linux-next 8418f8876404 02a19b64 .config console log report syz C ci-upstream-next-kasan-gce
2018/01/11 06:46 mmots 4147d50978df 02a19b64 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/11 06:36 linux-next b4464bcab38d 02a19b64 .config console log report syz C ci-upstream-next-kasan-gce
2018/01/11 06:20 mmots 4147d50978df 02a19b64 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/11 06:19 linux-next b4464bcab38d 02a19b64 .config console log report syz C ci-upstream-next-kasan-gce
2018/01/11 02:24 linux-next b4464bcab38d 02a19b64 .config console log report syz C ci-upstream-next-kasan-gce
2018/01/11 02:14 mmots 4147d50978df 02a19b64 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/11 02:00 mmots 4147d50978df 02a19b64 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/10 10:00 linux-next b4464bcab38d 02a19b64 .config console log report syz C ci-upstream-next-kasan-gce
2018/01/17 08:08 upstream 41aa5e5d712b a46e5318 .config console log report ci-upstream-kasan-gce
2018/01/16 23:20 upstream 41aa5e5d712b a46e5318 .config console log report ci-upstream-kasan-gce
2018/01/16 20:37 upstream a8750ddca918 a46e5318 .config console log report ci-upstream-kasan-gce
2018/01/16 20:11 upstream a8750ddca918 a46e5318 .config console log report ci-upstream-kasan-gce
2018/01/16 18:03 upstream a8750ddca918 4198e588 .config console log report ci-upstream-kasan-gce
2018/01/16 17:32 upstream a8750ddca918 4198e588 .config console log report ci-upstream-kasan-gce
2018/01/17 05:10 upstream 41aa5e5d712b a46e5318 .config console log report ci-upstream-kasan-gce-386
2018/01/17 04:22 upstream 41aa5e5d712b a46e5318 .config console log report ci-upstream-kasan-gce-386
2018/01/17 07:55 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 07:55 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 07:39 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 06:44 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 04:49 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 04:46 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 04:40 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 04:12 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 03:52 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 02:20 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 02:18 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 01:28 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/17 00:21 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/16 23:36 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/16 22:49 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/16 21:21 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/16 20:35 net-next-old e02f08a07098 a46e5318 .config console log report ci-upstream-net-kasan-gce
2018/01/16 19:28 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 19:24 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 17:31 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 17:09 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 17:01 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 16:39 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 15:44 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 15:44 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 15:41 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 15:05 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 13:29 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 13:00 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 12:50 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 11:46 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
2018/01/16 11:25 net-next-old 79d891c1bbb6 4198e588 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.