Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca965346 authored by Colin Ian King's avatar Colin Ian King Committed by David S. Miller
Browse files

openvswitch: check for null pointer return from nla_nest_start_noflag



The call to nla_nest_start_noflag can return null in the unlikely
event that nla_put returns -EMSGSIZE.  Check for this condition to
avoid a null pointer dereference on pointer nla_reply.

Addresses-Coverity: ("Dereference null return value")
Fixes: 11efd5cb ("openvswitch: Support conntrack zone limit")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarYi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f4b47a59
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2161,6 +2161,10 @@ static int ovs_ct_limit_cmd_get(struct sk_buff *skb, struct genl_info *info)
		return PTR_ERR(reply);

	nla_reply = nla_nest_start_noflag(reply, OVS_CT_LIMIT_ATTR_ZONE_LIMIT);
	if (!nla_reply) {
		err = -EMSGSIZE;
		goto exit_err;
	}

	if (a[OVS_CT_LIMIT_ATTR_ZONE_LIMIT]) {
		err = ovs_ct_limit_get_zone_limit(