Skip to content

Commit

Permalink
datapath: Check for null pointer return from nla_nest_start_noflag
Browse files Browse the repository at this point in the history
upstream commit:

commit ca96534630e2edfd73121c487c957b17eca3b7d7
Author: Colin Ian King <[email protected]>
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 <[email protected]>
    Acked-by: Yi-Hung Wei <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

Signed-off-by: Yi-Hung Wei <[email protected]>
Reviewed-by: Yifeng Sun <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
Colin Ian King authored and blp committed Oct 18, 2019
1 parent 4c94120 commit 5a6069e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions datapath/conntrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 5a6069e

Please sign in to comment.