From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752126AbdJ3OYr convert rfc822-to-8bit (ORCPT ); Mon, 30 Oct 2017 10:24:47 -0400 Received: from mail.fireflyinternet.com ([109.228.58.192]:49613 "EHLO fireflyinternet.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751694AbdJ3OYq (ORCPT ); Mon, 30 Oct 2017 10:24:46 -0400 X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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