syzbot


BUG: unable to handle kernel paging request in __bpf_map_put

Status: fixed on 2018/01/22 13:19
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+d2b5dab78b23722758e2@syzkaller.appspotmail.com
Fix commit: bbeb6e4323da bpf, array: fix overflow in max_entries and undefined behavior in index_mask
First crash: 2326d, last: 2326d

Sample crash report:
binder: 10786:10805 ioctl 40046207 0 returned -16
kauditd_printk_skb: 26 callbacks suppressed
audit: type=1400 audit(1515825077.041:469): avc:  denied  { map_read map_write } for  pid=10813 comm="syz-executor0" 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
BUG: unable to handle kernel paging request at 0000000100000047
IP: __bpf_map_put+0x64/0x2e0 kernel/bpf/syscall.c:233
PGD 1cfc0f067 P4D 1cfc0f067 PUD 0 
Oops: 0002 [#1] SMP KASAN
Dumping ftrace buffer:
   (ftrace buffer empty)
Modules linked in:
CPU: 1 PID: 10815 Comm: syz-executor0 Not tainted 4.15.0-rc7+ #259
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__bpf_map_put+0x64/0x2e0 kernel/bpf/syscall.c:233
RSP: 0018:ffff8801c2e477d0 EFLAGS: 00010212
RAX: 0000000000010000 RBX: 00000000ffffffff RCX: ffffffff817db094
RDX: 00000000000000db RSI: ffffc90002ccf000 RDI: 00000000ffffffff
RBP: ffff8801c2e47860 R08: 1ffff100385c8e59 R09: 0000000000000002
R10: ffffffff817e3241 R11: 0000000000000000 R12: 1ffff100385c8efb
R13: dffffc0000000000 R14: ffff8801c2e47f20 R15: 0000000000000001
FS:  00007f725a9b5700(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000100000047 CR3: 00000001d245e003 CR4: 00000000001606e0
Call Trace:
 bpf_map_put+0x1a/0x20 kernel/bpf/syscall.c:243
 bpf_map_fd_put_ptr+0x15/0x20 kernel/bpf/map_in_map.c:96
 fd_array_map_delete_elem+0xc8/0x110 kernel/bpf/arraymap.c:420
 map_delete_elem kernel/bpf/syscall.c:737 [inline]
 SYSC_bpf kernel/bpf/syscall.c:1717 [inline]
 SyS_bpf+0x22ea/0x4400 kernel/bpf/syscall.c:1685
 entry_SYSCALL_64_fastpath+0x23/0x9a
RIP: 0033:0x452ac9
RSP: 002b:00007f725a9b4c58 EFLAGS: 00000212 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 000000000071bea0 RCX: 0000000000452ac9
RDX: 0000000000000010 RSI: 0000000020abf000 RDI: 0000000000000003
RBP: 0000000000000036 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000212 R12: 00000000006ee5b0
R13: 00000000ffffffff R14: 00007f725a9b56d4 R15: 0000000000000000
Code: b5 41 48 c7 45 80 a5 14 58 86 48 c7 45 88 30 b0 7d 81 c7 00 f1 f1 f1 f1 c7 40 04 00 f2 f2 f2 c7 40 08 f3 f3 f3 f3 e8 ec 66 f2 ff <f0> ff 4b 48 74 2f e8 e1 66 f2 ff 48 b8 00 00 00 00 00 fc ff df 
RIP: __bpf_map_put+0x64/0x2e0 kernel/bpf/syscall.c:233 RSP: ffff8801c2e477d0
CR2: 0000000100000047
---[ end trace 49e8a6b2de9bc535 ]---
Kernel panic - not syncing: Fatal exception
Dumping ftrace buffer:
   (ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/01/13 06:31 upstream c92a9a461dff 9dc808a6 .config console log report ci-upstream-kasan-gce
* Struck through repros no longer work on HEAD.