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.

Fixes: 994fcc5 ("upcall: Check for recirc_id in ukey_create_from_dpif_flow()")
Signed-off-by: Joe Stringer <[email protected]>
Reviewed-by: Greg Rose <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
joestringer committed Aug 7, 2017
1 parent 55f854b commit f2d3fef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ofproto/ofproto-dpif-upcall.c
Original file line number Diff line number Diff line change
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 f2d3fef

Please sign in to comment.