From patchwork Wed Jul 6 00:28:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 9215281 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3391260572 for ; Wed, 6 Jul 2016 00:31:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 240E3284FA for ; Wed, 6 Jul 2016 00:31:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17C15284FC; Wed, 6 Jul 2016 00:31:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15D7F284FB for ; Wed, 6 Jul 2016 00:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752079AbcGFA3U (ORCPT ); Tue, 5 Jul 2016 20:29:20 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33415 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751635AbcGFA3J (ORCPT ); Tue, 5 Jul 2016 20:29:09 -0400 Received: by mail-pf0-f196.google.com with SMTP id c74so20323063pfb.0; Tue, 05 Jul 2016 17:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=E9c7uX0dxQdKUGZGtDEMBTZnpZu8sBb+MSw5QcLtfz8=; b=z3P5HlWrpcB+Y9Bursh0/H13WSczcfdoP4DqhfSV1iuvSwxWJy+ljKoG/eKKxJHt+S HxoNPsL/+WJ919wY4clSTwIh98Q4hzfnaTJ6SZdi4OIqA1zAez4eez4uW9zwkVqRO+B1 RXdzUO4H0rPpLmbC9QWi/+bevsHE5W/yIIgzuw9f8hoO4ONNuN+P5/drO1+YVAOXrxiR Uy4uL3RLIoJOTq9rZNAd+KbJK8HE0WHmUQ9P4e6SYk+yfKYkEmR7kW6jEsTVQ0rqdY89 lU+nhkuQId3VFSaEQY9fN4CCnLMfDteL5TS3jFcMJ5TflQJU9GNADckzn5NUUp5bhieT iCVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=E9c7uX0dxQdKUGZGtDEMBTZnpZu8sBb+MSw5QcLtfz8=; b=XEx+jZhLRF9Z3MKGAuQVq5nK2Tfe4Yf7ilR7fibCMNMP/WsOtBmWO54ov5kw7mtsVd amFCZQVVInHuhryxA1S/NPi1w/Pwp560ske8KK17FYe0Gsji7r/s4yRY7edAHcWYNnYo 9DnE41++5H7y7ZbgwgCK718lr4a6F6HXgj3Sl6Cb89AEGO6cO3VbHw3e1k9uCALF6W0I C9iaa6JY7q0saMCIsLGbVwLgfumebITS4XVOHZadjA7+DMSfrPofZcC7IZUuX6+jnNwM BjH8ssXOtmfAJkZ84OEjARXzBzC0caZHV1z30UIimy+DkHhVQPsbWXJeKJR7VDjRhWet 67bQ== X-Gm-Message-State: ALyK8tJ1Zx7Y/NEKZF+Ky17RabhrF16RfY0AnxNlUsaairT9H151L5CR6LdXdeL5sR48dw== X-Received: by 10.98.77.65 with SMTP id a62mr37024586pfb.128.1467764947684; Tue, 05 Jul 2016 17:29:07 -0700 (PDT) Received: from localhost.localdomain (p0347f3.kngwnt01.ap.so-net.ne.jp. [121.3.71.243]) by smtp.gmail.com with ESMTPSA id d65sm7612283pfa.45.2016.07.05.17.29.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jul 2016 17:29:07 -0700 (PDT) From: Masashi Honma To: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-wireless@vger.kernel.org, linux-rdma@vger.kernel.org, linux-audit@redhat.com, cluster-devel@redhat.com Cc: davem@davemloft.net, johannes@sipsolutions.net, pablo@netfilter.org, kaber@trash.net, kadlec@blackhole.kfki.hu, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, paul@paul-moore.com, eparis@redhat.com, zbr@ioremap.net, pshelar@nicira.com, ccaulfie@redhat.com, teigland@redhat.com, bsingharora@gmail.com, Masashi Honma Subject: [RFC 2/7] netfilter: Add allocation flag to nfnetlink_unicast() Date: Wed, 6 Jul 2016 09:28:31 +0900 Message-Id: <1467764916-4983-3-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467764916-4983-1-git-send-email-masashi.honma@gmail.com> References: <1467764916-4983-1-git-send-email-masashi.honma@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Masashi Honma --- include/linux/netfilter/nfnetlink.h | 2 +- net/netfilter/nfnetlink.c | 4 ++-- net/netfilter/nfnetlink_log.c | 4 ++-- net/netfilter/nfnetlink_queue.c | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 1d82dd5..a1c7808 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h @@ -38,7 +38,7 @@ int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid, unsigned int group, int echo, gfp_t flags); int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error); int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid, - int flags); + int flags, gfp_t allocation); void nfnl_lock(__u8 subsys_id); void nfnl_unlock(__u8 subsys_id); diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index f6193e7..b0910c7 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c @@ -141,9 +141,9 @@ int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error) EXPORT_SYMBOL_GPL(nfnetlink_set_err); int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid, - int flags) + int flags, gfp_t allocation) { - return netlink_unicast(net->nfnl, skb, portid, flags, 0); + return netlink_unicast(net->nfnl, skb, portid, flags, allocation); } EXPORT_SYMBOL_GPL(nfnetlink_unicast); diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 11f81c8..c834306 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c @@ -357,8 +357,8 @@ __nfulnl_send(struct nfulnl_instance *inst) goto out; } } - nfnetlink_unicast(inst->skb, inst->net, inst->peer_portid, - MSG_DONTWAIT); + nfnetlink_unicast(inst->skb, inst->net, inst->peer_portid, MSG_DONTWAIT, + gfp_any()); out: inst->qlen = 0; inst->skb = NULL; diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index 5d36a09..8d7b6ff 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -638,7 +638,8 @@ __nfqnl_enqueue_packet(struct net *net, struct nfqnl_instance *queue, *packet_id_ptr = htonl(entry->id); /* nfnetlink_unicast will either free the nskb or add it to a socket */ - err = nfnetlink_unicast(nskb, net, queue->peer_portid, MSG_DONTWAIT); + err = nfnetlink_unicast(nskb, net, queue->peer_portid, MSG_DONTWAIT, + GFP_ATOMIC); if (err < 0) { if (queue->flags & NFQA_CFG_F_FAIL_OPEN) { failopen = 1;