syzbot


general protection fault in asn1_ber_decoder

Status: fixed on 2017/11/18 01:42
Subsystems: crypto keyrings
[Documentation on labels]
Reported-by: syzbot+04b92812698232d15d78c1e4d3bbf6fcc21eeeb1@syzkaller.appspotmail.com
Fix commit: 624f5ab8720b KEYS: fix NULL pointer dereference during ASN.1 parsing [ver #2]
First crash: 2364d, last: 2357d

Sample crash report:
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: 1 PID: 3004 Comm: syzkaller103330 Not tainted 4.14.0-rc5-mm1+ #20
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
task: ffff8801d1d8c0c0 task.stack: ffff8801c10d8000
RIP: 0010:asn1_ber_decoder+0x431/0x1c20 lib/asn1_decoder.c:233
RSP: 0018:ffff8801c10df908 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffffff851d1208
RBP: ffff8801c10dfbc0 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: dffffc0000000000 R15: ffff8801c10dfb98
FS:  0000000001848880(0000) GS:ffff8801db300000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000207c9ffb CR3: 00000001d282e000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 pkcs7_parse_message+0x2b3/0x710 crypto/asymmetric_keys/pkcs7_parser.c:136
 verify_pkcs7_signature+0x8d/0x290 certs/system_keyring.c:216
 pkcs7_preparse+0x7b/0xc0 crypto/asymmetric_keys/pkcs7_key_type.c:63
 key_create_or_update+0x4c6/0xe20 security/keys/key.c:846
 SYSC_add_key security/keys/keyctl.c:122 [inline]
 SyS_add_key+0x18a/0x340 security/keys/keyctl.c:62
 entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x43fcd9
RSP: 002b:00007ffec0e43068 EFLAGS: 00000217 ORIG_RAX: 00000000000000f8
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fcd9
RDX: 0000000020000000 RSI: 00000000207c9ffb RDI: 000000002009b000
RBP: 0000000000000082 R08: fffffffffffffffe R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000217 R12: 0000000000401640
R13: 00000000004016d0 R14: 0000000000000000 R15: 0000000000000000
Code: 1a ff 48 8d 43 01 49 89 87 80 fe ff ff 48 89 85 90 fd ff ff 48 8b 85 b8 fd ff ff 48 01 d8 48 89 c2 48 89 c1 48 c1 ea 03 83 e1 07 <42> 0f b6 14 32 38 ca 7f 08 84 d2 0f 85 e5 0f 00 00 0f b6 00 88 
RIP: asn1_ber_decoder+0x431/0x1c20 lib/asn1_decoder.c:233 RSP: ffff8801c10df908
---[ end trace 9c17097640e59358 ]---
Kernel panic - not syncing: Fatal exception
Dumping ftrace buffer:
   (ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (5009):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/11/06 10:05 mmots 0f611fb6dcc0 e0a2b195 .config console log report syz C ci-upstream-mmots-kasan-gce
2017/11/06 09:57 linux-next 5a3517e009e9 e0a2b195 .config console log report syz C ci-upstream-next-kasan-gce
2017/11/06 09:54 linux-next 5a3517e009e9 e0a2b195 .config console log report syz C ci-upstream-next-kasan-gce
2017/11/04 22:22 linux-next 5a3517e009e9 e0a2b195 .config console log report syz C ci-upstream-next-kasan-gce
2017/11/04 20:30 mmots 0f611fb6dcc0 e0a2b195 .config console log report syz C ci-upstream-mmots-kasan-gce
2017/11/04 20:19 linux-next 5a3517e009e9 e0a2b195 .config console log report syz C ci-upstream-next-kasan-gce
2017/11/04 00:26 linux-next 5a3517e009e9 e0a2b195 .config console log report syz C skylake-linux-next-kasan-qemu
2017/11/03 23:04 linux-next 5a3517e009e9 e0a2b195 .config console log report syz C skylake-linux-next-kasan-qemu
2017/11/03 22:51 mmots 0f611fb6dcc0 e0a2b195 .config console log report syz C ci-upstream-mmots-kasan-gce
2017/11/03 22:36 linux-next 5a3517e009e9 e0a2b195 .config console log report syz C skylake-linux-next-kasan-qemu
2017/11/03 22:31 linux-next 5a3517e009e9 e0a2b195 .config console log report syz C skylake-linux-next-kasan-qemu
2017/11/03 15:39 linux-next 5a3517e009e9 e0a2b195 .config console log report syz C skylake-linux-next-kasan-qemu
2017/11/03 15:30 mmots 0f611fb6dcc0 e0a2b195 .config console log report syz C ci-upstream-mmots-kasan-gce
2017/11/03 15:09 linux-next 5a3517e009e9 e0a2b195 .config console log report syz C skylake-linux-next-kasan-qemu
2017/11/03 14:58 mmots 0f611fb6dcc0 e0a2b195 .config console log report syz C ci-upstream-mmots-kasan-gce
2017/11/10 07:26 mmots 0f611fb6dcc0 e0a2b195 .config console log report ci-upstream-mmots-kasan-gce
2017/11/09 23:07 mmots 0f611fb6dcc0 e0a2b195 .config console log report ci-upstream-mmots-kasan-gce
2017/11/09 22:47 mmots 0f611fb6dcc0 e0a2b195 .config console log report ci-upstream-mmots-kasan-gce
2017/11/09 03:04 mmots 0f611fb6dcc0 e0a2b195 .config console log report ci-upstream-mmots-kasan-gce
2017/11/08 23:37 mmots 0f611fb6dcc0 e0a2b195 .config console log report ci-upstream-mmots-kasan-gce
2017/11/08 21:40 linux-next 5a3517e009e9 e0a2b195 .config console log report skylake-linux-next-kasan-qemu
2017/11/07 17:37 mmots 0f611fb6dcc0 e0a2b195 .config console log report ci-upstream-mmots-kasan-gce
2017/11/07 13:12 linux-next 5a3517e009e9 e0a2b195 .config console log report ci-upstream-next-kasan-gce
2017/11/07 09:52 linux-next 5a3517e009e9 e0a2b195 .config console log report ci-upstream-next-kasan-gce
2017/11/07 00:58 mmots 0f611fb6dcc0 e0a2b195 .config console log report ci-upstream-mmots-kasan-gce
2017/11/06 01:25 linux-next 5a3517e009e9 e0a2b195 .config console log report ci-upstream-next-kasan-gce
2017/11/05 14:01 linux-next 5a3517e009e9 e0a2b195 .config console log report ci-upstream-next-kasan-gce
2017/11/05 12:40 linux-next 5a3517e009e9 e0a2b195 .config console log report ci-upstream-next-kasan-gce
2017/11/05 11:37 linux-next 5a3517e009e9 e0a2b195 .config console log report ci-upstream-next-kasan-gce
2017/11/05 11:20 mmots 0f611fb6dcc0 e0a2b195 .config console log report ci-upstream-mmots-kasan-gce
2017/11/05 05:54 linux-next 5a3517e009e9 e0a2b195 .config console log report skylake-linux-next-kasan-qemu
2017/11/04 16:08 mmots 0f611fb6dcc0 e0a2b195 .config console log report ci-upstream-mmots-kasan-gce
2017/11/04 15:29 linux-next 5a3517e009e9 e0a2b195 .config console log report skylake-linux-next-kasan-qemu
2017/11/04 03:35 linux-next 5a3517e009e9 e0a2b195 .config console log report skylake-linux-next-kasan-qemu
2017/11/03 22:36 mmots 0f611fb6dcc0 e0a2b195 .config console log report ci-upstream-mmots-kasan-gce
* Struck through repros no longer work on HEAD.