[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7039871.D07mH35iXC@tuxracer>
Date: Tue, 06 May 2014 18:26:17 +0300
From: Sergey Popovich <popovich_sergei@...l.ru>
To: netdev@...r.kernel.org
Subject: Re: [PATCH 2/3] rtnetlink: fix potential NULL pointer dereference
В письме от 6 мая 2014 18:13:16 пользователь Sergey Popovich написал:
> Now since commit fbdc1e8c6b79 (rtnetlink: walk through all devs in
> netns safely on link params change) group of network devices can
> be moved into another network namespace, there is NULL pointer
> dereference in the do_setlink() as it get's called from
> rtnl_group_changelink() with ifname == NULL.
>
> Fixes: e7ed828f10bd netlink: support setting devgroup parameters
> Signed-off-by: Sergey Popovich <popovich_sergei@...l.ru>
Not needed, self-rejected patch, ifm->ifi_index is == 0 when
calling from rtnl_group_changelink().
Sorry for noise.
> ---
> net/core/rtnetlink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 95258e2..188c060 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -1484,7 +1484,7 @@ static int do_setlink(struct net_device *dev, struct
> ifinfomsg *ifm, * name provided implies that a name change has been
> * requested.
> */
> - if (ifm->ifi_index > 0 && ifname[0]) {
> + if (ifname && ifname[0] && ifm->ifi_index > 0) {
> err = dev_change_name(dev, ifname);
> if (err < 0)
> goto errout;
--
SP5474-RIPE
Sergey Popovich
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists