[ovs-dev] [PATCH] xlate: fix xport lookup for recirc

Ben Pfaff blp at ovn.org
Thu Jan 4 23:28:38 UTC 2018


On Thu, Dec 21, 2017 at 02:22:43PM +0000, Zoltán Balogh wrote:
> Xlate_lookup and xlate_lookup_ofproto_() provides in_port and ofproto
> based on xport determined using flow, which is extracted from packet.
> The lookup can happen due to recirculation as well. It can happen, that
> packet_type has been modified during xlate before recirculation is
> triggered, so the lookup fails or delivers wrong xport.
> This can be worked around by propagating xport to ctx->xin after the very
> first lookup and store it in frozen state of the recirculation.
> So, when lookup is performed due to recirculation, the xport can be
> retrieved from the frozen state.
> 
> Signed-off-by: Zoltan Balogh <zoltan.balogh at ericsson.com>
> CC: Jan Scheurich <jan.scheurich at ericsson.com>

Thanks for working on finding and fixing bugs.

Storing a pointer to an xport, then checking later that it points to a
valid xport, is risky because it opens up the possibility that the
pointer points to a different xport that just happens to have the same
address.  It's hard to guess how likely that coincidence is, but it
would be better to avoid it.  This is the reason that frozen_state uses
a random UUID to locate "ofprotos".  Probably, that approach would be
better for xports too.

When xport_in is nonnull but invalid, wouldn't it be better to abort
than to search for an xport the fallback way?

What is the reason for the special case for patch ports?

Can you provide a good example of where this is important?

Thanks,

Ben.


More information about the dev mailing list