* [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons().
@ 2011-03-30 14:36 Hans Schillstrom
2011-03-31 1:24 ` Simon Horman
0 siblings, 1 reply; 7+ messages in thread
From: Hans Schillstrom @ 2011-03-30 14:36 UTC (permalink / raw)
To: horms, ja, wensong, lvs-devel, netdev, netfilter-devel
Cc: hans, Hans Schillstrom
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().
This patches is based on net-2.6
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
---
include/net/ip_vs.h | 2 +-
net/netfilter/ipvs/ip_vs_ctl.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 30b49ed..4d1b71a 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -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__);
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 33733c8..ae47090 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -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);
--
1.6.0.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons().
2011-03-30 14:36 [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons() Hans Schillstrom
@ 2011-03-31 1:24 ` Simon Horman
0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2011-03-31 1:24 UTC (permalink / raw)
To: Hans Schillstrom; +Cc: ja, wensong, lvs-devel, netdev, netfilter-devel, hans
On Wed, Mar 30, 2011 at 04:36:37PM +0200, Hans Schillstrom wrote:
> 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().
>
> This patches is based on net-2.6
Thanks Hans,
I will prepare a pull request for Patrick this afternoon.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [GIT PULL nf-2.6] IPVS
@ 2011-03-31 1:32 Simon Horman
2011-03-31 1:32 ` [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons() Simon Horman
2011-04-04 13:27 ` [GIT PULL nf-2.6] IPVS Patrick McHardy
0 siblings, 2 replies; 7+ messages in thread
From: Simon Horman @ 2011-03-31 1:32 UTC (permalink / raw)
To: lvs-devel, netdev, netfilter-devel, netfilter
Cc: Hans Schillstrom, Julian Anastasov, Patrick McHardy, 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.
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(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons().
2011-03-31 1:32 [GIT PULL nf-2.6] IPVS Simon Horman
@ 2011-03-31 1:32 ` Simon Horman
2011-04-04 13:28 ` Patrick McHardy
2011-04-04 13:27 ` [GIT PULL nf-2.6] IPVS Patrick McHardy
1 sibling, 1 reply; 7+ messages in thread
From: Simon Horman @ 2011-03-31 1:32 UTC (permalink / raw)
To: lvs-devel, netdev, netfilter-devel, netfilter
Cc: Hans Schillstrom, Julian Anastasov, Patrick McHardy, Simon Horman,
Hans Schillstrom
From: Hans Schillstrom <hans.schillstrom@ericsson.com>
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().
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
---
include/net/ip_vs.h | 2 +-
net/netfilter/ipvs/ip_vs_ctl.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 30b49ed..4d1b71a 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -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__);
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 33733c8..ae47090 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -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);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [GIT PULL nf-2.6] IPVS
2011-03-31 1:32 [GIT PULL nf-2.6] IPVS Simon Horman
2011-03-31 1:32 ` [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons() Simon Horman
@ 2011-04-04 13:27 ` Patrick McHardy
2011-04-04 23:43 ` Simon Horman
1 sibling, 1 reply; 7+ messages in thread
From: Patrick McHardy @ 2011-04-04 13:27 UTC (permalink / raw)
To: Simon Horman
Cc: lvs-devel, netdev, netfilter-devel, netfilter, Hans Schillstrom,
Julian Anastasov
On 31.03.2011 03:32, Simon Horman wrote:
> 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons().
2011-03-31 1:32 ` [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons() Simon Horman
@ 2011-04-04 13:28 ` Patrick McHardy
0 siblings, 0 replies; 7+ messages in thread
From: Patrick McHardy @ 2011-04-04 13:28 UTC (permalink / raw)
To: Simon Horman
Cc: lvs-devel, netdev, netfilter-devel, netfilter, Hans Schillstrom,
Julian Anastasov, Hans Schillstrom
On 31.03.2011 03:32, Simon Horman wrote:
> From: Hans Schillstrom <hans.schillstrom@ericsson.com>
>
> 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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [GIT PULL nf-2.6] IPVS
2011-04-04 13:27 ` [GIT PULL nf-2.6] IPVS Patrick McHardy
@ 2011-04-04 23:43 ` Simon Horman
0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2011-04-04 23:43 UTC (permalink / raw)
To: Patrick McHardy
Cc: lvs-devel, netdev, netfilter-devel, netfilter, Hans Schillstrom,
Julian Anastasov
On Mon, Apr 04, 2011 at 03:27:22PM +0200, Patrick McHardy wrote:
> On 31.03.2011 03:32, Simon Horman wrote:
> > 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.
Thanks Patrick.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-04-04 23:43 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-31 1:32 [GIT PULL nf-2.6] IPVS Simon Horman
2011-03-31 1:32 ` [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons() Simon Horman
2011-04-04 13:28 ` Patrick McHardy
2011-04-04 13:27 ` [GIT PULL nf-2.6] IPVS Patrick McHardy
2011-04-04 23:43 ` Simon Horman
-- strict thread matches above, loose matches on Subject: below --
2011-03-30 14:36 [PATCH] IPVS Bug, Null ptr in ip_vs_ctl.c ip_vs_genl_dump_daemons() Hans Schillstrom
2011-03-31 1:24 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).