Message ID | 20230717144902.25695-1-ruc_gongyuanjun@163.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 02d84f3eb53a5be982b17c88410fa6c58806356b |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/1] ipv4: ip_gre: fix return value check in erspan_fb_xmit() | expand |
From: Yuanjun Gong <ruc_gongyuanjun@163.com> Date: Mon, 17 Jul 2023 22:49:02 +0800 > goto err_free_skb if an unexpected result is returned by pskb_tirm() > in erspan_fb_xmit(). > > Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> Fixes: 1a66a836da63 ("gre: add collect_md mode to ERSPAN tunnel") Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> > --- > net/ipv4/ip_gre.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c > index 81a1cce1a7d1..914cc941af55 100644 > --- a/net/ipv4/ip_gre.c > +++ b/net/ipv4/ip_gre.c > @@ -548,7 +548,8 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev) > goto err_free_skb; > > 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 err_free_skb; > truncate = true; > } > > -- > 2.17.1 >
Hello: This patch was applied to netdev/net.git (main) by David S. Miller <davem@davemloft.net>: On Mon, 17 Jul 2023 22:49:02 +0800 you wrote: > goto err_free_skb if an unexpected result is returned by pskb_tirm() > in erspan_fb_xmit(). > > Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> > --- > net/ipv4/ip_gre.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Here is the summary with links: - [1/1] ipv4: ip_gre: fix return value check in erspan_fb_xmit() https://git.kernel.org/netdev/net/c/02d84f3eb53a You are awesome, thank you!
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 81a1cce1a7d1..914cc941af55 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -548,7 +548,8 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev) goto err_free_skb; 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 err_free_skb; truncate = true; }
goto err_free_skb if an unexpected result is returned by pskb_tirm() in erspan_fb_xmit(). Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> --- net/ipv4/ip_gre.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)