From patchwork Mon Oct 30 14:24:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 10032711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E8D406039A for ; Mon, 30 Oct 2017 14:25:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA27428900 for ; Mon, 30 Oct 2017 14:25:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEBE128905; Mon, 30 Oct 2017 14:25:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, SORTED_RECIPS autolearn=no version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6B42128900 for ; Mon, 30 Oct 2017 14:25:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 669686E0A5; Mon, 30 Oct 2017 14:25:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id 911DF6E0A5 for ; Mon, 30 Oct 2017 14:25:35 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from localhost (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP (TLS) id 9384011-1500050 for multiple; Mon, 30 Oct 2017 14:24:34 +0000 MIME-Version: 1.0 From: Chris Wilson User-Agent: alot/0.3.6 To: syzbot , 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 References: <001a114c9224215c93055c82d03e@google.com> In-Reply-To: <001a114c9224215c93055c82d03e@google.com> Message-ID: <150937347278.4195.2595957266226433894@mail.alporthouse.com> Subject: Re: WARNING in drm_modeset_lock_all Date: Mon, 30 Oct 2017 14:24:32 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Then it will turn up on somebody'ss too-small-to-fail fix list. -Chris 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;