mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
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>
This commit is contained in:
parent
446e72f30e
commit
144586301f
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue