rtnetlink: allocate more memory for dev_set_mac_address()
commitcda2bc91baf7b6849733145331726a1364f20512
authorWANG Cong <xiyou.wangcong@gmail.com>
Thu, 20 Jul 2017 18:27:57 +0000 (20 11:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2017 15:49:32 +0000 (11 08:49 -0700)
tree60a762ee0d1ed3c68b99320b08c849ef8212c23b
parent0c47f11bc4a5ddd37962b2ba5a4d53f6caeeaec1
rtnetlink: allocate more memory for dev_set_mac_address()

[ Upstream commit 153711f9421be5dbc973dc57a4109dc9d54c89b1 ]

virtnet_set_mac_address() interprets mac address as struct
sockaddr, but upper layer only allocates dev->addr_len
which is ETH_ALEN + sizeof(sa_family_t) in this case.

We lack a unified definition for mac address, so just fix
the upper layer, this also allows drivers to interpret it
to struct sockaddr freely.

Reported-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/rtnetlink.c