[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230715094613.37897-1-ruc_gongyuanjun@163.com>
Date: Sat, 15 Jul 2023 17:46:13 +0800
From: Yuanjun Gong <ruc_gongyuanjun@....com>
To: Yuanjun Gong <ruc_gongyuanjun@....com>,
"David S . Miller" <davem@...emloft.net>,
David Ahern <dsahern@...nel.org>,
netdev@...r.kernel.org
Subject: [PATCH 1/1] net:ipv6: check return value of pskb_trim()
goto tx_err if an unexpected result is returned by pskb_tirm()
in ip6erspan_tunnel_xmit().
Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@....com>
---
net/ipv6/ip6_gre.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index da80974ad23a..92220b02e99f 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -955,8 +955,10 @@ 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);
- truncate = true;
+ if (pskb_trim(skb, dev->mtu + dev->hard_header_len))
+ goto tx_err;
+ else
+ truncate = true;
}
nhoff = skb_network_offset(skb);
--
2.17.1
Powered by blists - more mailing lists