diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-07-28 02:36:15 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-02 12:20:36 -0700 |
commit | 144586301f6af5ae5943a002f030d8c626fa4fdd (patch) | |
tree | f3535075b6dc16fed10426c7414dfb928c21791e /net | |
parent | 446e72f30eca76d6f9a1a54adf84d2c6ba2831f8 (diff) | |
download | linux-144586301f6af5ae5943a002f030d8c626fa4fdd.tar.gz linux-144586301f6af5ae5943a002f030d8c626fa4fdd.tar.bz2 linux-144586301f6af5ae5943a002f030d8c626fa4fdd.zip |
net: net_assign_generic() fix
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/net_namespace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index b7292a2719dc..197283072cc8 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -488,7 +488,7 @@ int net_assign_generic(struct net *net, int id, void *data) */ ng->len = id; - 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); |