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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1372841397-10873-1-git-send-email-dborkman@redhat.com>
Date:	Wed,  3 Jul 2013 10:49:57 +0200
From:	Daniel Borkmann <dborkman@...hat.com>
To:	jesse@...ira.com
Cc:	netdev@...r.kernel.org, dev@...nvswitch.org
Subject: [PATCH] ovs: queue_userspace_packet: bail out if nla_nest_start returns NULL

The return value of nla_nest_start() is not checked, and can be NULL,
which is then being dereferenced in nla_nest_end(). Add a check to
prevent such situations.

Signed-off-by: Daniel Borkmann <dborkman@...hat.com>
---
 On top of "net-next" tree.

 net/openvswitch/datapath.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index d12d6b8..51a3c66 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -427,6 +427,10 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,
 	upcall->dp_ifindex = dp_ifindex;
 
 	nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_KEY);
+	if (unlikely(!nla)) {
+		err = -ENOMEM;
+		goto out;
+	}
 	ovs_flow_to_nlattrs(upcall_info->key, user_skb);
 	nla_nest_end(user_skb, nla);
 
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ