Patch "net: bridge: vlan: fix single net device option dumping" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: bridge: vlan: fix single net device option dumping

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-bridge-vlan-fix-single-net-device-option-dumping.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 113191f457d0b915e78f2f0400552adc3eea4ad4
Author: Nikolay Aleksandrov <nikolay@xxxxxxxxxx>
Date:   Wed Jan 26 15:10:25 2022 +0200

    net: bridge: vlan: fix single net device option dumping
    
    [ Upstream commit dcb2c5c6ca9b9177f04abaf76e5a983d177c9414 ]
    
    When dumping vlan options for a single net device we send the same
    entries infinitely because user-space expects a 0 return at the end but
    we keep returning skb->len and restarting the dump on retry. Fix it by
    returning the value from br_vlan_dump_dev() if it completed or there was
    an error. The only case that must return skb->len is when the dump was
    incomplete and needs to continue (-EMSGSIZE).
    
    Reported-by: Benjamin Poirier <bpoirier@xxxxxxxxxx>
    Fixes: 8dcea187088b ("net: bridge: vlan: add rtm definitions and dump support")
    Signed-off-by: Nikolay Aleksandrov <nikolay@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 19f65ab91a027..06f5caee495aa 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -2105,7 +2105,8 @@ static int br_vlan_rtm_dump(struct sk_buff *skb, struct netlink_callback *cb)
 			goto out_err;
 		}
 		err = br_vlan_dump_dev(dev, skb, cb, dump_flags);
-		if (err && err != -EMSGSIZE)
+		/* if the dump completed without an error we return 0 here */
+		if (err != -EMSGSIZE)
 			goto out_err;
 	} else {
 		for_each_netdev_rcu(net, dev) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux