]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Jul 2017 22:23:22 +0000 (15:23 -0700)
commit56dd500ff9389d2cb148a298aed52cab6b8b9d8f
tree06308fcd9cd16cf966d238f9ee60e6bac1a62e3f
parent8ffc987bb380dc58bb9885855d6dfe3c989efc2a
rtnetlink: allocate more memory for dev_set_mac_address()

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>
net/core/rtnetlink.c