Received: by 10.223.185.116 with SMTP id b49csp737350wrg; Wed, 14 Feb 2018 06:18:37 -0800 (PST) X-Google-Smtp-Source: AH8x226xlp9uTSWYNeOxUJp6IW2Rn4s/VockyvhzZs8jRBJ7tSl4VpnOfkXXzdWW4Sv8ufNtD1jj X-Received: by 2002:a17:902:b942:: with SMTP id h2-v6mr302735pls.45.1518617917183; Wed, 14 Feb 2018 06:18:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518617917; cv=none; d=google.com; s=arc-20160816; b=VPSCAIKDsquk9rQsG3uQKS3iAKRfIQFxbQgzZuNFzqc7UZdrGsQUpH4OuXqvzbScC1 xkmLE3ECWIhbGpiisYPC5wZ6NeCnRZn/EO4ah1rg3hWDWvt2OBFX9CYfE9BAzL6J4z+d t7LzxKA98ppSHnx/s8BOap1NMEYDwdBsPkYZjNv5ip9uvZK/D5bPQ7UtSDefQW2vDJQT RYtwzo9g/WvQwIiiFoCXqZLLMoOf6SpA8TqbsTcQoTQzvkIILmpYmAkww8mYtYACnSfa QfPrtOpuwCv4lUsdyWHDNGZBKJWfqTg7jmj/X+bWG4AuPwlDWfQqMnmWUzceEzhM/2u/ 3aZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+vzOUZ20YciQjwWCQPOwEqGMXkEqeXXqGD7bYkM6lMw=; b=MY3ENCAczaKwvcHLrB1Kf8t6/SZxVyqP66sPEhuxnxlQ2dBDp485gEWiOTFI6Svv0N BwTgQghzQy2Dg8UqSaCccooV9U5fIYwHqJLzKtraHxA0NKOyu5fOLwgSZvdYi7O5KlJK fh34hjBQZBoe3MtJLACX31taUm4sLTEq9IKioUNLl4Dhq1pTbhnbzLNlR74R+XCLPALm TZZf9F8QbARqQtBWycjEbYQAmp+CwH/45iB3fblEaMty7sYepZk0VDtoQbwYVi+or47H 8Ip6uzxAZ1ww8DJuTtWBjQQ0BHB1mqxXRuUzgJKY2nbcY3IGrBW2uzlWA2N2CWptAMpJ uONQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16-v6si8964871pll.210.2018.02.14.06.18.20; Wed, 14 Feb 2018 06:18:37 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030420AbeBNORn (ORCPT + 99 others); Wed, 14 Feb 2018 09:17:43 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58588 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030288AbeBNORl (ORCPT ); Wed, 14 Feb 2018 09:17:41 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2EB938182D0C; Wed, 14 Feb 2018 14:17:41 +0000 (UTC) Received: from jason-ThinkPad-T450s.redhat.com (ovpn-12-53.pek2.redhat.com [10.72.12.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EB4B2024CA4; Wed, 14 Feb 2018 14:17:35 +0000 (UTC) From: Jason Wang To: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: mst@redhat.com, Jason Wang , Michal Hocko , Matthew Wilcox , Jesper Dangaard Brouer , akpm@linux-foundation.org, dhowells@redhat.com, hannes@cmpxchg.org Subject: [PATCH net] bpf: cpumap: use GFP_KERNEL instead of GFP_ATOMIC in __cpu_map_entry_alloc() Date: Wed, 14 Feb 2018 22:17:34 +0800 Message-Id: <1518617854-4486-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 14 Feb 2018 14:17:41 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 14 Feb 2018 14:17:41 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jasowang@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There're several implications after commit 0bf7800f1799 ("ptr_ring: try vmalloc() when kmalloc() fails") with the using of vmalloc() since can't allow GFP_ATOMIC but mandate GFP_KERNEL. This will lead a WARN since cpumap try to call with GFP_ATOMIC. Fortunately, entry allocation of cpumap can only be done through syscall path which means GFP_ATOMIC is not necessary, so fixing this by replacing GFP_ATOMIC with GFP_KERNEL. Reported-by: syzbot+1a240cdb1f4cc88819df@syzkaller.appspotmail.com Fixes: 0bf7800f1799 ("ptr_ring: try vmalloc() when kmalloc() fails") Cc: Michal Hocko Cc: Daniel Borkmann Cc: Matthew Wilcox Cc: Jesper Dangaard Brouer Cc: akpm@linux-foundation.org Cc: dhowells@redhat.com Cc: hannes@cmpxchg.org Signed-off-by: Jason Wang --- kernel/bpf/cpumap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c index fbfdada6..a4bb0b3 100644 --- a/kernel/bpf/cpumap.c +++ b/kernel/bpf/cpumap.c @@ -334,7 +334,7 @@ static int cpu_map_kthread_run(void *data) static struct bpf_cpu_map_entry *__cpu_map_entry_alloc(u32 qsize, u32 cpu, int map_id) { - gfp_t gfp = GFP_ATOMIC|__GFP_NOWARN; + gfp_t gfp = GFP_KERNEL | __GFP_NOWARN; struct bpf_cpu_map_entry *rcpu; int numa, err; -- 2.7.4