Skip to content

Commit

Permalink
ofproto-dpif-upcall: Fix key attr iteration.
Browse files Browse the repository at this point in the history
This call is operating on messages generated by the datapath. If a
datapath implementation sends improperly formatted netlink attributes,
then it's possible for a revalidator thread to end up trapped in an
infinite loop iterating across these attributes. Rather than using the
UNSAFE variation of this iterator, use the regular version.

From master commit f2d3fef.

Fixes: 994fcc5 ("upcall: Check for recirc_id in ukey_create_from_dpif_flow()")
Signed-off-by: Joe Stringer <joe@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
joestringer committed Aug 7, 2017
1 parent 5d30c7a commit c4571d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ofproto/ofproto-dpif-upcall.c
Expand Up @@ -1649,7 +1649,7 @@ ukey_create_from_dpif_flow(const struct udpif *udpif,
* relies on OVS userspace internal state, we need to delete all old
* datapath flows with either a non-zero recirc_id in the key, or any
* recirculation actions upon OVS restart. */
NL_ATTR_FOR_EACH_UNSAFE (a, left, flow->key, flow->key_len) {
NL_ATTR_FOR_EACH (a, left, flow->key, flow->key_len) {
if (nl_attr_type(a) == OVS_KEY_ATTR_RECIRC_ID
&& nl_attr_get_u32(a) != 0) {
return EINVAL;
Expand Down

0 comments on commit c4571d8

Please sign in to comment.