All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] vxlan: Add missing entries to vxlan_get_size()
@ 2023-09-18 15:40 Benjamin Poirier
  2023-09-18 18:40 ` Nikolay Aleksandrov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Benjamin Poirier @ 2023-09-18 15:40 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Ido Schimmel, Nikolay Aleksandrov, Simon Horman, Jiri Benc,
	Gavin Li, Hangbin Liu, Vladimir Nikishkin, Li Zetao, Thomas Graf,
	Tom Herbert, Roopa Prabhu

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")
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
---
 drivers/net/vxlan/vxlan_core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index e463f59e95c2..5b5597073b00 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -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;
 }
 
-- 
2.40.1


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

* Re: [PATCH net] vxlan: Add missing entries to vxlan_get_size()
  2023-09-18 15:40 [PATCH net] vxlan: Add missing entries to vxlan_get_size() Benjamin Poirier
@ 2023-09-18 18:40 ` Nikolay Aleksandrov
  2023-09-19 15:20 ` Ido Schimmel
  2023-09-20  8:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Nikolay Aleksandrov @ 2023-09-18 18:40 UTC (permalink / raw)
  To: Benjamin Poirier, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Ido Schimmel, Simon Horman, Jiri Benc, Gavin Li, Hangbin Liu,
	Vladimir Nikishkin, Li Zetao, Thomas Graf, Tom Herbert,
	Roopa Prabhu

On 9/18/23 18:40, Benjamin Poirier 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.
> 
> 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")
> Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
> ---
>   drivers/net/vxlan/vxlan_core.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
> index e463f59e95c2..5b5597073b00 100644
> --- a/drivers/net/vxlan/vxlan_core.c
> +++ b/drivers/net/vxlan/vxlan_core.c
> @@ -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;
>   }
>   

Acked-by: Nikolay Aleksandrov <razor@blackwall.org>

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

* Re: [PATCH net] vxlan: Add missing entries to vxlan_get_size()
  2023-09-18 15:40 [PATCH net] vxlan: Add missing entries to vxlan_get_size() Benjamin Poirier
  2023-09-18 18:40 ` Nikolay Aleksandrov
@ 2023-09-19 15:20 ` Ido Schimmel
  2023-09-20  8:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2023-09-19 15:20 UTC (permalink / raw)
  To: Benjamin Poirier
  Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ido Schimmel, Nikolay Aleksandrov, Simon Horman,
	Jiri Benc, Gavin Li, Hangbin Liu, Vladimir Nikishkin, Li Zetao,
	Thomas Graf, Tom Herbert, Roopa Prabhu

On Mon, Sep 18, 2023 at 11:40:15AM -0400, Benjamin Poirier 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.
> 
> 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")
> Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

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

* Re: [PATCH net] vxlan: Add missing entries to vxlan_get_size()
  2023-09-18 15:40 [PATCH net] vxlan: Add missing entries to vxlan_get_size() Benjamin Poirier
  2023-09-18 18:40 ` Nikolay Aleksandrov
  2023-09-19 15:20 ` Ido Schimmel
@ 2023-09-20  8:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-09-20  8:10 UTC (permalink / raw)
  To: Benjamin Poirier
  Cc: netdev, davem, edumazet, kuba, pabeni, idosch, razor, horms,
	jbenc, gavinl, liuhangbin, vladimir, lizetao1, tgraf, therbert,
	roopa

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-09-20  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-18 15:40 [PATCH net] vxlan: Add missing entries to vxlan_get_size() Benjamin Poirier
2023-09-18 18:40 ` Nikolay Aleksandrov
2023-09-19 15:20 ` Ido Schimmel
2023-09-20  8:10 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.