Received: by 10.223.185.116 with SMTP id b49csp1113029wrg; Fri, 23 Feb 2018 12:09:08 -0800 (PST) X-Google-Smtp-Source: AH8x227Lf+IoOsPXVCvNzsIIB2jKcmKzE3sR5ObTfcxUmCiDPJxhCce1O4IgGnehrBl9lFaMwf3h X-Received: by 10.99.120.201 with SMTP id t192mr2296315pgc.39.1519416548539; Fri, 23 Feb 2018 12:09:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519416548; cv=none; d=google.com; s=arc-20160816; b=unoudUsOA39HPAYPF0lrTt32UP+/QiugTw2rLXWz7Cc16yCrgrSz4DSpvoP+44jeCC et1ioNeTbarYsy/X1H0lUhQ0TGjcngmLYzLjNCnXFe0yk9clryjsZZsRsJSFB0w7Dy3v BlifUCtNNP9h5Lo6A1suQzGnmdS/Q55gZ30MIBHJyuzNolsKon6gos+ztYeX+dH/abol mVmpVPUauBzZmZ7QwmKpTuqJf6EuQv9hKdGJMF9+ZdhJOh0Z7Sb5z8L0ifh5Tw0LfZyS X1jHLH/dxmkLtw96kl0vfxZ/wecrWYqfLNrOFJP7LWKf+sYEj2RlnF28hkP098dwT8rU kq4A== 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=1CGI4zF7nqJA46tN7tJOFl82JeQ1WrvwRalLxKQ3EIM=; b=DzPz7jUgtIw7TZRqB8z8zuI+JPbPrYYPgyNiqPPW7gf37GvTCjf8wtyezwrluS+B5W u+NizPWMa9eGmA92PuGqFv7VgJYAG9qukJVAr2IzGp/TP4dvP0GXb5pnz7dh7vqQ8h/7 ghGJiFZydE7bLKZYL4FBSSCJtyA6gYjpLnictbHqB2bftgrWOq1TpdY4zp1W6aNTQFIb 1moGJG98Sl9/0vVTgVYY5EPmGdeHQmyklqSaeiu6TvrKrrpE61BQThpC/COLf/c/1hbi yBDjqyI54HvolDukxOmUhholJDlTWa95kacCRK18FqYelDW8tNEq9AbdJ2nJ3dCfuhwY 8Rvg== 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 y2si1889726pgr.167.2018.02.23.12.08.54; Fri, 23 Feb 2018 12:09:08 -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 S1755175AbeBWUIG (ORCPT + 99 others); Fri, 23 Feb 2018 15:08:06 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41878 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933067AbeBWSmk (ORCPT ); Fri, 23 Feb 2018 13:42:40 -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 5DE57FC7; Fri, 23 Feb 2018 18:42:39 +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.9 017/145] staging: android: ion: Add __GFP_NOWARN for system contig heap Date: Fri, 23 Feb 2018 19:25:23 +0100 Message-Id: <20180223170726.880387651@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170724.669759283@linuxfoundation.org> References: <20180223170724.669759283@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.9-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 @@ -384,7 +384,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;