[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM_iQpUheSWdPoAk2AEUHXueZwJj69XG75AGgHQzOR9X7=chcw@mail.gmail.com>
Date: Fri, 21 Jul 2017 11:50:24 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Linux Kernel Network Developers <netdev@...r.kernel.org>
Cc: David Ahern <dsahern@...il.com>, Jiri Pirko <jiri@...nulli.us>
Subject: Re: [Patch net] net: check mac address length for dev_set_mac_address()
On Thu, Jul 20, 2017 at 11:27 AM, Cong Wang <xiyou.wangcong@...il.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.
Powered by blists - more mailing lists