lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230717145024.27274-1-ruc_gongyuanjun@163.com>
Date: Mon, 17 Jul 2023 22:50:24 +0800
From: Yuanjun Gong <ruc_gongyuanjun@....com>
To: Yuanjun Gong <ruc_gongyuanjun@....com>,
	Pravin B Shelar <pshelar@....org>,
	"David S . Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	netdev@...r.kernel.org
Subject: [PATCH 1/1] net:openvswitch: check return value of pskb_trim()

do kfree_skb() if an unexpected result is returned by pskb_tirm()
in do_output().

Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@....com>
---
 net/openvswitch/actions.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index cab1e02b63e0..6b3456bdff1c 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -920,9 +920,11 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
 
 		if (unlikely(cutlen > 0)) {
 			if (skb->len - cutlen > ovs_mac_header_len(key))
-				pskb_trim(skb, skb->len - cutlen);
+				if (pskb_trim(skb, skb->len - cutlen))
+					kfree_skb(skb);
 			else
-				pskb_trim(skb, ovs_mac_header_len(key));
+				if (pskb_trim(skb, ovs_mac_header_len(key)))
+					kfree_skb(skb);
 		}
 
 		if (likely(!mru ||
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ