syzbot


general protection fault in load_elf_binary

Status: fixed on 2019/06/14 18:22
Subsystems: fs mm
[Documentation on labels]
Reported-by: syzbot+0d1fcd7268b21baced4a@syzkaller.appspotmail.com
Fix commit: cc338010a233 fs/binfmt_elf.c: free PT_INTERP filename ASAP
First crash: 1855d, last: 1851d
Cause bisection: introduced by (bisect log) :
commit 44e63c4a026325d2e085e46502121ea533a6e315
Author: Alexey Dobriyan <adobriyan@gmail.com>
Date: Thu Mar 28 23:02:05 2019 +0000

  fs/binfmt_elf.c: free PT_INTERP filename ASAP

Crash: general protection fault in load_elf_binary (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH] fs/binfmt_elf.c: fix GPF when dereferencing invalid interpreter 2 (2) 2019/03/30 16:16
[PATCH -mm] elf: fixup error path in PT_INTERP case 1 (1) 2019/03/30 11:19
general protection fault in load_elf_binary 0 (2) 2019/03/29 21:48

Sample crash report:
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 7363 Comm: syz-executor788 Not tainted 5.1.0-rc2-next-20190329 #14
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:allow_write_access include/linux/fs.h:2871 [inline]
RIP: 0010:load_elf_binary+0x167c/0x5b10 fs/binfmt_elf.c:1179
Code: b8 fe ff ff e8 65 8c db ff e8 70 23 a3 ff 48 8b 85 f8 fe ff ff 48 8d 78 20 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 b2 3e 00 00 4c 8b bd f8 fe ff ff be 04 00 00 00
RSP: 0018:ffff8880a4457bf8 EFLAGS: 00010207
RAX: dffffc0000000000 RBX: 00000000fffffffe RCX: 1ffffffff12be8fb
RDX: 0000000000000003 RSI: ffffffff81cd3e10 RDI: 000000000000001e
RBP: ffff8880a4457d78 R08: ffff888090bfe100 R09: fffffbfff11a6d55
R10: fffffbfff11a6d54 R11: ffffffff88d36aa3 R12: 0000000000000000
R13: ffff8880860c2580 R14: ffff8880a8390780 R15: ffff8880a837a440
FS:  000000000120f880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001140 CR3: 00000000a5ec4000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 search_binary_handler fs/exec.c:1656 [inline]
 search_binary_handler+0x17f/0x570 fs/exec.c:1634
 exec_binprm fs/exec.c:1698 [inline]
 __do_execve_file.isra.0+0x1394/0x23f0 fs/exec.c:1818
 do_execveat_common fs/exec.c:1865 [inline]
 do_execve fs/exec.c:1882 [inline]
 __do_sys_execve fs/exec.c:1958 [inline]
 __se_sys_execve fs/exec.c:1953 [inline]
 __x64_sys_execve+0x8f/0xc0 fs/exec.c:1953
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440259
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:00007ffc1fa317c8 EFLAGS: 00000246 ORIG_RAX: 000000000000003b
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440259
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000180
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000246 R12: 0000000000401ae0
R13: 0000000000401b70 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace fae0496b26d8030e ]---
RIP: 0010:allow_write_access include/linux/fs.h:2871 [inline]
RIP: 0010:load_elf_binary+0x167c/0x5b10 fs/binfmt_elf.c:1179
Code: b8 fe ff ff e8 65 8c db ff e8 70 23 a3 ff 48 8b 85 f8 fe ff ff 48 8d 78 20 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 b2 3e 00 00 4c 8b bd f8 fe ff ff be 04 00 00 00
RSP: 0018:ffff8880a4457bf8 EFLAGS: 00010207
RAX: dffffc0000000000 RBX: 00000000fffffffe RCX: 1ffffffff12be8fb
RDX: 0000000000000003 RSI: ffffffff81cd3e10 RDI: 000000000000001e
RBP: ffff8880a4457d78 R08: ffff888090bfe100 R09: fffffbfff11a6d55
R10: fffffbfff11a6d54 R11: ffffffff88d36aa3 R12: 0000000000000000
R13: ffff8880860c2580 R14: ffff8880a8390780 R15: ffff8880a837a440
FS:  000000000120f880(0000) GS:ffff8880ae900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001140 CR3: 00000000a5ec4000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/03/29 15:55 linux-next 1baf02ec984b 98c1bf1c .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2019/03/29 15:35 linux-next 1baf02ec984b 98c1bf1c .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2019/04/03 01:18 linux-next 05d08e2995cb dfd3394d .config console log report ci-upstream-linux-next-kasan-gce-root
2019/04/02 14:18 linux-next 05d08e2995cb dfd3394d .config console log report ci-upstream-linux-next-kasan-gce-root
2019/04/02 13:30 linux-next 05d08e2995cb dfd3394d .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/30 03:49 linux-next 1baf02ec984b c35ee0ea .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/30 03:05 linux-next 1baf02ec984b c35ee0ea .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/30 02:44 linux-next 1baf02ec984b c35ee0ea .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/30 02:41 linux-next 1baf02ec984b c35ee0ea .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/30 01:38 linux-next 1baf02ec984b c35ee0ea .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/30 01:21 linux-next 1baf02ec984b c35ee0ea .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/29 20:58 linux-next 1baf02ec984b 98c1bf1c .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/29 09:59 linux-next 1baf02ec984b 98c1bf1c .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/29 08:10 linux-next 1baf02ec984b 98c1bf1c .config console log report ci-upstream-linux-next-kasan-gce-root
2019/03/29 07:40 linux-next 1baf02ec984b 14c58f8d .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.