Received: by 10.223.185.116 with SMTP id b49csp1135542wrg; Wed, 14 Feb 2018 12:10:05 -0800 (PST) X-Google-Smtp-Source: AH8x225CoZ/rqaM3yuj0w78MpMp5a+4sapoBESewmMEhz6Sx5+bayI0eB0cH6sKj7vTUmmPF3BTS X-Received: by 10.167.129.195 with SMTP id c3mr254339pfn.14.1518639005218; Wed, 14 Feb 2018 12:10:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518639005; cv=none; d=google.com; s=arc-20160816; b=cfDvlZiBESX05kjlIDk/u40ZbdIoizbA09Q5DNlgN0BabIeGlZjv0D/mKuoiWO6ZO1 7coEh3Bm4wlcJwSjMxDLXbgXJrO2yAUEGxUkYZSdoPBdU42DJoGXtMFrOYLAm5ARN8w4 lylmAly8AO7bpOQKPQRgt+QglTtTXT4swkHRmgxTaqcqpjIW+ph4IYVUnoudmESkEi6j MB0jOGZbTudGpWp+0+Y5xk8yImdp0yD2k66Praj12EFWCLBk83LDVkFP5ZxplvSGSLwa uS0X0JneBf5PN+N2VmqK/BZGt28IuSQVvkzqPJPtZBzYpH7Hd6+zxxOqwqYV/R5zZLeU hEPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=2U/EQ8Ps5cAqBUyYVZmFVvORUkGkjSYdiSn5pOk4o3E=; b=nDHlAkevVuc4NZCBGa8MAQKbLW/iGc+0t5FJIZI/XeDOfxozZANUIjs/l/c/5au5YY FJCRRjI3QizU++kTvnU7C8mBTZIKiqMSp+9zuDWCqwdGbGxF8v2LSJQLrcPVmo+2rSEd 6af4mhO3/wHENvObzKdSFUzxq/ZFbt0MHl74dRYdoYp3hdbtM0dFwRXjmQ1cRG9gnTFC iV7T2d0Xo9xiTWFMcKUR5/H33/ii8VYj7OWoIsAHIB5UlkTiobv2CBJlMyd9AxvGFkTv xpawHWM/YpwOEYAQTNeybKALuKp6kqYO4de1ioVKxMhMrcEE1D+OCWaQQA93GIkXz1fN GxRw== 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 u18si636339pfl.259.2018.02.14.12.09.50; Wed, 14 Feb 2018 12:10:05 -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 S1033325AbeBNRFA (ORCPT + 99 others); Wed, 14 Feb 2018 12:05:00 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58780 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032907AbeBNRE6 (ORCPT ); Wed, 14 Feb 2018 12:04:58 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED0704040857; Wed, 14 Feb 2018 17:04:57 +0000 (UTC) Received: from redhat.com (ovpn-121-104.rdu2.redhat.com [10.10.121.104]) by smtp.corp.redhat.com (Postfix) with SMTP id 1A3A7213AEE1; Wed, 14 Feb 2018 17:04:57 +0000 (UTC) Date: Wed, 14 Feb 2018 19:04:56 +0200 From: "Michael S. Tsirkin" To: Jason Wang Cc: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Hocko , Matthew Wilcox , Jesper Dangaard Brouer , akpm@linux-foundation.org, dhowells@redhat.com, hannes@cmpxchg.org Subject: Re: [PATCH net] bpf: cpumap: use GFP_KERNEL instead of GFP_ATOMIC in __cpu_map_entry_alloc() Message-ID: <20180214190311-mutt-send-email-mst@kernel.org> References: <1518617854-4486-1-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1518617854-4486-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 14 Feb 2018 17:04:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 14 Feb 2018 17:04:58 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 14, 2018 at 10:17:34PM +0800, Jason Wang wrote: > 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 Frankly I'd start with the revert. The original patch was rushed into net without enough justification IMHO, and we just seem to keep piling up these things. How about deferring all these ideas to net-next? > --- > 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