[PATCH] Remove GFP_KERNEL allocation under read-side lock in ctnetlink This patch fixes an illegal allocation with GFP_KERNEL (that may sleep) while holding the read-side lock. Signed-off-by: Pablo Neira Ayuso Index: net-next-2.6.git/net/netfilter/nf_conntrack_netlink.c =================================================================== --- net-next-2.6.git.orig/net/netfilter/nf_conntrack_netlink.c 2008-07-31 19:41:43.000000000 +0200 +++ net-next-2.6.git/net/netfilter/nf_conntrack_netlink.c 2008-07-31 23:25:39.000000000 +0200 @@ -1154,7 +1154,8 @@ ctnetlink_create_conntrack(struct nlattr rcu_read_lock(); helper = __nf_ct_helper_find(rtuple); if (helper) { - help = nf_ct_helper_ext_add(ct, GFP_KERNEL); + /* we cannot sleep holding the read-side lock */ + help = nf_ct_helper_ext_add(ct, GFP_ATOMIC); if (help == NULL) { rcu_read_unlock(); err = -ENOMEM;