From: Roopa Prabhu Date: Thu, 29 Jan 2015 00:23:11 +0000 (-0800) Subject: bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify X-Git-Tag: firefly_0821_release~3679^2~814 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b4faf21b76b2a0cf00e5a75e73efb22a09868b18;p=firefly-linux-kernel-4.4.55.git bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify [ Upstream commit 59ccaaaa49b5b096cdc1f16706a9f931416b2332 ] Reported in: https://bugzilla.kernel.org/show_bug.cgi?id=92081 This patch avoids calling rtnl_notify if the device ndo_bridge_getlink handler does not return any bytes in the skb. Alternately, the skb->len check can be moved inside rtnl_notify. For the bridge vlan case described in 92081, there is also a fix needed in bridge driver to generate a proper notification. Will fix that in subsequent patch. v2: rebase patch on net tree Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 25c4dd563a79..279b5dcf09ae 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -2477,12 +2477,16 @@ static int rtnl_bridge_notify(struct net_device *dev, u16 flags) goto errout; } + if (!skb->len) + goto errout; + rtnl_notify(skb, net, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); return 0; errout: WARN_ON(err == -EMSGSIZE); kfree_skb(skb); - rtnl_set_sk_err(net, RTNLGRP_LINK, err); + if (err) + rtnl_set_sk_err(net, RTNLGRP_LINK, err); return err; }