[net] net: rtnl_configure_link: fix dev flags changes arg to __dev_notify_flags

Message ID 1536783708-21949-1-git-send-email-roopa@cumulusnetworks.com
State Accepted
Delegated to: David Miller
Headers show
Series
  • [net] net: rtnl_configure_link: fix dev flags changes arg to __dev_notify_flags
Related show

Commit Message

Roopa Prabhu Sept. 12, 2018, 8:21 p.m.
From: Roopa Prabhu <roopa@cumulusnetworks.com>

This fix addresses https://bugzilla.kernel.org/show_bug.cgi?id=201071

Commit 5025f7f7d506 wrongly relied on __dev_change_flags to notify users of
dev flag changes in the case when dev->rtnl_link_state = RTNL_LINK_INITIALIZED.
Fix it by indicating flag changes explicitly to __dev_notify_flags.

Fixes: 5025f7f7d506 ("rtnetlink: add rtnl_link_state check in rtnl_configure_link")
Reported-By: Liam mcbirnie <liam.mcbirnie@boeing.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
Dave, if 5025f7f7d506 made it to stable, request you to pls queue this one up too. Thanks.

 net/core/rtnetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Sept. 13, 2018, 6:02 p.m. | #1
From: Roopa Prabhu <roopa@cumulusnetworks.com>
Date: Wed, 12 Sep 2018 13:21:48 -0700

> From: Roopa Prabhu <roopa@cumulusnetworks.com>
> 
> This fix addresses https://bugzilla.kernel.org/show_bug.cgi?id=201071
> 
> Commit 5025f7f7d506 wrongly relied on __dev_change_flags to notify users of
> dev flag changes in the case when dev->rtnl_link_state = RTNL_LINK_INITIALIZED.
> Fix it by indicating flag changes explicitly to __dev_notify_flags.
> 
> Fixes: 5025f7f7d506 ("rtnetlink: add rtnl_link_state check in rtnl_configure_link")
> Reported-By: Liam mcbirnie <liam.mcbirnie@boeing.com>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>

Applied.

> ---
> Dave, if 5025f7f7d506 made it to stable, request you to pls queue this one up too. Thanks.

I will, thanks.

Patch

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 60c9288..63ce2283 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2810,7 +2810,7 @@  int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm)
 	}
 
 	if (dev->rtnl_link_state == RTNL_LINK_INITIALIZED) {
-		__dev_notify_flags(dev, old_flags, 0U);
+		__dev_notify_flags(dev, old_flags, (old_flags ^ dev->flags));
 	} else {
 		dev->rtnl_link_state = RTNL_LINK_INITIALIZED;
 		__dev_notify_flags(dev, old_flags, ~0U);