From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754986AbcGEMOB (ORCPT ); Tue, 5 Jul 2016 08:14:01 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34563 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754885AbcGEMN5 (ORCPT ); Tue, 5 Jul 2016 08:13:57 -0400 MIME-Version: 1.0 From: Dmitry Vyukov Date: Tue, 5 Jul 2016 14:13:35 +0200 Message-ID: Subject: usb: memory allocation WARNING in hcd_buffer_alloc To: Greg Kroah-Hartman , Vegard Nossum , chunfeng.yun@mediatek.com, geert@linux-m68k.org, USB list , LKML Cc: syzkaller , Kostya Serebryany , Alexander Potapenko Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, The following program trigger the following WARNING: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 6263 at mm/page_alloc.c:3584[< inline >] __alloc_pages_slowpath mm/page_alloc.c:3584 WARNING: CPU: 0 PID: 6263 at mm/page_alloc.c:3584[< none >] __alloc_pages_nodemask+0x1731/0x2350 mm/page_alloc.c:3854 Modules linked in: CPU: 0 PID: 6263 Comm: a.out Not tainted 4.7.0-rc5+ #28 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 ffffffff880b58e0 ffff88006ad3f778 ffffffff82cc01af ffffffff86cf92c0 fffffbfff1016b1c 0000000000000000 0000000000000000 ffffffff86cf92c0 ffffffff816b7881 0000000000000009 ffff88006ad3f7c0 ffffffff8136d17f Call Trace: [< inline >] __dump_stack lib/dump_stack.c:15 [] dump_stack+0x12e/0x18f lib/dump_stack.c:51 [] __warn+0x19f/0x1e0 kernel/panic.c:516 [] warn_slowpath_null+0x2c/0x40 kernel/panic.c:551 [< inline >] __alloc_pages_slowpath mm/page_alloc.c:3584 [] __alloc_pages_nodemask+0x1731/0x2350 mm/page_alloc.c:3854 [< inline >] __alloc_pages include/linux/gfp.h:432 [< inline >] __alloc_pages_node include/linux/gfp.h:445 [< inline >] alloc_pages_node include/linux/gfp.h:459 [] dma_generic_alloc_coherent+0xff/0x250 arch/x86/kernel/pci-dma.c:102 [< inline >] dma_alloc_attrs include/linux/dma-mapping.h:374 [< inline >] dma_alloc_coherent include/linux/dma-mapping.h:401 [] hcd_buffer_alloc+0x1dd/0x400 drivers/usb/core/buffer.c:140 [] usb_alloc_coherent+0x60/0x80 drivers/usb/core/usb.c:740 [] usbdev_mmap+0x19a/0x650 drivers/usb/core/devio.c:244 [] mmap_region+0x87f/0xfe0 mm/mmap.c:1507 [] do_mmap+0x99d/0xbf0 mm/mmap.c:1286 [< inline >] do_mmap_pgoff include/linux/mm.h:2005 [] vm_mmap_pgoff+0x156/0x1a0 mm/util.c:302 [< inline >] SYSC_mmap_pgoff mm/mmap.c:1336 [] SyS_mmap_pgoff+0x34a/0x580 mm/mmap.c:1294 [< inline >] SYSC_mmap arch/x86/kernel/sys_x86_64.c:95 [] SyS_mmap+0x16/0x20 arch/x86/kernel/sys_x86_64.c:86 [] entry_SYSCALL_64_fastpath+0x23/0xc1 arch/x86/entry/entry_64.S:207 ---[ end trace 94402e12bc6578e5 ]--- // autogenerated by syzkaller (http://github.com/google/syzkaller) #include #include #include #include #include #include int main() { int fd = open("/dev/bus/usb/001/001", 0x800ul, 0); mmap((void*)0x201c4000ul, 0xc00000ul, 0x3ul, 0x20012ul, fd, 0x0ul); return 0; } On commit 1a0a02d1efa066001fd315c1b4df583d939fa2c4 (Jun 30).