netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/1] net:ipv6: check return value of pskb_trim()
@ 2023-07-17 14:45 Yuanjun Gong
  2023-07-17 16:45 ` David Ahern
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yuanjun Gong @ 2023-07-17 14:45 UTC (permalink / raw)
  To: Yuanjun Gong, David S . Miller, David Ahern, netdev

goto tx_err if an unexpected result is returned by pskb_tirm()
in ip6erspan_tunnel_xmit().

Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
---
 net/ipv6/ip6_gre.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index da80974ad23a..070d87abf7c0 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -955,7 +955,8 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
 		goto tx_err;
 
 	if (skb->len > dev->mtu + dev->hard_header_len) {
-		pskb_trim(skb, dev->mtu + dev->hard_header_len);
+		if (pskb_trim(skb, dev->mtu + dev->hard_header_len))
+			goto tx_err;
 		truncate = true;
 	}
 
-- 
2.17.1


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

* Re: [PATCH v2 1/1] net:ipv6: check return value of pskb_trim()
  2023-07-17 14:45 [PATCH v2 1/1] net:ipv6: check return value of pskb_trim() Yuanjun Gong
@ 2023-07-17 16:45 ` David Ahern
  2023-07-17 19:04 ` Kuniyuki Iwashima
  2023-07-19 11:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: David Ahern @ 2023-07-17 16:45 UTC (permalink / raw)
  To: Yuanjun Gong, David S . Miller, netdev

On 7/17/23 8:45 AM, Yuanjun Gong wrote:
> goto tx_err if an unexpected result is returned by pskb_tirm()
> in ip6erspan_tunnel_xmit().
> 
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
> ---
>  net/ipv6/ip6_gre.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> index da80974ad23a..070d87abf7c0 100644
> --- a/net/ipv6/ip6_gre.c
> +++ b/net/ipv6/ip6_gre.c
> @@ -955,7 +955,8 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
>  		goto tx_err;
>  
>  	if (skb->len > dev->mtu + dev->hard_header_len) {
> -		pskb_trim(skb, dev->mtu + dev->hard_header_len);
> +		if (pskb_trim(skb, dev->mtu + dev->hard_header_len))
> +			goto tx_err;
>  		truncate = true;
>  	}
>  

Reviewed-by: David Ahern <dsahern@kernel.org>


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

* [PATCH v2 1/1] net:ipv6: check return value of pskb_trim()
  2023-07-17 14:45 [PATCH v2 1/1] net:ipv6: check return value of pskb_trim() Yuanjun Gong
  2023-07-17 16:45 ` David Ahern
@ 2023-07-17 19:04 ` Kuniyuki Iwashima
  2023-07-19 11:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Kuniyuki Iwashima @ 2023-07-17 19:04 UTC (permalink / raw)
  To: ruc_gongyuanjun; +Cc: davem, dsahern, netdev, Kuniyuki Iwashima

From: Yuanjun Gong <ruc_gongyuanjun@163.com>
Date: Mon, 17 Jul 2023 22:45:19 +0800
> goto tx_err if an unexpected result is returned by pskb_tirm()
> in ip6erspan_tunnel_xmit().
> 
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>

Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support")
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>

Please keep these in mind for an acutual fix from next time.

  * Add Fixes: tag in changelog
  * Specify target tree as net in mail subject

See also Documentation/process/maintainer-netdev.rst

Thanks!


> ---
>  net/ipv6/ip6_gre.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
> index da80974ad23a..070d87abf7c0 100644
> --- a/net/ipv6/ip6_gre.c
> +++ b/net/ipv6/ip6_gre.c
> @@ -955,7 +955,8 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
>  		goto tx_err;
>  
>  	if (skb->len > dev->mtu + dev->hard_header_len) {
> -		pskb_trim(skb, dev->mtu + dev->hard_header_len);
> +		if (pskb_trim(skb, dev->mtu + dev->hard_header_len))
> +			goto tx_err;
>  		truncate = true;
>  	}
>  
> -- 
> 2.17.1

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

* Re: [PATCH v2 1/1] net:ipv6: check return value of pskb_trim()
  2023-07-17 14:45 [PATCH v2 1/1] net:ipv6: check return value of pskb_trim() Yuanjun Gong
  2023-07-17 16:45 ` David Ahern
  2023-07-17 19:04 ` Kuniyuki Iwashima
@ 2023-07-19 11:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-07-19 11:30 UTC (permalink / raw)
  To: Yuanjun Gong; +Cc: davem, dsahern, netdev

Hello:

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

On Mon, 17 Jul 2023 22:45:19 +0800 you wrote:
> goto tx_err if an unexpected result is returned by pskb_tirm()
> in ip6erspan_tunnel_xmit().
> 
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
> ---
>  net/ipv6/ip6_gre.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [v2,1/1] net:ipv6: check return value of pskb_trim()
    https://git.kernel.org/netdev/net/c/4258faa130be

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-07-19 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-17 14:45 [PATCH v2 1/1] net:ipv6: check return value of pskb_trim() Yuanjun Gong
2023-07-17 16:45 ` David Ahern
2023-07-17 19:04 ` Kuniyuki Iwashima
2023-07-19 11:30 ` 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).