Skip to contentSkip to conversation

vxlan: Add missing entries to vxlan_get_size()

PATCH Applied Benjamin Poirier 4 participants 4 messages Sep 18, 2023 – Sep 20, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vxlan: Add missing entries to vxlan_get_size()

There are some attributes added by vxlan_fill_info() which are not accounted for in vxlan_get_size(). Add them.

I didn't find a way to trigger an actual problem from this miscalculation since there is usually extra space in netlink size calculations like if_nlmsg_size(); but maybe I just didn't search long enough.

Fixes 3511494ce2f3 ("vxlan: Group Policy extension")
Fixes e1e5314de08b ("vxlan: implement GPE")
Fixes 0ace2ca89cbd ("vxlan: Use checksum partial with remote checksum offload")
Fixes f9c4bb0b245c ("vxlan: vni filtering support on collect metadata device")
---
 drivers/net/vxlan/vxlan_core.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/vxlan/vxlan_core.c +4 -0
index e463f59e95c2..5b5597073b00 100644
@@ -4331,6 +4331,10 @@ static size_t vxlan_get_size(const struct net_device *dev)
 		nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_REMCSUM_TX */
 		nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_REMCSUM_RX */
 		nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_LOCALBYPASS */
+		nla_total_size(0) + /* IFLA_VXLAN_GBP */
+		nla_total_size(0) + /* IFLA_VXLAN_GPE */
+		nla_total_size(0) + /* IFLA_VXLAN_REMCSUM_NOPARTIAL */
+		nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_VNIFILTER */
 		0;
 }
 
Signature · 1 line
2.40.1
Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · Benjamin Poirier

There are some attributes added by vxlan_fill_info() which are not accounted for in vxlan_get_size(). Add them.

I didn't find a way to trigger an actual problem from this miscalculation since there is usually extra space in netlink size calculations like if_nlmsg_size(); but maybe I just didn't search long enough.

Fixes 3511494ce2f3 ("vxlan: Group Policy extension")
Fixes e1e5314de08b ("vxlan: implement GPE")
Fixes 0ace2ca89cbd ("vxlan: Use checksum partial with remote checksum offload")
Fixes f9c4bb0b245c ("vxlan: vni filtering support on collect metadata device")
---
  drivers/net/vxlan/vxlan_core.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/net/vxlan/vxlan_core.c +0 -0
index e463f59e95c2..5b5597073b00 100644

drivers/net/vxlan/vxlan_core.c static size_t vxlan_get_size(const struct net_device *dev) · line 4340

Quoted 10 lines
drivers/net/vxlan/vxlan_core.c +4 -0
@@ -4331,6 +4331,10 @@ static size_t vxlan_get_size(const struct net_device *dev)
  		nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_REMCSUM_TX */
  		nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_REMCSUM_RX */
  		nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_LOCALBYPASS */
+		nla_total_size(0) + /* IFLA_VXLAN_GBP */
+		nla_total_size(0) + /* IFLA_VXLAN_GPE */
+		nla_total_size(0) + /* IFLA_VXLAN_REMCSUM_NOPARTIAL */
+		nla_total_size(sizeof(__u8)) + /* IFLA_VXLAN_VNIFILTER */
  		0;
  }
 
Reviewed-by on v1 1/1
#2 lore raw
In reply to Benjamin Poirier
Quoted 7 lines · Benjamin Poirier

There are some attributes added by vxlan_fill_info() which are not accounted for in vxlan_get_size(). Add them.

I didn't find a way to trigger an actual problem from this miscalculation since there is usually extra space in netlink size calculations like if_nlmsg_size(); but maybe I just didn't search long enough.

Quoted 5 lines
Fixes 3511494ce2f3 ("vxlan: Group Policy extension")
Fixes e1e5314de08b ("vxlan: implement GPE")
Fixes 0ace2ca89cbd ("vxlan: Use checksum partial with remote checksum offload")
Fixes f9c4bb0b245c ("vxlan: vni filtering support on collect metadata device")
#3 lore raw
In reply to Benjamin Poirier
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Mon, 18 Sep 2023 11:40:15 -0400 you wrote:

There are some attributes added by vxlan_fill_info() which are not accounted for in vxlan_get_size(). Add them.

I didn't find a way to trigger an actual problem from this miscalculation since there is usually extra space in netlink size calculations like if_nlmsg_size(); but maybe I just didn't search long enough.

[...]

Here is the summary with links:
- [net] vxlan: Add missing entries to vxlan_get_size()

    https://git.kernel.org/netdev/net/c/4e4b1798cc90

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html