diff mbox series

[net-next] net: bridge: mst: Restrict info size queries to bridge ports

Message ID 20220322133001.16181-1-tobias@waldekranz.com (mailing list archive)
State Accepted
Commit a911ad18a56aeecf87a098ad1cdc4de91d7f60de
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: bridge: mst: Restrict info size queries to bridge ports | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Tobias Waldekranz March 22, 2022, 1:30 p.m. UTC
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(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 23, 2022, 5:50 p.m. UTC | #1
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!
diff mbox series

Patch

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))