Received: by 10.223.185.116 with SMTP id b49csp1026412wrg; Fri, 23 Feb 2018 10:34:00 -0800 (PST) X-Google-Smtp-Source: AH8x227d8bnvtuW3/zlXG3L8Y/SIj/hUiclY3bwWQiPct4dJcdRDPEBeNmM0GImpa304bJt1zpJc X-Received: by 2002:a17:902:4545:: with SMTP id m63-v6mr2475652pld.15.1519410840710; Fri, 23 Feb 2018 10:34:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519410840; cv=none; d=google.com; s=arc-20160816; b=ToFmKVZz6bAwIx2jONBBfjEPK8X19gyoxHVHjwKBvDQUT8lMhM3xZ2y/IBP9uE3nlS 80FrNvKBPTMbBfuuJRRnJAk+Ps6L6tt3F4vIVQ9z8nIZa0ckpMarvS9sVcjmO7KX9mzI BggPIJc6Zvyr/X3O8zc3dtfI4T3TvV+VV65RKkqdlygXd7HdrUPpfJUfgZi9cZ5FTJ9d cmJQapYrFN1t6TvTf0evU6+aiW7NYjh8kqbqmAPobkA0Alj1NsYVa61dMKCo1tJNBBtq qpNtgZEJIkbAzAaz8qPXSjvs0CFeYfw2byvGsVN2J5ShwyDKN5Y/oCYX1N8DAjaynWCD GB6Q== 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=w9Fxtu/rZidrOtpgnVkUPBmFCCoPmmVJOeY3udARYeA=; b=Gedp+zY5KbZNd5oM/C6dNUS8nzoPPL1uVp/5VziMoPnbmz6Ntk1C5yJKRbAA5WlX10 Zo0/Wvt1VCVGont7ynw7HGpqa8/iXuF5bSNc2g5UrPWc8B93Q2hRV02YGuGmlrKyHux9 Yss1wubg4SNaxCfMHVbG2em+CMMmoYyBZAioTbGyAk4FHK3LLoxfTYWDaJ/lRVVoQrSl TeVkTlNX0fTzCGVtInt6rU9OuO9zFqknyCoW3dLyTynbzR5l4h2CEz4e4fdGgdkAoame Mx2+fpyE2/0VQL9noeHLx5ZYY+pxtGX+/4BDouJtZ5ayYCpxl6QuJa09GMhG1or7KpYN g/WQ== 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 r59-v6si2141372plb.470.2018.02.23.10.33.46; Fri, 23 Feb 2018 10:34:00 -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 S1753093AbeBWSdE (ORCPT + 99 others); Fri, 23 Feb 2018 13:33:04 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:36394 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753027AbeBWSdC (ORCPT ); Fri, 23 Feb 2018 13:33:02 -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 436B61070; Fri, 23 Feb 2018 18:33:01 +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.4 013/193] staging: android: ion: Add __GFP_NOWARN for system contig heap Date: Fri, 23 Feb 2018 19:24:06 +0100 Message-Id: <20180223170328.219713270@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@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.4-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 @@ -336,7 +336,7 @@ static int ion_system_contig_heap_alloca if (align > (PAGE_SIZE << order)) return -EINVAL; - page = alloc_pages(low_order_gfp_flags, order); + page = alloc_pages(low_order_gfp_flags | __GFP_NOWARN, order); if (!page) return -ENOMEM;