rtnetlink: allocate more memory for dev_set_mac_address()
authorWANG Cong <xiyou.wangcong@gmail.com>
Thu, 20 Jul 2017 18:27:57 +0000 (11:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2017 16:08:52 +0000 (09:08 -0700)
commitd0594690a9ee8f74fcda37aa085087acf40e594f
treefa3bf5af5e4f3773ad7954bec1fecf78b8cefc10
parent31afa8b5edf9fc81c7df7aa903b7ef7b110bccab
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