Message ID | 4D00B5CD.3050406@netfilter.org |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
> Sorry, I finally found your email reporting this: > > > nfnetlink: avoid unbound loop on busy Netlink socket Fair enough, thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Pablo Neira Ayuso <pablo@netfilter.org> Date: Thu, 09 Dec 2010 11:56:13 +0100 > netfilter: ctnetlink: fix loop in ctnetlink_get_conntrack() > > From: Pablo Neira Ayuso <pablo@netfilter.org> > > This patch fixes a loop in ctnetlink_get_conntrack() that can be > triggered if you use the same socket to receive events and to > perform a GET operation. Under heavy load, netlink_unicast() > may return -EAGAIN, this error code is reserved in nfnetlink for > the module load-on-demand. Instead, we return -ENOBUFS which is > the appropriate error code that has to be propagated to > user-space. > > Reported-by: Holger Eitzenberger <holger@eitzenberger.org> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Since Patrick seems to be inactive I have applied this directly to net-2.6, thanks guys! -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
netfilter: ctnetlink: fix loop in ctnetlink_get_conntrack() From: Pablo Neira Ayuso <pablo@netfilter.org> This patch fixes a loop in ctnetlink_get_conntrack() that can be triggered if you use the same socket to receive events and to perform a GET operation. Under heavy load, netlink_unicast() may return -EAGAIN, this error code is reserved in nfnetlink for the module load-on-demand. Instead, we return -ENOBUFS which is the appropriate error code that has to be propagated to user-space. Reported-by: Holger Eitzenberger <holger@eitzenberger.org> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> --- net/netfilter/nf_conntrack_netlink.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index b729ace..a84fa6f 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -973,7 +973,8 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb, free: kfree_skb(skb2); out: - return err; + /* this avoids a loop in nfnetlink. */ + return err == -EAGAIN ? -ENOBUFS : err; } #ifdef CONFIG_NF_NAT_NEEDED