WARNING in drm_modeset_lock_all

32 views
Skip to first unread message

syzbot

unread,
Oct 27, 2017, 4:09:52 AM10/27/17
to air...@linux.ie, daniel...@intel.com, dri-...@lists.freedesktop.org, jani....@linux.intel.com, linux-...@vger.kernel.org, sean...@chromium.org, syzkall...@googlegroups.com
Hello,

syzkaller hit the following crash on
6f20b7a58cb9c0fe00badcdfd65b1f4a8f28dfc6
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master
compiler: gcc (GCC) 7.1.1 20170620
.config is attached
Raw console output is attached.




------------[ cut here ]------------
WARNING: CPU: 2 PID: 11675 at drivers/gpu/drm/drm_modeset_lock.c:92
drm_modeset_lock_all+0x1fc/0x2d0 drivers/gpu/drm/drm_modeset_lock.c:92
Kernel panic - not syncing: panic_on_warn set ...

Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:16 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:52
fail_dump lib/fault-inject.c:51 [inline]
should_fail+0x8c0/0xa40 lib/fault-inject.c:149
should_failslab+0xec/0x120 mm/failslab.c:31
slab_pre_alloc_hook mm/slab.h:422 [inline]
slab_alloc mm/slab.c:3383 [inline]
kmem_cache_alloc_trace+0x4b/0x750 mm/slab.c:3625
kmalloc include/linux/slab.h:493 [inline]
kzalloc include/linux/slab.h:666 [inline]
drm_modeset_lock_all+0x49/0x2d0 drivers/gpu/drm/drm_modeset_lock.c:91
drm_mode_obj_get_properties_ioctl+0x87/0x2b0
drivers/gpu/drm/drm_mode_object.c:359
drm_ioctl_kernel+0x1e7/0x2e0 drivers/gpu/drm/drm_ioctl.c:735
drm_ioctl+0x72e/0xa50 drivers/gpu/drm/drm_ioctl.c:831
vfs_ioctl fs/ioctl.c:45 [inline]
do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685
SYSC_ioctl fs/ioctl.c:700 [inline]
SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x447299
RSP: 002b:00007f4bb582bc08 EFLAGS: 00000296 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000447299
RDX: 0000000020672ff7 RSI: 00000000000000b9 RDI: 0000000000000005
RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000296 R12: 00000000004a8bf7
R13: 0000000000000000 R14: 00007f4bb582b9c8 R15: 00007f4bb582bb38
CPU: 2 PID: 11675 Comm: syz-executor0 Not tainted 4.13.0-next-20170913+ #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 11677 at drivers/gpu/drm/drm_modeset_lock.c:92
drm_modeset_lock_all+0x1fc/0x2d0 drivers/gpu/drm/drm_modeset_lock.c:92
Modules linked in:
CPU: 0 PID: 11677 Comm: syz-executor6 Not tainted 4.13.0-next-20170913+ #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
task: ffff8800516060c0 task.stack: ffff88006cc78000
RIP: 0010:drm_modeset_lock_all+0x1fc/0x2d0
drivers/gpu/drm/drm_modeset_lock.c:92
RSP: 0018:ffff88006cc7fad8 EFLAGS: 00010246
RAX: 0000000000010000 RBX: ffff88006cc7fcb0 RCX: ffffc90003895000
RDX: 0000000000010000 RSI: ffffffff828b9e0c RDI: 0000000000000282
RBP: ffff88006cc7faf0 R08: ffffffff85b381a0 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88006b006540 R14: ffff8800391bcdc0 R15: ffff88006cc7fbc8
FS: 00007f4bb582c700(0000) GS:ffff88003ec00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004c6e84 CR3: 000000004d350000 CR4: 00000000000006f0
DR0: 0000000020000000 DR1: 0000000020000000 DR2: 0000000020000008
DR3: 0000000020001010 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Call Trace:
drm_mode_obj_get_properties_ioctl+0x87/0x2b0
drivers/gpu/drm/drm_mode_object.c:359
drm_ioctl_kernel+0x1e7/0x2e0 drivers/gpu/drm/drm_ioctl.c:735
drm_ioctl+0x72e/0xa50 drivers/gpu/drm/drm_ioctl.c:831
vfs_ioctl fs/ioctl.c:45 [inline]
do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685
SYSC_ioctl fs/ioctl.c:700 [inline]
SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x447299
RSP: 002b:00007f4bb582bc08 EFLAGS: 00000296 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000447299
RDX: 0000000020672ff7 RSI: 00000000000000b9 RDI: 0000000000000005
RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000296 R12: 00000000004a8bf7
R13: 0000000000000000 R14: 00007f4bb582b9c8 R15: 00007f4bb582bb38
Code: cc 00 00 00 41 8b 4c 24 10 85 c9 75 38 e8 0d 2b e2 fe 4c 89 e7 e8 95
c1 16 ff e8 00 2b e2 fe 5b 41 5c 41 5d 5d c3 e8 f4 2a e2 fe <0f> ff e8 ed
2a e2 fe 5b 41 5c 41 5d 5d c3 e8 e1 2a e2 fe 0f ff
---[ end trace 7fc27166e88a4a81 ]---
------------[ cut here ]------------
WARNING: CPU: 1 PID: 11677 at drivers/gpu/drm/drm_modeset_lock.c:143
drm_modeset_unlock_all+0x108/0x1b0 drivers/gpu/drm/drm_modeset_lock.c:143
Modules linked in:
CPU: 1 PID: 11677 Comm: syz-executor6 Tainted: G W
4.13.0-next-20170913+ #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
task: ffff8800516060c0 task.stack: ffff88006cc78000
RIP: 0010:drm_modeset_unlock_all+0x108/0x1b0
drivers/gpu/drm/drm_modeset_lock.c:143
RSP: 0018:ffff88006cc7fae0 EFLAGS: 00010246
RAX: 0000000000010000 RBX: ffff88006b006540 RCX: ffffc90003895000
RDX: 0000000000010000 RSI: ffffffff828b8da8 RDI: ffff88006b006b28
RBP: ffff88006cc7faf0 R08: ffff88006b006b98 R09: 0000000000000000
R10: ffffffff870a8ea0 R11: 0000000000000001 R12: 0000000000000000
R13: 0000000000000000 R14: ffff8800391bcdc0 R15: 00000000fffffffe
FS: 00007f4bb582c700(0000) GS:ffff88003ed00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c438177000 CR3: 000000004d350000 CR4: 00000000000006e0
DR0: 0000000020000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Call Trace:
drm_mode_obj_get_properties_ioctl+0x1f5/0x2b0
drivers/gpu/drm/drm_mode_object.c:379
drm_ioctl_kernel+0x1e7/0x2e0 drivers/gpu/drm/drm_ioctl.c:735
drm_ioctl+0x72e/0xa50 drivers/gpu/drm/drm_ioctl.c:831
vfs_ioctl fs/ioctl.c:45 [inline]
do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685
SYSC_ioctl fs/ioctl.c:700 [inline]
SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x447299
RSP: 002b:00007f4bb582bc08 EFLAGS: 00000296 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000447299
RDX: 0000000020672ff7 RSI: 00000000000000b9 RDI: 0000000000000005
RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000296 R12: 00000000004a8bf7
R13: 0000000000000000 R14: 00007f4bb582b9c8 R15: 00007f4bb582bb38
Code: d2 75 34 e8 7b 3b e2 fe 4c 89 e7 e8 03 d2 16 ff 48 8d bb a8 04 00 00
e8 e7 c7 47 02 e8 62 3b e2 fe 5b 41 5c 5d c3 e8 58 3b e2 fe <0f> ff e8 51
3b e2 fe 5b 41 5c 5d c3 e8 47 3b e2 fe e8 62 fb ae
---[ end trace 7fc27166e88a4a82 ]---
__dump_stack lib/dump_stack.c:16 [inline]
dump_stack+0x194/0x257 lib/dump_stack.c:52
panic+0x1e4/0x417 kernel/panic.c:181
__warn+0x1c4/0x1d9 kernel/panic.c:542
report_bug+0x211/0x2d0 lib/bug.c:183
fixup_bug+0x40/0x90 arch/x86/kernel/traps.c:178
do_trap_no_signal arch/x86/kernel/traps.c:212 [inline]
do_trap+0x260/0x390 arch/x86/kernel/traps.c:261
do_error_trap+0x120/0x390 arch/x86/kernel/traps.c:298
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:311
invalid_op+0x18/0x20 arch/x86/entry/entry_64.S:905
RIP: 0010:drm_modeset_lock_all+0x1fc/0x2d0
drivers/gpu/drm/drm_modeset_lock.c:92
RSP: 0018:ffff88002c5d7ad8 EFLAGS: 00010246
RAX: 0000000000010000 RBX: ffff88002c5d7cb0 RCX: ffffc90000813000
RDX: 0000000000010000 RSI: ffffffff828b9e0c RDI: 0000000000000282
RBP: ffff88002c5d7af0 R08: ffffffff85b381a0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88006b006540 R14: ffff88006d388dc0 R15: ffff88002c5d7bc8
drm_mode_obj_get_properties_ioctl+0x87/0x2b0
drivers/gpu/drm/drm_mode_object.c:359
drm_ioctl_kernel+0x1e7/0x2e0 drivers/gpu/drm/drm_ioctl.c:735
drm_ioctl+0x72e/0xa50 drivers/gpu/drm/drm_ioctl.c:831
vfs_ioctl fs/ioctl.c:45 [inline]
do_vfs_ioctl+0x1b1/0x1530 fs/ioctl.c:685
SYSC_ioctl fs/ioctl.c:700 [inline]
SyS_ioctl+0x8f/0xc0 fs/ioctl.c:691
entry_SYSCALL_64_fastpath+0x1f/0xbe
RIP: 0033:0x447299
RSP: 002b:00007f8434b9fc08 EFLAGS: 00000296 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000447299
RDX: 0000000020672ff7 RSI: 00000000000000b9 RDI: 0000000000000005
RBP: 0000000000000082 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000296 R12: 00000000004a8bf7
R13: 0000000000000000 R14: 00007f8434b9f9c8 R15: 00007f8434b9fb38
Dumping ftrace buffer:
(ftrace buffer empty)
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.

syzbot will keep track of this bug report.
Once a fix for this bug is committed, please reply to this email with:
#syz fix: exact-commit-title
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
config.txt
raw.log

Chris Wilson

unread,
Oct 30, 2017, 10:24:39 AM10/30/17
to syzbot, air...@linux.ie, daniel...@intel.com, dri-...@lists.freedesktop.org, jani....@linux.intel.com, linux-...@vger.kernel.org, sean...@chromium.org, syzkall...@googlegroups.com
Quoting syzbot (2017-10-27 09:09:50)
This bug is for the unexpected allocation failure inside
drm_modeset_lock_all() (in this case from should_fail). To properly
document this behaviour, we should probably use

diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c
index e123497da0ca..963e23db0fe7 100644
--- a/drivers/gpu/drm/drm_modeset_lock.c
+++ b/drivers/gpu/drm/drm_modeset_lock.c
@@ -93,7 +93,7 @@ void drm_modeset_lock_all(struct drm_device *dev)
struct drm_modeset_acquire_ctx *ctx;
int ret;

- ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL | __GFP_NOFAIL);
if (WARN_ON(!ctx))
return;

Then it will turn up on somebody'ss too-small-to-fail fix list.
-Chris

Daniel Vetter

unread,
Oct 31, 2017, 6:22:40 AM10/31/17
to Chris Wilson, syzbot, air...@linux.ie, daniel...@intel.com, dri-...@lists.freedesktop.org, jani....@linux.intel.com, linux-...@vger.kernel.org, sean...@chromium.org, syzkall...@googlegroups.com
lgtm. Can you pls submit this as a patch withs sob and everything?

Thanks, Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Chris Wilson

unread,
Oct 31, 2017, 8:45:51 AM10/31/17
to syzbot, air...@linux.ie, daniel...@intel.com, dri-...@lists.freedesktop.org, jani....@linux.intel.com, linux-...@vger.kernel.org, sean...@chromium.org, syzkall...@googlegroups.com
Quoting syzbot (2017-10-27 09:09:50)
> This bug is generated by a dumb bot. It may contain errors.
> See https://goo.gl/tpsmEJ for details.
> Direct all questions to syzk...@googlegroups.com.
>
> syzbot will keep track of this bug report.
> Once a fix for this bug is committed, please reply to this email with:
> #syz fix: exact-commit-title
> To mark this as a duplicate of another syzbot report, please reply with:
> #syz dup: exact-subject-of-another-report
> If it's a one-off invalid bug report, please reply with:
> #syz invalid
> Note: if the crash happens again, it will cause creation of a new bug
> report.

Can we use

Reported-by: syzbot <bot+8de19a03d6fdf256eb...@syzkaller.appspotmail.com>

as a unique tag for tracking purposes?
-Chris

Dmitry Vyukov

unread,
Oct 31, 2017, 9:04:31 AM10/31/17
to Chris Wilson, syzbot, David Airlie, daniel...@intel.com, dri-...@lists.freedesktop.org, jani....@linux.intel.com, LKML, Sean Paul, syzkall...@googlegroups.com
Hi,

Seems to be a common question. I've added the following to bug template:

Please credit me with: Reported-by: syzbot <syzk...@googlegroups.com>

will now be present on newly reported bugs:

https://groups.google.com/forum/#!topic/syzkaller-bugs/XE8YSiSZDdA






> -Chris
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bug...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/150945394709.15081.7550043352916368752%40mail.alporthouse.com.
> For more options, visit https://groups.google.com/d/optout.

Dmitry Vyukov

unread,
Feb 12, 2018, 11:10:56 AM2/12/18
to Chris Wilson, syzbot, daniel...@intel.com, dri-...@lists.freedesktop.org, jani....@linux.intel.com, LKML, Sean Paul, syzkall...@googlegroups.com
On Tue, Oct 31, 2017 at 2:03 PM, Dmitry Vyukov <dvy...@google.com> wrote:
> On Tue, Oct 31, 2017 at 3:45 PM, Chris Wilson <ch...@chris-wilson.co.uk> wrote:
>> Quoting syzbot (2017-10-27 09:09:50)
>>> This bug is generated by a dumb bot. It may contain errors.
>>> See https://goo.gl/tpsmEJ for details.
>>> Direct all questions to syzk...@googlegroups.com.
>>>
>>> syzbot will keep track of this bug report.
>>> Once a fix for this bug is committed, please reply to this email with:
>>> #syz fix: exact-commit-title
>>> To mark this as a duplicate of another syzbot report, please reply with:
>>> #syz dup: exact-subject-of-another-report
>>> If it's a one-off invalid bug report, please reply with:
>>> #syz invalid
>>> Note: if the crash happens again, it will cause creation of a new bug
>>> report.
>>
>> Can we use
>>
>> Reported-by: syzbot <bot+8de19a03d6fdf256eb...@syzkaller.appspotmail.com>
>>
>> as a unique tag for tracking purposes?
>
>
> Hi,
>
> Seems to be a common question. I've added the following to bug template:
>
> Please credit me with: Reported-by: syzbot <syzk...@googlegroups.com>
>
> will now be present on newly reported bugs:
>
> https://groups.google.com/forum/#!topic/syzkaller-bugs/XE8YSiSZDdA


This was fixed by:
#syz fix: drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all


Now we indeed can use:
Reported-by: syzbot
<bot+8de19a03d6fdf256eb...@syzkaller.appspotmail.com>
which avoids the need to go back and manually attach fixing commit to
the report like this.
Reply all
Reply to author
Forward
0 new messages