On 07/31/2017 04:54 PM, Joe Stringer wrote:
This calls is operating on messages generated by the datapath. If a

s/calls/call

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 the actions attributes. Rather than using
the UNSAFE variation of this iterator, use the regular version.

Fixes: e672ff9b4d22 ("ofproto-dpif: Restore metadata and registers on 
recirculation.")
Signed-off-by: Joe Stringer <[email protected]>
---
  ofproto/ofproto-dpif-upcall.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index b2f9d91d2d9c..8d1783accdc8 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1606,7 +1606,7 @@ ukey_create_from_dpif_flow(const struct udpif *udpif,
              return EINVAL;
          }
      }
-    NL_ATTR_FOR_EACH_UNSAFE (a, left, flow->actions, flow->actions_len) {
+    NL_ATTR_FOR_EACH (a, left, flow->actions, flow->actions_len) {
          if (nl_attr_type(a) == OVS_ACTION_ATTR_RECIRC) {
              return EINVAL;
          }

I suppose we have to protect ourselves from malformed messages but I suppose 
there might be some small impact on performance?

Reviewed by: Greg Rose <[email protected]>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to