netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: bridge: mst: Restrict info size queries to bridge ports
@ 2022-03-22 13:30 Tobias Waldekranz
  2022-03-23 17:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Waldekranz @ 2022-03-22 13:30 UTC (permalink / raw)
  To: davem, kuba
  Cc: Roopa Prabhu, Nikolay Aleksandrov, Paolo Abeni, bridge, netdev,
	linux-kernel

Ensure that no bridge masters are ever considered for MST info
dumping. MST states are only supported on bridge ports, not bridge
masters - which br_mst_info_size relies on.

Fixes: 122c29486e1f ("net: bridge: mst: Support setting and reporting MST port states")
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---

It turns out that even with Eric's fix, the guard was not restrictive
enough. Sorry about all the noise around this.

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

diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 204472449ec9..200ad05b296f 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -119,7 +119,7 @@ static size_t br_get_link_af_size_filtered(const struct net_device *dev,
 	/* Each VLAN is returned in bridge_vlan_info along with flags */
 	vinfo_sz += num_vlan_infos * nla_total_size(sizeof(struct bridge_vlan_info));
 
-	if (vg && (filter_mask & RTEXT_FILTER_MST))
+	if (p && vg && (filter_mask & RTEXT_FILTER_MST))
 		vinfo_sz += br_mst_info_size(vg);
 
 	if (!(filter_mask & RTEXT_FILTER_CFM_STATUS))
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: bridge: mst: Restrict info size queries to bridge ports
  2022-03-22 13:30 [PATCH net-next] net: bridge: mst: Restrict info size queries to bridge ports Tobias Waldekranz
@ 2022-03-23 17:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-23 17:50 UTC (permalink / raw)
  To: Tobias Waldekranz
  Cc: davem, kuba, roopa, razor, pabeni, bridge, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 22 Mar 2022 14:30:01 +0100 you wrote:
> Ensure that no bridge masters are ever considered for MST info
> dumping. MST states are only supported on bridge ports, not bridge
> masters - which br_mst_info_size relies on.
> 
> Fixes: 122c29486e1f ("net: bridge: mst: Support setting and reporting MST port states")
> Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
> 
> [...]

Here is the summary with links:
  - [net-next] net: bridge: mst: Restrict info size queries to bridge ports
    https://git.kernel.org/netdev/net-next/c/a911ad18a56a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-23 17:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22 13:30 [PATCH net-next] net: bridge: mst: Restrict info size queries to bridge ports Tobias Waldekranz
2022-03-23 17:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).