Received: by 10.223.185.116 with SMTP id b49csp1056990wrg; Fri, 23 Feb 2018 11:07:18 -0800 (PST) X-Google-Smtp-Source: AH8x227evQ+yW+qQnViPVJflDFMZi+pRc9EFISgI7HIAUzpSEnN0SiNy8oovWn5Okw3CCB9ZREYk X-Received: by 10.99.175.87 with SMTP id s23mr2088292pgo.328.1519412838356; Fri, 23 Feb 2018 11:07:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519412838; cv=none; d=google.com; s=arc-20160816; b=u/WOBYVyhIzaTMm9inEF9DY36PC74vrCAqjwJsGNh9N2zAMhwYSysL7qFgABXDb/y1 OyvJPJK2KCwuxwEye2gBEb72Vd/W+Q9bGNOzvFcx56jED6g5SU94xPSbZHuZOf+w7yTt XuTlROlUF8pQd6IjbEWsr2KUBVvCiwbJ2XUkGBtLU6+KhdLpsvZekz7bhV2DUNg9iiQG AtU9BuothEAnmvwPP61Ul32C1xW+/6ILNS3KMXrCxp/xrHObnqUIuNQZz/LnjWTu1PG4 v7NDuZ1E5NTiKXRqcskOLb21j5Y5kjD2paeBT5rmtO3sGbz+iBXe2Yo8f+wEZ/sjLQ50 nlrw== 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=vCg2FwEmIJDv6VxTIXPJfFqPzmgJIXZBsOUyXfWuYFo=; b=KO8wdglGRzhsWNr770a4tmlURRFU5jI5+F5aggIPG3yohCQ3OYDCIAjWX2PsQI08s3 bOoQtC3MpDdZ8hGWXoXjqlPQisAe2V4heNt9tCEwZ20AOTsOG9ys1wVqUcEVqgGHgCHj 1hD5x7yCBZE9SpXn1Pf6tZdUfU4+l3Vy8yti9xE+AViFhsjffabIRH1DN3mkMOpNbTfO wNDazmYONhLYzkq0mDPjMJraj+b302hGROfVNxCI7J/uUxczjzLyLLCioAEJEybnB8pI tc2DRDK3Q0qkgHF6d2n9x6C3BDgMOiFwjJVW4y9D+tCwdmfcxnD05uA5tTVAJrRutHa8 vrtQ== 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 l85si1093548pfg.104.2018.02.23.11.07.04; Fri, 23 Feb 2018 11:07:18 -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 S935758AbeBWTEo (ORCPT + 99 others); Fri, 23 Feb 2018 14:04:44 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50464 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965538AbeBWS6M (ORCPT ); Fri, 23 Feb 2018 13:58:12 -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 203E810ED; Fri, 23 Feb 2018 18:58:11 +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.15 08/45] staging: android: ion: Add __GFP_NOWARN for system contig heap Date: Fri, 23 Feb 2018 19:28:47 +0100 Message-Id: <20180223170716.609721878@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170715.197760019@linuxfoundation.org> References: <20180223170715.197760019@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.15-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;