Skip to content

Commit

Permalink
openvswitch: potential NULL deref in sample()
Browse files Browse the repository at this point in the history
If there is no OVS_SAMPLE_ATTR_ACTIONS set then "acts_list" is NULL and
it leads to a NULL dereference when we call nla_len(acts_list).  This
is a static checker fix, not something I have seen in testing.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Jul 23, 2012
1 parent 563d34d commit 5b3e7e6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/openvswitch/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ static int sample(struct datapath *dp, struct sk_buff *skb,
}
}

if (!acts_list)
return 0;

return do_execute_actions(dp, skb, nla_data(acts_list),
nla_len(acts_list), true);
}
Expand Down

0 comments on commit 5b3e7e6

Please sign in to comment.