Received: by 10.223.185.116 with SMTP id b49csp1083573wrg; Fri, 23 Feb 2018 11:37:33 -0800 (PST) X-Google-Smtp-Source: AH8x226fYG/L8QgsXICWV4fNu6zLym5jtb0gHsNxW9zxGLxnyF1p83icVLL27uhQ7sMmpBabxE8a X-Received: by 10.98.30.67 with SMTP id e64mr2811392pfe.111.1519414653266; Fri, 23 Feb 2018 11:37:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519414653; cv=none; d=google.com; s=arc-20160816; b=qtELVfA0a/KDF4/7G2FuhWFnw9Cl0IhfnQcotB0O61qzubxhZLCih+1AEWE97IPjig YAAlGE0JQzai87sR3GrS558zuESi6HoIsoQLtYGSsQzWl16LZ6BMGZpKI20gRsEoOYiG y+nMnOVc/lBBjt7MhTUHq9kXSDm7ICIPwsVZZh4M9v0Pm4FN6B4Vcqf+2Yl7/9Ki/UJo pQvIDBZSGOzvBwambCYUF9JKE66QFBxpky2O2xzywqZXYFK0XsaV9Zb59zKIQx7JDWaN z0X3nNdaXm4AJzLEjWg5b+VDRAQdeqEhMqNAnaJhF6KD9D2snQksZHY42hUqIh3qPBQ6 25/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=MGqeJVWlTs77Zs5uQM5LOceGqw+Ip1coA5MQd0omzz0=; b=Vcgts5ltoowQoSIouzEY5ay+5+ltQpBUjByqkDzzghWekTLE0NJG9tjilQIkzk5kR5 59MKXL1sF+jin3dxkb7Regx8nertM37Dc507wbBANwV/vKRe4kJujTPi1zwlBVgL5vcG pzWCLEwXaewiaxqsr7H6H1QhFhtWQyKzE9C85iWdyI7s6OlGPq/6t+ivV2AsrUlbng1B tSwRJH9dkMTkdQNuWvsQFKsTjgr3dFhN11YtbadH2bndEDW88avnrJ9l+4+yelO3Ha3k YFcqVTrbyjr/vKgEK8EpoS1awuxqtSLq2lFbU0fwMwR3YVIsQse3qum1zWjxN6G7A4ac FW4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13si2228985pfh.78.2018.02.23.11.37.17; Fri, 23 Feb 2018 11:37:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934777AbeBWSuh (ORCPT + 99 others); Fri, 23 Feb 2018 13:50:37 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:45666 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934747AbeBWSu3 (ORCPT ); Fri, 23 Feb 2018 13:50:29 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 577BF1297; Fri, 23 Feb 2018 18:50:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+76e7efc4748495855a4d@syzkaller.appspotmail.com, syzbot , Laura Abbott Subject: [PATCH 4.14 030/159] staging: android: ion: Add __GFP_NOWARN for system contig heap Date: Fri, 23 Feb 2018 19:25:38 +0100 Message-Id: <20180223170746.899807571@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170743.086611315@linuxfoundation.org> References: <20180223170743.086611315@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Laura Abbott commit 0c75f10312a35b149b2cebb1832316b35c2337ca upstream. syzbot reported a warning from Ion: WARNING: CPU: 1 PID: 3485 at mm/page_alloc.c:3926 ... __alloc_pages_nodemask+0x9fb/0xd80 mm/page_alloc.c:4252 alloc_pages_current+0xb6/0x1e0 mm/mempolicy.c:2036 alloc_pages include/linux/gfp.h:492 [inline] ion_system_contig_heap_allocate+0x40/0x2c0 drivers/staging/android/ion/ion_system_heap.c:374 ion_buffer_create drivers/staging/android/ion/ion.c:93 [inline] ion_alloc+0x2c1/0x9e0 drivers/staging/android/ion/ion.c:420 ion_ioctl+0x26d/0x380 drivers/staging/android/ion/ion-ioctl.c:84 vfs_ioctl fs/ioctl.c:46 [inline] do_vfs_ioctl+0x1b1/0x1520 fs/ioctl.c:686 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:692 This is a warning about attempting to allocate order > MAX_ORDER. This is coming from a userspace Ion allocation request. Since userspace is free to request however much memory it wants (and the kernel is free to deny its allocation), silence the allocation attempt with __GFP_NOWARN in case it fails. Reported-by: syzbot+76e7efc4748495855a4d@syzkaller.appspotmail.com Reported-by: syzbot Signed-off-by: Laura Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/android/ion/ion_system_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -371,7 +371,7 @@ static int ion_system_contig_heap_alloca unsigned long i; int ret; - page = alloc_pages(low_order_gfp_flags, order); + page = alloc_pages(low_order_gfp_flags | __GFP_NOWARN, order); if (!page) return -ENOMEM;