Skip to contentSkip to conversation

IPVS

GIT PULL Applied Simon Horman 2 participants 5 messages Mar 31, 2011 – Apr 4, 2011

Subsystems (5)
lore
Share & tools
lore

Simon Horman

author maintainer
#0 lore raw

Hi Patrick,

please consider pulling
git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git for-patrick to get the following fix from Hans.

I have based this patch on net-2.6/master as nf-2.6/master seems a little out of date (i.e. pre 2.6.39-rc1). Please let me know if you would prefer me to use a different base. Alternatively, feel free to apply the single patch by hand.

Hans Schillstrom (1):
IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons().

 include/net/ip_vs.h            |    2 +-
 net/netfilter/ipvs/ip_vs_ctl.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
author maintainer
#1 lore raw

PATCH 1/1 IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons().

From: Hans Schillstrom <[email protected]>

ipvsadm -ln --daemon will trigger a Null pointer exception because ip_vs_genl_dump_daemons() uses skb_net() instead of skb_sknet().

To prevent others from NULL ptr a check is made in ip_vs.h skb_net().

---
 include/net/ip_vs.h            |    2 +-
 net/netfilter/ipvs/ip_vs_ctl.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/net/ip_vs.h +1 -1
index 30b49ed..4d1b71a 100644
@@ -52,7 +52,7 @@ static inline struct net *skb_net(const struct sk_buff *skb)
 	 */
 	if (likely(skb->dev && skb->dev->nd_net))
 		return dev_net(skb->dev);
-	if (skb_dst(skb)->dev)
+	if (skb_dst(skb) && skb_dst(skb)->dev)
 		return dev_net(skb_dst(skb)->dev);
 	WARN(skb->sk, "Maybe skb_sknet should be used in %s() at line:%d\n",
 		      __func__, __LINE__);
net/netfilter/ipvs/ip_vs_ctl.c +1 -1
index 33733c8..ae47090 100644
@@ -3120,7 +3120,7 @@ nla_put_failure:
 static int ip_vs_genl_dump_daemons(struct sk_buff *skb,
 				   struct netlink_callback *cb)
 {
-	struct net *net = skb_net(skb);
+	struct net *net = skb_sknet(skb);
 	struct netns_ipvs *ipvs = net_ipvs(net);
 
 	mutex_lock(&__ip_vs_mutex);
Signature · 1 line
1.7.4.1
#2 lore raw

Re: [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons().

Quoted 7 lines · Simon Horman

From: Hans Schillstrom <[email protected]>

ipvsadm -ln --daemon will trigger a Null pointer exception because ip_vs_genl_dump_daemons() uses skb_net() instead of skb_sknet().

To prevent others from NULL ptr a check is made in ip_vs.h skb_net().

Applied, thanks.

#3 lore raw
In reply to Simon Horman
Quoted 10 lines · Simon Horman

Hi Patrick,

please consider pulling
git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git for-patrick to get the following fix from Hans.

I have based this patch on net-2.6/master as nf-2.6/master seems a little out of date (i.e. pre 2.6.39-rc1). Please let me know if you would prefer me to use a different base. Alternatively, feel free to apply the single patch by hand.

I'll apply this by hand to avoid possible unnecessary merge commits. I've also updated nf-2.6.git to net-2.6.git.

author maintainer
#4 lore raw
Quoted 7 lines · Patrick McHardy
Quoted 6 lines · Simon Horman

Hi Patrick,

please consider pulling
git://git.kernel.org/pub/scm/linux/kernel/git/horms/lvs-test-2.6.git for-patrick to get the following fix from Hans.

Quoted 7 lines
Quoted 4 lines

I have based this patch on net-2.6/master as nf-2.6/master seems a little out of date (i.e. pre 2.6.39-rc1). Please let me know if you would prefer me to use a different base. Alternatively, feel free to apply the single patch by hand.

I'll apply this by hand to avoid possible unnecessary merge commits. I've also updated nf-2.6.git to net-2.6.git.

Thanks Patrick.