[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <d525a30e52966da564bc3e4de31c4197a989b2ae.1399388943.git.popovich_sergei@mail.ru>
Date: Tue, 6 May 2014 18:13:16 +0300
From: Sergey Popovich <popovich_sergei@...l.ru>
To: netdev@...r.kernel.org
Subject: [PATCH 2/3] rtnetlink: fix potential NULL pointer dereference
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>
---
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;
--
1.8.3.4
--
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