diff options
Diffstat (limited to 'net/openvswitch/datapath.c')
| -rw-r--r-- | net/openvswitch/datapath.c | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 6679e96ab1dc..9dd158ab51b3 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -448,6 +448,10 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,  	upcall = genlmsg_put(user_skb, 0, 0, &dp_packet_genl_family,  			     0, upcall_info->cmd); +	if (!upcall) { +		err = -EINVAL; +		goto out; +	}  	upcall->dp_ifindex = dp_ifindex;  	err = ovs_nla_put_key(key, key, OVS_PACKET_ATTR_KEY, false, user_skb); @@ -460,6 +464,10 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,  	if (upcall_info->egress_tun_info) {  		nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_EGRESS_TUN_KEY); +		if (!nla) { +			err = -EMSGSIZE; +			goto out; +		}  		err = ovs_nla_put_tunnel_info(user_skb,  					      upcall_info->egress_tun_info);  		BUG_ON(err); @@ -468,6 +476,10 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,  	if (upcall_info->actions_len) {  		nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_ACTIONS); +		if (!nla) { +			err = -EMSGSIZE; +			goto out; +		}  		err = ovs_nla_put_actions(upcall_info->actions,  					  upcall_info->actions_len,  					  user_skb);  | 
