aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-07-28 02:36:15 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 10:37:21 -0700
commit52238af23c7afb11cad5978f0434036f494f1b00 (patch)
treeb3257bfe25b8ac10c8b1965785a8ae8ea1b3d445 /net
parent832b524a136e7306f66a632a42dbc86fd41b2f3c (diff)
net: net_assign_generic() fix
[ Upstream commit 144586301f6af5ae5943a002f030d8c626fa4fdd ] memcpy() should take into account size of pointers, not only number of pointers to copy. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net')
-rw-r--r--net/core/net_namespace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 7c52fe277b6..656f6fb0116 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -446,7 +446,7 @@ int net_assign_generic(struct net *net, int id, void *data)
ng->len = id;
INIT_RCU_HEAD(&ng->rcu);
- memcpy(&ng->ptr, &old_ng->ptr, old_ng->len);
+ memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*));
rcu_assign_pointer(net->gen, ng);
call_rcu(&old_ng->rcu, net_generic_release);