syzbot


WARNING in drm_mode_createblob_ioctl

Status: fixed on 2020/01/08 01:06
Subsystems: dri
[Documentation on labels]
Reported-by: syzbot+fb77e97ebf0612ee6914@syzkaller.appspotmail.com
Fix commit: 5bf8bec3f4ce drm: limit to INT_MAX in create_blob ioctl
First crash: 1820d, last: 1796d
Cause bisection: introduced by (bisect log) :
commit 9e5a64c71b2f70ba530f8156046dd7dfb8a7a0ba
Author: Kees Cook <keescook@chromium.org>
Date: Mon Nov 4 22:57:23 2019 +0000

  uaccess: disallow > INT_MAX copy sizes

Crash: WARNING in drm_mode_createblob_ioctl (log)
Repro: C syz .config
  
Discussions (7)
Title Replies (including bot) Last reply
[PATCH 4.9 00/91] 4.9.209-stable review 97 (97) 2020/01/13 15:47
[PATCH 4.19 000/115] 4.19.94-stable review 127 (127) 2020/01/08 16:49
[PATCH 4.14 00/74] 4.14.163-stable review 82 (82) 2020/01/08 16:36
[PATCH 5.4 000/191] 5.4.8-stable review 215 (215) 2020/01/06 09:03
[patch 54/86] drm: limit to INT_MAX in create_blob ioctl 1 (1) 2019/12/05 00:52
[PATCH] drm: Limit to INT_MAX in create_blob ioctl 5 (5) 2019/11/06 18:13
WARNING in drm_mode_createblob_ioctl 7 (11) 2019/11/06 15:56

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 8842 at include/linux/thread_info.h:150 check_copy_size include/linux/thread_info.h:150 [inline]
WARNING: CPU: 0 PID: 8842 at include/linux/thread_info.h:150 copy_from_user include/linux/uaccess.h:143 [inline]
WARNING: CPU: 0 PID: 8842 at include/linux/thread_info.h:150 drm_mode_createblob_ioctl+0x398/0x490 drivers/gpu/drm/drm_property.c:800
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 8842 Comm: syz-executor938 Not tainted 5.4.0-rc6-next-20191105 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 panic+0x2e3/0x75c kernel/panic.c:221
 __warn.cold+0x2f/0x35 kernel/panic.c:582
 report_bug+0x289/0x300 lib/bug.c:195
 fixup_bug arch/x86/kernel/traps.c:174 [inline]
 fixup_bug arch/x86/kernel/traps.c:169 [inline]
 do_error_trap+0x11b/0x200 arch/x86/kernel/traps.c:267
 do_invalid_op+0x37/0x50 arch/x86/kernel/traps.c:286
 invalid_op+0x23/0x30 arch/x86/entry/entry_64.S:1027
RIP: 0010:check_copy_size include/linux/thread_info.h:150 [inline]
RIP: 0010:copy_from_user include/linux/uaccess.h:143 [inline]
RIP: 0010:drm_mode_createblob_ioctl+0x398/0x490 drivers/gpu/drm/drm_property.c:800
Code: c1 ea 03 80 3c 02 00 0f 85 ed 00 00 00 49 89 5d 00 e8 0c f2 c6 fd 4c 89 f7 e8 24 af aa 03 31 c0 e9 75 fd ff ff e8 f8 f1 c6 fd <0f> 0b e8 f1 f1 c6 fd 4d 85 e4 b8 f2 ff ff ff 0f 84 5b fd ff ff 89
RSP: 0018:ffff8880a5e07aa8 EFLAGS: 00010293
RAX: ffff88809f3a0440 RBX: ffff8880a387c000 RCX: ffffffff83ac75e2
RDX: 0000000000000000 RSI: ffffffff83ac77a8 RDI: 0000000000000007
RBP: ffff8880a5e07ae8 R08: ffff88809f3a0440 R09: ffffed101470f910
R10: ffffed101470f90f R11: ffff8880a387c87f R12: ffffc90005f5d000
R13: ffff8880a4d78000 R14: 0000000096e170d0 R15: ffffc90005f5d058
 drm_ioctl_kernel+0x244/0x300 drivers/gpu/drm/drm_ioctl.c:786
 drm_ioctl+0x54e/0xa60 drivers/gpu/drm/drm_ioctl.c:886
 vfs_ioctl fs/ioctl.c:47 [inline]
 file_ioctl fs/ioctl.c:545 [inline]
 do_vfs_ioctl+0x977/0x14e0 fs/ioctl.c:732
 ksys_ioctl+0xab/0xd0 fs/ioctl.c:749
 __do_sys_ioctl fs/ioctl.c:756 [inline]
 __se_sys_ioctl fs/ioctl.c:754 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:754
 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x449659
Code: e8 fc b8 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 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 ab d6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f6951f91db8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000006dac38 RCX: 0000000000449659
RDX: 0000000020000000 RSI: ffffffffffffffbd RDI: 0000000000000004
RBP: 00000000006dac30 R08: 00007f6951f92700 R09: 0000000000000000
R10: 00007f6951f92700 R11: 0000000000000246 R12: 00000000006dac3c
R13: 00007ffeae0e7e9f R14: 00007f6951f929c0 R15: 20c49ba5e353f7cf
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/11/06 12:29 linux-next 51309b9d73f5 bc2c6e45 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2019/11/06 11:09 linux-next 51309b9d73f5 bc2c6e45 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/10/19 09:40 linux-next c4b9850b3676 8c88c9c1 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/10/18 23:58 linux-next c4b9850b3676 8c88c9c1 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/10/18 17:02 linux-next c4b9850b3676 8c88c9c1 .config console log report ci-upstream-linux-next-kasan-gce-root
2019/10/13 06:56 linux-next 8ada228ac7ed 426631dd .config console log report ci-upstream-linux-next-kasan-gce-root
2019/10/13 06:56 linux-next 8ada228ac7ed 426631dd .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.