From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934221AbcAZLoS (ORCPT ); Tue, 26 Jan 2016 06:44:18 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:34518 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932668AbcAZLoP (ORCPT ); Tue, 26 Jan 2016 06:44:15 -0500 Date: Tue, 26 Jan 2016 12:44:22 +0100 From: Daniel Vetter To: Dmitry Vyukov Cc: Benjamin Herrenschmidt , Tiago Vignatti , Dave Airlie , Jesse Barnes , dri-devel@lists.freedesktop.org, LKML , Kostya Serebryany , syzkaller , Alexander Potapenko , Sasha Levin Subject: Re: gpu: kmalloc size WARNING in vga_arb_write Message-ID: <20160126114422.GA11240@phenom.ffwll.local> Mail-Followup-To: Dmitry Vyukov , Benjamin Herrenschmidt , Tiago Vignatti , Dave Airlie , Jesse Barnes , dri-devel@lists.freedesktop.org, LKML , Kostya Serebryany , syzkaller , Alexander Potapenko , Sasha Levin References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 4.3.0-1-amd64 User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 26, 2016 at 11:26:29AM +0100, Dmitry Vyukov wrote: > Hello, > > I've hit the following warning while running syzkaller fuzzer: > > ------------[ cut here ]------------ > WARNING: CPU: 2 PID: 29322 at mm/page_alloc.c:2999 > __alloc_pages_nodemask+0x7d2/0x1760() > Modules linked in: > CPU: 2 PID: 29322 Comm: syz-executor Tainted: G B 4.5.0-rc1+ #283 > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 > 00000000ffffffff ffff880069eff670 ffffffff8299a06d 0000000000000000 > ffff8800658a4740 ffffffff864985a0 ffff880069eff6b0 ffffffff8134fcf9 > ffffffff8166de32 ffffffff864985a0 0000000000000bb7 00000000024040c0 > Call Trace: > [< inline >] __dump_stack lib/dump_stack.c:15 > [] dump_stack+0x6f/0xa2 lib/dump_stack.c:50 > [] warn_slowpath_common+0xd9/0x140 kernel/panic.c:482 > [] warn_slowpath_null+0x29/0x30 kernel/panic.c:515 > [< inline >] __alloc_pages_slowpath mm/page_alloc.c:2999 > [] __alloc_pages_nodemask+0x7d2/0x1760 mm/page_alloc.c:3253 > [] alloc_pages_current+0xe9/0x450 mm/mempolicy.c:2090 > [< inline >] alloc_pages include/linux/gfp.h:459 > [] alloc_kmem_pages+0x16/0x100 mm/page_alloc.c:3433 > [] kmalloc_order+0x1f/0x80 mm/slab_common.c:1008 > [] kmalloc_order_trace+0x1f/0x140 mm/slab_common.c:1019 > [< inline >] kmalloc_large include/linux/slab.h:395 > [] __kmalloc+0x2f4/0x340 mm/slub.c:3557 > [< inline >] kmalloc include/linux/slab.h:468 > [] vga_arb_write+0xd4/0xe40 drivers/gpu/vga/vgaarb.c:926 > [] do_loop_readv_writev+0x141/0x1e0 fs/read_write.c:719 > [] do_readv_writev+0x5f8/0x6e0 fs/read_write.c:849 > [] vfs_writev+0x86/0xc0 fs/read_write.c:886 > [< inline >] SYSC_writev fs/read_write.c:919 > [] SyS_writev+0x111/0x2b0 fs/read_write.c:911 > [] entry_SYSCALL_64_fastpath+0x16/0x7a > arch/x86/entry/entry_64.S:185 > ---[ end trace d543527022b589ec ]--- > > > vga_arb_write does: > > kbuf = kmalloc(count + 1, GFP_KERNEL); > > The kmalloc should use GFP_USER|__GFP_NOWARN flags since the size is > user-controlled. > > On commit 92e963f50fc74041b5e9e744c330dca48e04f08d. Care to create a patch for this and submit it please? You've done all the debug work, might as well take credit ;-) Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch