All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>
Cc: Netfilter Development Mailinglist
	<netfilter-devel@vger.kernel.org>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: netfilter: ctnetlink: fix GFP_KERNEL allocation under spinlock
Date: Wed, 26 Nov 2008 12:23:08 +0100	[thread overview]
Message-ID: <492D319C.4060008@trash.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

This patch for 2.6.28 fixes a GFP_KERNEL allocation under spinlock
in ctnetlink that was missed in the conntrack creation race fix.

Please apply, thanks.

[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 961 bytes --]

commit 49a12376315f651decfa67c07041e2d0c2e04968
Author: Patrick McHardy <kaber@trash.net>
Date:   Wed Nov 26 12:16:50 2008 +0100

    netfilter: ctnetlink: fix GFP_KERNEL allocation under spinlock
    
    The previous fix for the conntrack creation race (netfilter: ctnetlink:
    fix conntrack creation race) missed a GFP_KERNEL allocation that is
    now performed while holding a spinlock. Switch to GFP_ATOMIC.
    
    Reported-and-tested-by: Zoltan Borbely <bozo@andrews.hu>
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 3b009a3..5f4a651 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -1138,7 +1138,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[],
 		}
 	}
 
-	nf_ct_acct_ext_add(ct, GFP_KERNEL);
+	nf_ct_acct_ext_add(ct, GFP_ATOMIC);
 
 #if defined(CONFIG_NF_CONNTRACK_MARK)
 	if (cda[CTA_MARK])

             reply	other threads:[~2008-11-26 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26 11:23 Patrick McHardy [this message]
2008-11-26 11:57 ` netfilter: ctnetlink: fix GFP_KERNEL allocation under spinlock David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=492D319C.4060008@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.