Patch "net: bridge: fix under estimation in br_get_linkxstats_size()" has been added to the 5.10-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: fix under estimation in br_get_linkxstats_size()

to the 5.10-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-fix-under-estimation-in-br_get_linkxstats.patch
and it can be found in the queue-5.10 subdirectory.

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



commit a4c6b83499f8783542494d1efdc9b6eb42e88e68
Author: Eric Dumazet <edumazet@xxxxxxxxxx>
Date:   Mon Oct 4 18:05:08 2021 -0700

    net: bridge: fix under estimation in br_get_linkxstats_size()
    
    [ Upstream commit 0854a0513321cf70bea5fa483ebcaa983cc7c62e ]
    
    Commit de1799667b00 ("net: bridge: add STP xstats")
    added an additional nla_reserve_64bit() in br_fill_linkxstats(),
    but forgot to update br_get_linkxstats_size() accordingly.
    
    This can trigger the following in rtnl_stats_get()
    
            WARN_ON(err == -EMSGSIZE);
    
    Fixes: de1799667b00 ("net: bridge: add STP xstats")
    Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Cc: Vivien Didelot <vivien.didelot@xxxxxxxxx>
    Cc: Nikolay Aleksandrov <nikolay@xxxxxxxxxx>
    Acked-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_netlink.c b/net/bridge/br_netlink.c
index bfe6ab1914c8..31b00ba5dcc8 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -1591,6 +1591,7 @@ static size_t br_get_linkxstats_size(const struct net_device *dev, int attr)
 
 	return numvls * nla_total_size(sizeof(struct bridge_vlan_xstats)) +
 	       nla_total_size_64bit(sizeof(struct br_mcast_stats)) +
+	       (p ? nla_total_size_64bit(sizeof(p->stp_xstats)) : 0) +
 	       nla_total_size(0);
 }
 



[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