On Thu, Jul 20, 2017 at 11:27 AM, Cong Wang <xiyou.wangc...@gmail.com> wrote: > diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c > index 82fd4c9c4a1b..3f41601d7b7c 100644 > --- a/net/core/dev_ioctl.c > +++ b/net/core/dev_ioctl.c > @@ -262,6 +262,8 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, > unsigned int cmd) > return dev_set_mtu(dev, ifr->ifr_mtu); > > case SIOCSIFHWADDR: > + if (dev->addr_len > sizeof(struct sockaddr)) > + return -EINVAL; > return dev_set_mac_address(dev, &ifr->ifr_hwaddr); >
Thinking a bit more, I should keep this patch simpler for -net and -stable, so only the above piece is necessary, the rest pieces can be put to -net-next. I will resend this, and the "team: use a larger struct for mac address". Thanks.