linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: syzbot 
	<bot+8de19a03d6fdf256eb2b90ec48916b6f47b9b5a3@syzkaller.appspotmail.com>,
	airlied@linux.ie, daniel.vetter@intel.com,
	dri-devel@lists.freedesktop.org, jani.nikula@linux.intel.com,
	linux-kernel@vger.kernel.org, seanpaul@chromium.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: WARNING in drm_modeset_lock_all
Date: Mon, 30 Oct 2017 14:24:32 +0000	[thread overview]
Message-ID: <150937347278.4195.2595957266226433894@mail.alporthouse.com> (raw)
In-Reply-To: <001a114c9224215c93055c82d03e@google.com>

Quoting syzbot (2017-10-27 09:09:50)
> 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

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

       reply	other threads:[~2017-10-30 14:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <001a114c9224215c93055c82d03e@google.com>
2017-10-30 14:24 ` Chris Wilson [this message]
2017-10-31 10:22   ` WARNING in drm_modeset_lock_all Daniel Vetter
2017-10-31 12:45 ` Chris Wilson
2017-10-31 13:03   ` Dmitry Vyukov
2018-02-12 16:10     ` Dmitry Vyukov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150937347278.4195.2595957266226433894@mail.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=airlied@linux.ie \
    --cc=bot+8de19a03d6fdf256eb2b90ec48916b6f47b9b5a3@syzkaller.appspotmail.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanpaul@chromium.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).