Message ID | 20230717144918.25961-1-ruc_gongyuanjun@163.com (mailing list archive) |
---|---|
State | Accepted |
Commit | aa7cb3789b429d4fdfbe767e0e0cf8c769299d7a |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/1] ipv4: ip_gre: fix return value check in erspan_xmit() | expand |
From: Yuanjun Gong <ruc_gongyuanjun@163.com> Date: Mon, 17 Jul 2023 22:49:18 +0800 > goto free_skb if an unexpected result is returned by pskb_tirm() > in erspan_xmit(). > > Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") 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..cb2182144dd5 100644 > --- a/net/ipv4/ip_gre.c > +++ b/net/ipv4/ip_gre.c > @@ -689,7 +689,8 @@ static netdev_tx_t erspan_xmit(struct sk_buff *skb, > goto 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 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:18 +0800 you wrote: > goto free_skb if an unexpected result is returned by pskb_tirm() > in erspan_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_xmit() https://git.kernel.org/netdev/net/c/aa7cb3789b42 You are awesome, thank you!
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 81a1cce1a7d1..cb2182144dd5 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -689,7 +689,8 @@ static netdev_tx_t erspan_xmit(struct sk_buff *skb, goto 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 free_skb; truncate = true; }
goto free_skb if an unexpected result is returned by pskb_tirm() in erspan_xmit(). Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> --- net/ipv4/ip_gre.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)