summaryrefslogtreecommitdiff
path: root/datapath
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-10-15 10:27:50 -0700
committerBen Pfaff <blp@ovn.org>2019-10-18 10:55:47 -0700
commit5a6069e3f4621d8228edcbacf8c0a6b82546c60b (patch)
tree2b21d549458771687b5cde5955c7a9e0d4c40013 /datapath
parent4c941202f749c169de04d606a2c9b73e137e79f8 (diff)
downloadopenvswitch-5a6069e3f4621d8228edcbacf8c0a6b82546c60b.tar.gz
datapath: Check for null pointer return from nla_nest_start_noflag
upstream commit: commit ca96534630e2edfd73121c487c957b17eca3b7d7 Author: Colin Ian King <colin.king@canonical.com> Date: Wed May 1 14:41:58 2019 +0100 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: 11efd5cb04a1 ("openvswitch: Support conntrack zone limit") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'datapath')
-rw-r--r--datapath/conntrack.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/datapath/conntrack.c b/datapath/conntrack.c
index 9a7eab655..86e7dd24b 100644
--- a/datapath/conntrack.c
+++ b/datapath/conntrack.c
@@ -2273,6 +2273,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(